I can't seem to get any videos playing in iOS 6. Both on the device (iP4) and simulator.
What I have is a UIWebView setup in IB. Then in my viewDidLoad
I have the following code:
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://domain.com/app/player.php?vid=%@", [videoDetails objectForKey:@"vid"]]];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[videoWebView loadRequest:requestObj];
Just to explain, the video settings on vimeo are that it is only allowed to be hosted on a specific domain, otherwise it will display an error message. So I have some simple HTML set up in player.php that just calls the vimeo embed code.
When I go to the view that has the UIWebView on it, and the video has loaded in and you see the 'play' icon in the vimeo video, I click that and then the video shows a loading icon and then after about 5-10 seconds, the console outputs the below and the UIWebView just goes white.
Console output:
2013-01-30 16:50:11.809 My App[2807:907] [MPAVController] Autoplay: Enabling autoplay
2013-01-30 16:50:11.821 My App[2807:907] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
2013-01-30 16:50:11.831 My App[2807:907] [MPAVController] Autoplay: Enabling autoplay
2013-01-30 16:50:12.042 My App[2807:907] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
2013-01-30 16:50:21.254 My App[2807:907] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
2013-01-30 16:50:22.000 My App[2807:907] [MPAVController] Autoplay: Enabling autoplay
2013-01-30 16:50:22.244 My App[2807:907] [MPAVController] Autoplay: Disabling autoplay for pause
2013-01-30 16:50:22.246 My App[2807:907] [MPAVController] Autoplay: Disabling autoplay
2013-01-30 16:50:22.354 My App[2807:907] [MPAVController] Autoplay: Disabling autoplay
2013-01-30 16:50:22.591 My App[2807:907] [MPAVController] Autoplay: Enabling autoplay
2013-01-30 16:50:22.593 My App[2807:907] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
2013-01-30 16:50:22.655 My App[2807:907] [MPAVController] Autoplay: Enabling autoplay
2013-01-30 16:50:22.973 My App[2807:907] [MPAVController] Autoplay: Enabling autoplay
2013-01-30 16:50:23.057 My App[2807:907] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
On iOS 5, the video just plays as expected. The thing is, this isn't related to just vimeo. I've tried the following:
Vimeo random public video (no embedding in a file hosted on domain.com)
NSString *htmlStringToLoad = [NSString stringWithFormat:@"http://player.vimeo.com/video/32424117?title=0&byline=0&portrait=0&width=320&height=181&frameborder=0"];
[videoWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:htmlStringToLoad]]];
And then again with YouTube:
[videoWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.youtube.com/watch?v=dABo_DCIdpM"]]];
My only concern is getting it working with Vimeo videos, as this is where they are all stored. But I can't see vimeo being the problem here as it doesn't work on YT either so there must be something I'm doing wrong to keep iOS 6 happy? I've Googled around a bit and I can't seem to find any solution at all, even though I don't think it's just me this has happened to.
Thanks in advance.