I’d like to play a YouTube video in my iPhone app inside a view or a webview.
I know it’s possible to play inline videos on the iPad, but I haven’t been able to do that on the iPhone. As soon as the video starts playing, the movie player goes to fullscreen so my UI is not visible.
Does anyone know how to overcome this limitation? Is there any other app that does that on the app store?
Thanks!
Use this code for adding the you tube into your application.
For this you need to setup a webview in your view.
Then call the
loadHTMLString:baseURL:method on theUIWebViewinstance with some carefully constructed HTML that contains the YouTube embedded player code snippet and some supporting HTML to make sure that the video thumbnail appears correctly. Set the base URL to the URL of your website (it doesn’t do anything here — ordinarilyUIWebViewuses it to handle relative URL links correctly).For further reference : YouTube