I have developed a universal application in Cocos2D. I am using the same code for iPhone and iPad.
The problem is that I am playing video by CCVideoPlayer. CCVideoPlayer is a extension class. For iphone I am using mov file and for ipad I am using mp4 file. But mp4 file is not playing. I did not change the code and when I tried to play the same video which I am using for iPhone it is working on the iPad also. So I think that problem is with mp4 video not with my code. So any help will be appreciated to solve my problem.
-(void)playMovie{
[CCVideoPlayer playMovieWithFile:#"video_ipad.mp4"];
}
I have a m4v video that is able to play using html5 video tag on the iPhone - but it wont play on the iPad using html5. If i go directly to the video file from the iPad it plays fine- But if I use the html5 video tag to link to it the play button wont show. Im testing using an iPad 1 and iPhone 4 - both running iOS 5. Does anyone have an idea why it wont play on the iPad?
Html5 video page - Video URL
Hey this probably won't help much for your situation but i found that with video streaming through a webview, it won't let you play video's past a certain file size.
Here is my problem, I would like to play flash video in my iphone app.
I'm parsing XML file and I get flash video url like this : http://www.dailymotion.com/video/xg8evw_electric-pursuit-english-version_auto
How can I do?
Thanks.
It looks like your video on the page is encoded as an H.264 MP4, so you can pull it in directly - http://vid.akm.dailymotion.com/video/693/662/27266396_mp4_h264_aac_hq_2.mp4?aksessionid=-1459231571_739074&akauth=1295628091_ff040ccd7dbe1834e6127da452a4069d (that's your video path)
I found it!
Dailymotion added a new feature which generates an iframe compatible with Ipad, Iphone and Android.
Go on video page,
Click on Embed button (under video)
Check the checkbox Enable iframe player compatible iPhone, iPad, Android ... (Beta)
I've created an HTML5 video player (very simple) that works perfectly on the iPad and the browser.
However, when I open it on the iPhone, I only get a play button which, when pressed, opens the native video player on a new window, on top of all my stuff.
That means I lose access to my custom controls and time tracking (written in Javascript), since the video is now running isolated.
Is there any way to override Apple's control of HTML5 video on the iphone and get it working like on the ipad?
Cheers
I filed a bug with Apple.
After a couple of weeks they got back to me saying, very simply, that I should add "webkit-playsinline" to the video tag on the HTML, as well as adding the "allowsInlineMediaPlayback" property on the UIWebView.
So in the end, this is what it looks like:
HTML
<video id="player" width="480" height="320" webkit-playsinline>
Obj-C
webview.allowsInlineMediaPlayback = YES;
And all works just fine :)
It's virtually undocumented and the only place I could find a reference to "webkit-playsinline" was in the iAds reference, where it says: "iAds JS only".
Until iOS Safari implements inline video support, you need to write video decoder in a web supported language. There are existing implementations of video decoders, such as Broadway for H.264 (video), jsmpeg for mpeg1, and ogv.js (video and sound support).
Keep in mind that the process of decoding a video is computationally heavy. Expect a relatively slow FPS (±20).
For your reference, these guys have prepared a demo of a video that you can play on your iOS device.
In iOS 10+
Apple enabled the attribute playsinline in all browsers on iOS 10, so this works seamlessly:
<video src="file.mp4" playsinline>
In iOS 8 and iOS 9
You can work around this issue by simulating the playback by skimming the video instead of actually .play()'ing it.
You can use iphone-inline-video to take care of the playback and audio sync (if any), and it keeps the <video> working as it should.
Do you have an app created or is this for mobile safari? If you have an app and use UIWebView you should set UIWebView's allowsInlineMediaPlayback property..
In iOS 10 adding 'playsinline' attribute to the HTML5 video tag did not prevent fullscreen playback on an iPhone UIWebview until I also added the 'controls' attribute. This is how I got it working:
<video width="100%" height="240" controls playsinline>
<source src="movie.mp4" type="video/mp4" >
</video>
With, of course, _webView.allowsInlineMediaPlayback=YES; in the ViewController also.
There are some work arounds, I'm working on a library to allow this functionality automatically. However, until Apple sets safari to
webview.allowsInlineMediaPlayback = YES;
then we will have to use hacks for the same behavior.
You can check out the project here: https://github.com/newshorts/InlineVideo to see if it meets your needs.
Just add following to your config.xml:
<preference name="AllowInlineMediaPlayback" value="true" />
Otherwise UIWebView will neglect the webkit-playsinline attribute.
You can easily allow this by adding this to your config.xml:
The UIWebView should then respect the webkit-playsinline attribute.
Does anyone have any experience embedding .m4v movie files into webpages for playback on the iPhone?
I'm trying to create a site optimized for the iPhone, and it includes a video, but I just can't get the video to play - all I get is the grey play arrow with a line through it.
The markup I'm trying to use for embedding it is this:
<embed width="199" height="159" type="video/x-m4v" href="http://www.samplesite.com/motion/mymovie.m4v" src="http://www.samplesite.com/motion/mymovie.jpg"/>
<embed> is old school
use HTML5's <video>
iPhone supports it
<video width="199" height="159" src="http://www.example.com/mymovie.m4v" />
You got the gray play arrow with a line through it, it probably means that the MPMoviePlayerController class can't play the movie.
This class only supports H.264 Baseline Profile Level 3.0 video (up to 640 x 480 at 30 fps) and MPEG-4 Part 2 video (Simple Profile), and there's a possibility that your movie file doesn't match this requirement.
HTH