Vimeo videos not playing on iPad UIWebView - objective-c

Ok so I've looked around at the majority of other problems people are getting with vimeo and I don't think they've hit upon the same issue I've been getting.
When I open up a vimeo video on the Safari app on both my iPhone and iPad, they both work fine no problems.
Now I have created an iPhone app which has a UIWebView and loads a vimeo player video and that works fine too.
The issue is if I now install the same app on my iPad, the vimeo player refuses to load the video, it just hangs and the spinner keeps on spinning but the video won't load.
However, now what I did after that was create a basic app which loads a vimeo player URL in a UIWebView as a native iPad app, not an iPhone app which is resized or "2x" to fit an iPad. Surprisingly, this worked fine.
So now I'm confused... why is it that the iPad will not play the vimeo video if it's not running an app designed for the iPad? Is there some special magic going on behind the scenes which might break this?
I'm at a loss here, any help would be appreciated

Implement the delegate method : shouldStartLoadWithRequest then in that method just detect that whether the requested URL is of type VIDEO if it is then please follow the code given in below link which worked for me :
Playing a video file from server in an Iphone app
This will be good in playing any video.

The problem is likely with the user agent which is different from Safari's one on Apple devices: UIWebView sends some invalid string causing Vimeo (and sometimes YouTube) to break.
Luckly, you are allowed to override app's user agent using the following (C#, let me know if not clean enough):
NSDictionary dictionary = NSDictionary.FromObjectAndKey(new NSString("Mozilla/5.0 (" + (UIDevice.CurrentDevice.Model.Contains("iPad") ? "iPad" : "iPhone" ) + "; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25"), new NSString("UserAgent"));
NSUserDefaults.StandardUserDefaults.RegisterDefaults(dictionary);
This makes the videos play just fine.

Related

play sound of youtube video when app is in background

I am using RMYouTubeExtractor to play youtube video inside my app in a MPMoviePlayerController.
I need to play the sound of the video (and show the thumbnail of the video on the lock screen) if the phone is locked or the app is in the background.
Is there any way to do that ?
Please help.
Thank you.

Video.js for Vimeo

I use video.js for vimeo. Played on the desktop in a custom player with my styles, it's good, but on the tablets and mobiles played in a default browse player. Why? I want custom player in mobile too. Can you help me?
In a recent version video.js was updated to use the custom skin on touch devices, so you might try updating your version. But this will still only make a difference on tablets that don't go to fullscreen video. On iOS devices and most(?) android devices, whenever the video goes to fullscreen it uses the native controls, and there's nothing we can do in the browser to change that. Hopefully in the future the devices will adopt the requestFullscreen browser API so we can use custom controls in that context.

UIWebView's allowsInlineMediaPlayback property does not work on 4.2 on iPad

I have a UIWebView with emebedded html5 videos. The webview instance has allowsInlineMediaPlayback set to NO, but this setting doesn't seem to working with 4.2 SDK both on the iPad simulator and the device - videos are still play inline on initialization unless I have a controls enabled and the full screen button is pressed.
I also tried calling the video.webkitEnterFullScreen() JS method on the element on various video events but it seems like it only works if it specifically came on a user-inited action (onclick,touchstart etc..)
Anybody experiencing the same issues?
Have you tried setting mediaPlaybackRequiresUserAction to NO then calling video.webkitEnterFullScreen() ?

How can I format a movie to play through MPMoviePlayerViewController on the iPad?

I've been struggling to make video on the iPad work. I'm using an MPMoviePlayerViewController and it plays fine in the simulator. I've tried several different converters, including ones dedicated to producing iPad-formatted video, but none of the videos play on the device. The MPMoviePlayerViewController loads and the controls appear.
For most of the videos, the spinning progress indicator never goes away. For a few, the video loads but when I press play the video immediately pauses. I know that the video is there because I can scan through and see various frames.
I know the code works because it plays a different movie file perfectly. I just have no idea what I'm doing wrong that's preventing my movie from playing. Does anyone know a good step-by-step process of getting an iPad-formatted video from any .mov or .mp4?
Thanks,
Luke
Also, just for future reference, import target video into iTunes, then highlight it and from the Advanced menu choose "Create iPod or iPhone Version" or "Create iPad or AppleTV Version" depending on your target device.
This guarantees that the right codecs are used and the right bitflags set on the video file.
Fixed - the one that loaded but couldn't play eventually worked. Why? Who knows.

Objective-C iPhone - Playing youtube within an app

Is it possible to play youtube using the method described in this url
http://iphoneincubator.com/blog/audio-video/how-to-play-youtube-videos-within-an-application
but with a custom button? (i.e in the picture in the link, it's of a baseball game with the play button overlay on top, I want that to be a custom button that I create)
Thank you,
Tee
No, the way that you play YouTube videos is by opening it in the mobile site, which takes you to the embedded QuickTime/YouTube viewer. It doesn't play them in the view of your app like the QTView would on a Mac.