1
votes

I am developing an iPad app that embeds YouTube videos in HTML5 format into a UIWebView. The problem is that I want to pause the video when a user brings up modal dialog windows, rather than clear or stop the video as many have suggested. This is critical to a good user experience. Does anyone know any JavaScript or API that I can run to simply pause the video when an action that presents a modal dialog will occur?

The method I use to embed is described here. http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html

2

2 Answers

0
votes

This blog explains hot to build a video in HTML 5.
http://blog.steveheffernan.com/2010/04/how-to-build-an-html5-video-player/

Then interact with the video player via the method [myWebView stringByEvaluatignJavaScriptFromString:@"playVideo()"].

I didn't tested but it seems straightforward.

Are you sure we can play embedded YouTube videos in mobile Safari?

Good luck!