Is it possible to play a remote video which is in server using html5 in android.
I have tried playing the local video and it works fine.
Android tag support is very flanky in currently deployed phones. You can search about various problems of it here at stackoverflow.com.
I'd suggest using link to a video file on the remote server which is then opened in a standalone media player. This guarantees that the video will work on all the devices.
works fine in 2.3+ (tested personally on 2.3, 3.0, 3.1 and 3.2)
try absolute paths instead of relative paths, the type attribute should only read "video/mp4" or "video/webm" - nothing more!
check http://caniuse.com/webm and http://caniuse.com/mpeg4 for supported codecs. Ogg-Video is not supported so far.
Related
=== BACKGROUND SUMMARY===
At this moment, we are using Android VideoView to perform video play black. Everything seems to be working great until we encounter Live Streaming.
VideoView tends to have 10-15 seconds delay from the live stream within a local network (LAN).
While attempting to solve this issue, we came across VLC Embed for Android. After searching on the Internet, it seems there isn't any article compare pros and cons of using Android VLC Embed vs. Android VideoView.
=== QUESTION ===
What's the advantage (pros) and disadvantage (cons) of using Android
VLC Embed vs. Android VideoView?
Is VLC Embed stable?
Anything I should be careful when switching existing VideoView to VLC?
Thank you all in advanced
My view may not be very professional but it's about what I've experienced so far.
First, Android VideoView is good since it comes with the Android SDK so it does not require external library. But this one has some limits. For example, as far as I know, it doesn't support MMS and MMSH protocols and some others I didn't quote. Which is not the case for Android VLC SDK. This library is complete and supports almost all media formats I know so far.
It just increases your apk on size, on my side that's the only disadvantage.
Is the Android VLC SDK stable? Yes it's stable and maintained by a huge community.
Anything I should be careful when switching existing VideoView to VLC?
You should keep your sources same and care about aspect ratio.
What's the advantage (pros) and disadvantage (cons) of using Android VLC Embed vs. Android VideoView?
Advantageļ¼
More features. VLC supports almost all media formats, hardware decoding. audio tracks, subtitles, chapter are also supported.
More integrated, simpler logic. You can easily get media information and cache them. The playback engine will proactively notify state changes and events, just register player event listening.
Disadvantage:
APK file size increas. If both arm64-v8a and armeabi-v7a are supported, it will increase more than 30MB.
Multiple instances are not perfect. For example, playing 2 videos at the same time is a hassle.
Is VLC Embed stable?
Stable. Starting with VLC 2.0.x (now 3.0.x), I use the VLC library in my Android App. It runs steadily from Android 5.1 to Android 8.0. A small number of 4k h265 video playback is not normal, but can be resolved by displaying "Can not play".
Anything I should be careful when switching existing VideoView to VLC?
To use LibVLC on Android The Medialibrary(org.videolan.medialibrary) is also required. You also need to note the licenses.
VLC for Android is licensed under GPLv3
This may be a concern for you if your project uses a different license.
I have opened many sites that use HTML5 video in the emulator ( android 2.3.3 and android 5 ) but it doesn't work: I can hear the audio but the video doesn't appear. On my smartphone ( samsung s5 with android 5 ) it works.
So why html5 video tag doesn't work well in the emulator ?
I would recommend checking if the encoding format is compatible with the emulator version and the android requirements. That can be done here:
http://developer.android.com/guide/appendix/media-formats.html
Also remember to check beneath the initial grid for the encoding requirements.
To read more about HTML5 videos in android:
http://www.broken-links.com/2010/07/08/making-html5-video-work-on-android-phones/
Hope this helps you understand the problem better. Try and look around on his site for more of his blogs posts on the different subjects. He seems pretty competent.
I found a few questions on Stackoverflow like this but no answer yet. I'm trying to stream camera input from an Android device to a HTML5 video tag for some real-time image processing. The Camera plugin for Phonegap does not support this so I tried using getUserMedia. This almost worked except that Chrome does not support the file:// protocol for getUserMedia, where the video stream is stored(I believe). It works when I run it from a server but I want to be able to use this app locally, without an Internet connection. Does anybody have any ideas? Thanks!
Using the html 5 audio tag it appears it is possible to play back an mp3 through the android browser. Is it possible to do it using a wav file? If not through the audio tag is there another way to do it?
The HTML5 <audio> tag supports WAV files. Depending on your version of Android, though, it might not work in the native browser. For example, no format worked in Android 2.2. I tried it on my own phone, the Galaxy Nexus with Jelly Bean using the excellent test on Are We Playing Yet?, and found that it was not supported.
The other way to do it is to transcode your WAV file to a different format and use HTML5 audio. The Flash based WavPlayer might work too, but please remember that Flash was discontinued for Android and is not guaranteed to be installed on all devices.
android version 2.2's native browser supports ".wav" file. but android 4.0's native browser does not support ".wav" file.
I'm developing a mobile video platform and I have playing in mobile safari and some Android browsers. The problem I'm having is that my solutions thus far (have tried regular HTML 5 video as well as VideoJS) have only worked on about 50% of the Android browsers I've tested.
I have added the three web formats to my video tag (ogv, webm and mp4) as well as provided a fallback flash object but it seems that a lot of the Android mobile browsers still refuse to play any video.
Has anyone had a similar experience that could propose a solution?
Thanks,
gearoid.
Strange resolution with this one. I need to add the video sources in the appropriate order to get multi-device compatability. The sources need to be added to the video tag in the following order:
MP4
WebM
OGV