I'm having a bit of an issue with playing local videos in a UIWebView when clicking on the full screen button.

This is an iPad app and when I go to the view that has the video, and click the play button it will play fine, I can skip and pause/play. But when it comes to clicking full screen it will stretch the video out to full screen, play for a second, full screen will disappear and instead of showing the video in it's place is just a white box. I've tested this on an iPad 3rd Gen running iOS 6 and the iPad simulator running iOS 6 and both do the same. However on an iPad 1st Gen running iOS 5 and a simulator running iOS 5, both will play full screen fine.

On the iOS 6 iPad/simulator, when I click play on the video, in the debug area I see the following:

2012-12-06 16:11:07.361 PICO[19131:11f03] [MPAVController] Autoplay: Enabling autoplay
2012-12-06 16:11:07.362 PICO[19131:11f03] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
2012-12-06 16:11:07.362 PICO[19131:11f03] setting movie path: file:///Users/Nathan/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/DB4C3A91-F148-417B-8319-4690F89E1382/PICO.app/30.20.mp4
2012-12-06 16:11:07.362 PICO[19131:11f03] [MPAVController] Autoplay: Enabling autoplay
2012-12-06 16:11:07.368 PICO[19131:11f03] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
2012-12-06 16:11:07.437 PICO[19131:11f03] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
2012-12-06 16:11:07.447 PICO[19131:11f03] [MPAVController] Autoplay: Enabling autoplay
2012-12-06 16:11:07.448 PICO[19131:11f03] [MPAVController] Autoplay: _streamLikelyToKeepUp: 0 -> 1

And then when I click the fullscreen button:

2012-12-06 16:12:39.918 PICO[19131:11f03] [MPAVController] Autoplay: Enabling autoplay
2012-12-06 16:12:40.168 PICO[19131:11f03] [MPAVController] Autoplay: Enabling autoplay
2012-12-06 16:12:40.178 PICO[19131:11f03] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)

Here is my code anyway:

.h

@property (strong, nonatomic) IBOutlet UIWebView *videoView;

.m

[videoView loadHTMLString:@"<body style=\"margin:0px;\"><video src=\"30.20.mp4\" controls width=\"640\" height=\"360\"></video></body>" baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]bundlePath]]];
videoView.scrollView.scrollEnabled = NO;

So as you can see I'm just using loadHTMLString to load in the video tag sourced with a local video. I've had a good look online and just can't find anything about this. Hopefully it's just something simple!

share|improve this question
1  
You're using UIWebView only to play video? Why not MPMoviePlayerController or MPMoviePlayerViewController? – lupatus Dec 6 '12 at 16:54
@lupatus Because with a UIWebView I can posiition where I want at the size I want, it will show a frame of the view and a play button. When clicking that play button it will play within that 640x360 area which is necessary as there is information required along side it, and it will also give the option for full screen. And I can do all that with two lines of code as above. And it just works. And I had a look at MPMoviePlayer but it doesn't seem to do anything like that as easy, feel free to prove me wrong though – Nathan Dec 7 '12 at 8:28
I have to check it, I was playing with video player some long time ago, but I think it was also like couple lines of code. – lupatus Dec 7 '12 at 11:05
any solutions? I am also stuck with the same problem. – Nikita P Jan 4 at 10:09
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.