Is it possible to embed a youtube video in your application, but rather than showing the user a preview thumbnail that can be touched, show a standard UIButton that loads the video directly into the actual youtube player when touched. After the user clicks done control would return to my application (as it does with embedded webview) Is this possible?
Use youtube custom URL scheme. Read it from here
E.g.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://www.youtube.com/watch?v=VIDEO_IDENTIFIER"]];
This approach will take you out of your app and open native Youtube app. I don't think there is any thing available in youtube player options to hide thumbnail. For autoplay without tapping UIWebView please read answers for this this and this
Related
I'm developing a Windows Phone 8.1 app that plays a video using the MediaElement control. I'm facing some problems for which I've not been able to find information. I've uploaded an example app here: https://mega.co.nz/#!s9sFiQDK!JDI9ar8qWqWIZ_Ot-Q8K8X0qfQ5YG7ATLAiHypOs5Ow
If a click the button in the default page, the app navigates to a second page that contains a MediaElement to play a video. My app is configured to be Portrait only, but I want the video to be displayed in Landscape. For this, I'm changing the screen orientation when clicking on the button and before navigating to the video page with this line: Windows.Graphics.Display.DisplayInformation.AutoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.Landscape; The problem with this is that I can see in the app when the orientation is changing which looks ugly. How can I do to make the video display in landscape without having to change the orientation of the screen? I've seen in the Facebook app that when a video opens, the app does navigate to another page (or at least it seems so from the transition animation that I see) but even though, videos open and play in landscape, there is no screen rotation.
I want to hide the StatusBar before the page with the video is displayed. I've put this line statusBar.HideAsync(); in various places but regardless, I always see that the StatusBar is still hiding when the video is already visible and playing. Again, the Facebook app does hide the StatusBar before the video is shown in the screen.
When the video is playing, if I press and hold the back hardware button, the app is minimized. Now, if I click on its screenshot to go back to it, the app comes to the foreground, but the video is not playing anymore. If I tap on the video to see the video controls, I can see that the video progress line is moving, but the video is like frozen. If I pause the video and play it again, the video resumes. How do I do to make the video to continue to play when the app comes to the foreground? In the Facebook app when I do this, the app comes to the foreground, but the video page is closed and the app takes me to the timeline page. Is this the only way of doing it? If so, how do I detect that when the app comes to the foreground there is a video playing so I can close the page and navigate to the previous one.
If you always want the video page in landscape mode, you can call
Windows.Graphics.Display.DisplayInformation.AutoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.Landscape;
in the page constructor, after InitializeComponent();
Calling
StatusBar.GetForCurrentView().HideAsync();
in the main page constructor is working fine for me.
I still have the same problem, I've tried different approaches, but I can't even get App.Resuming event (and unfortunately in Windows Phone 8.1 WinRT OnNavigatedTo is not triggered on app resuming).
I have an app, that has a wall, in which there can be text and YouTube links. What I want to do is to detect if that video is from YouTube, that's not hard, but the other part is to play it inside the app, not exiting it. Which I find quite hard to do.
Should I look into UIWebView, or that would only play all the videos?
If you open a youtube link in a uiwebview, this will give you the proper experience.
To do this, create a webview and display it modally (or in a navigationController). Then send the URL request with the youtube link to the webview. You will then have to either manually or automatically dismiss the webview.
Take a look YouTube video in UIWebView and UIWebView modal YouTube player "Done" button action .
I have a UIWebview in which a twitter page loads. Because twitter is being opened from a mobile device it opens the mobile twitter which has a specific width depending on device, and device orientation. Now my query: my UIWebview's width is shorter than mobile twitters width so the user has to scroll sideways to read content. I do not want that and want to change the zoom or preferably the width of the twitter page so it can fit in my uiwebview.The height is fine, scrolling up or down is normal. I have tried using "setScalesPageTofit" in my "webViewDidFinishLoad" and that displays the whole twitter page going out of the webview bounds. I have also tried using "sizeTofit" but no success. If any more details required please left me know
Thank you very much..
Checkout this SO Post: Getting iPhone's mobile twitter webapp inside UIWebView. The person who posted the question answered his own question.
The trick seems to be setting the correct "device-width".
I have a web site that opens iframe for video on page, page uses ajax to pull in videos from selected menu. As expected and understood, on iPod touch after selecting video it shows a play button, which brings up video in another screen. However, when the video completes, it returns browser to page prior to one where video was played from. Sequence:
open Page1
go to Page2 which offers videos to play, in iframe
play video
video completes, returns to Page1, not Page2!!
Only happens on iPod touch, so must be issue with how control is returned on video completion.
Any suggestions? If this is not a known problem, I can work up example (currently, need account on site).
Of course, because the browser returns the URL of the page that was displayed before the video was played back. It won't remember the URL of the IFRAME, that had already changed in the process of selecting a video, if I don't get you wrong.
That's a common problem with frames/iframes and one reason why you shouldn't use them.
The solution could be to place your video selection menu in your actual page and not in an IFRAME. This could be achieved by loading in into a DIV via Ajax for example.
Figured this out, sort of. Got it to go back to the right place, but I do believe that it is easy to confuse the iTouch quicktime player and Safari about where to return to.
Is it possible to play youtube using the method described in this url
http://iphoneincubator.com/blog/audio-video/how-to-play-youtube-videos-within-an-application
but with a custom button? (i.e in the picture in the link, it's of a baseball game with the play button overlay on top, I want that to be a custom button that I create)
Thank you,
Tee
No, the way that you play YouTube videos is by opening it in the mobile site, which takes you to the embedded QuickTime/YouTube viewer. It doesn't play them in the view of your app like the QTView would on a Mac.