I want to have video playing in my index.html while developing phonegap android application.
But the HTML5 video is not working in webview of phonegap android application. Please suggest a way. I don't want a intent to fire a new activity and play the video in native android player instead i want it in same HtML page.
It should just work normally. Things to check:
Is the video-file hosted locally (not on an external server), external sources will be marked as unsafe.
Is the path of your video file correct? Case sensitivity is important
I am having similar problems, and still haven't figured out how to get a locally stored video to play on newer Android platforms*, but I have found that embedding a remote video works pretty well. This iframe worked on both the ios and android emulators.
<iframe width="240"
src="http://www.youtube.com/embed/YE7VzlLtp-4" frameborder="0"
allowfullscreen>
</iframe>
there are a couple of plugins to play video for Android pre 4.x
Related
I have an index.html with an iframe and inside that iframe I have the following code:
<a id="watch-live-btn" href="http://the.location.to/playlist.m3u8" target="_parent"></a>
The video plays fine on iOS and when I hit "Done" I'm sent back to the app with no problems. When I try this on Android it just sits there for some time doing nothing. The app is still active in the mean time.
iOS: 6.1
Android 4.0.4
You can make use of a phonegap plugin. There is one already created here for playing videos:
https://github.com/macdonst/VideoPlayer
If you want to stream on android pre 3.0 you can modify the plugin to use the Vitamio library as well:
http://www.vitamio.org/en/Download/
I want to play video from phonegap.I am Using Phonegap build.
I search in Phonegap Doc in this Link. But i think they only audio files play written in the docs..
So can anyone tell me its possible to play video files in phonegap using phonegap build
Yes, phonegap just creates a native iOS app using a UIWebView so you can run your HTML code. You can access any iOS features from within the app. I'm sure the same is for Android.
Playing a video can be as simple as just opening the file locally.
For instance
<video controls>
<source src="yourVideo.m4v">
</video>
Here is a reference from Apple
HTML 5 video tag inside a phonegap app will play video.If that is not sufficient u can alwaya play video using native code and plugin to phoneGap.
I Am working on android google tv project. In My project i want to play video from html embed code show below:-
<embed type="application/x-shockwave-flash" src="http://www.desifreetv.com/channels/tomandjerry.swf" file="http://desifreetv.com/locked/xml-files/tomandjerry.xml" width="707" height="483" style="undefined" id="mpl" name="mpl" quality="high" allowfullscreen="true" wmode="opaque" menu="false">
how i play
If you have a native app and plan to use a WebView with the above snippet embedded in it, you will run into issues since WebView doesn't support flash. If your app is a browser based app, flash is supported so you should be able to embed it in your web page. Alternatively, see if the provider of that content has a differently formatted videos (say, mp4 or so) and then you can use the native players.
I have been trying to play video in my android application that I made using phonegap. I had several problems and so I have several questions.
Firstly, does html5 video tag work with phonegap? I couldn't succeed to write the html5 codes.
Secondly, what types of videos are supported by android and phonegap?
Thirdly, I try to play a file whose extension is mp4. There is no scene on the screen but I can hear the voice of the video. What can be the reason?
Thanks in advance.
Nope, the video tag is broken in most if not all versions of Android. Go star these issues:
http://code.google.com/p/android/issues/detail?id=22254 and
http://code.google.com/p/android/issues/detail?id=8272
In order to work around this pain in the #$$ I've written a plugin you can use on Android to play videos.
http://simonmacdonald.blogspot.com/2011/11/video-player-plugin-for-phonegap.html
I'm doing mobile web app, in that i use html5 to play videos, it works fine
But In Android native browser if i click on the video it transfer to native media player. but i want to play it inline
How to do this? thanks
Piperoman wrote his answer in comments, so I figured I would put the link into an answer for convenience:
HTML5 <video> element on Android