R – iPhone, how to detect when control is returned to browser

flashiphonesafariswfobjectyoutube

I'm a newbie to cocoa programing on iPhone.

My client has a website that plays YouTube videos. Once a video is finished playing, it will automatically play the next one. This is done by using the YouTube API and swfobject.

After some research, I was told that Safari on iPhone does not support flash. This make the current swfobject code not working on the iPhone browser.

As workaround, when the user clicked on an embedded player, iPhone will launch the YouTube app.

Is to possible to determine when the YouTube app has finished playing and has returned control back to browser?

Best Answer

You can use UIWebView to play videos from YouTube. You'll have to control those from your application though (start, stop, play next, etc).

Also In iOS you can register custom URI schemes and then redirect the browser (or UIWebView) back to your application. This is how many application do 3-legged OAuth for example (which requires a browser interaction). Which might require having a control over the server.

Related Topic