Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Playing videos in UIWebView broken in iOS4?

I have an app that's worked since version 2.0 of the SDK where I create and add a UIWebView and then load the URL of an .mov to play a movie. Ever since the early version of the 4.0 beta up until the 4.0 GM this has stopped working. When I load a movie now I get the following error: :Plug-in handled load" and the movie never displays.

Is this a known issue? Am I doing something wrong in 4.0?

like image 827
rforte Avatar asked Jun 08 '10 18:06

rforte


1 Answers

I figured this out. It appears to be an issue with iOS4 not being backward compatible with a UIWebView created with 'init' rather than 'initWithFrame'. In 2.0 - 3.1.3, you could only show video in a UIWebview as full screen. I think this is why it didn't matter if you called 'init' -- the movie player would kick in and go fullscreen. However, in 3.2 and higher you can now inline video in a UIWebView so you have to call initWithFrame and give it something like [[UIScreen mainScreen] bounds] so there's a visible view. Not quite sure if this is bull or not but seems to be the case.

like image 56
rforte Avatar answered Oct 30 '22 06:10

rforte