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/
Related
I want to play videos in my app using the Cordova plugin, which is available for both the iOS and Android platforms. I am aware of the HTML5 video tag but wish to use plugins. I have tried this plugin and have successfully used it. However, it only plays videos from a web URL, and I wish to play videos from my local file system.
Can anyone tell me how to do this?
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
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 planning to create a music app which allows user to choose from a number of inbuilt audio. The closest thing I found on the web was jPlayer plugin for jQuery which I couldn't make it work on Android. My app is based on jQuery mobile.
Is there any really simple way to add audio to my web app which I am planning to convert to .apk using phonegap. I intend to provide a list of links/file names to user in my app and on clicking the file name/link, the audio player controls shall be displayed and the selected audio shall start playing.
I have also tried the HTML embed tag and it also didn't work in the apk.
PhoneGap doesn't support the tag yet as far as I know.
I have heard of people successfully using the PhoneGap API +jQuery Mobile to get it working via this tutorial: http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt1part1
Looks like you can use a PhoneGap plugin to do this:
window.plugins.webintent.startActivity({
action: WebIntent.ACTION_VIEW,
url: 'http"//whatever.mp4'},
function() {console.log('Wow this actually worked!');},
function() {console.log('Failed to open URL via Android Intent');}
);
https://groups.google.com/forum/?fromgroups=#!topic/phonegap/nEm47r1Bhak
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