Is it possible to play .mp4 videos in WebView? I cant use VideoView due to some application requirements. (I want the video in a frame)
Android webkit is not powerful enough to support playing of video in webview or browser. trick is only that you have to call Videoview to play. Android native browser does the same.
Related
I have a web-view in an application and i use html5 tag.
I have had all kinds of issues on different android devices(samsung, sony, etc) with different android versions. Some could not play .mp4 and only played .m4v extensions. Another old tablet could only play mp4.
On an Xperia I had a special case. The webview couldn't play the video in html and played it in another custom video view(although this didn't bother me at all).
I need the videos to autoplay as soon as i open the webview(and have managed to do it on those few videos that work), and i have end-video event handlers that have to fire at the right time.
If anyone knows what video format + video and audio codification to use in order to have compatibility with all webviews on android please
Android webview and HTML5 player that works with the video codecs that Android supports (.mp4 is best for progressive video as it has by far the widest support), and it also supports .flv with flash plugin.
I want to use media player to play videos from any url. I found that, youtube video can be played using rtsp url, but no other videos, like vimeo video, can be played in app. Is there any method to do it?
Unfortunately Vimeo doesn't provide support for RTSP, you could use flash to this end since Android support flash, and can be easily add with a WebView and simple HTML
Also, please keep in mind that playing Vimeo videos through a non-Vimeo player usually constitutes a violation of their TOS.
I am working with an Android and PhoneGap application and am using the HTML5 video tag to play videos on my web page. When I play the video I get the audio output but the video is not visible. How can I play a HTML5 video on Android?
I've written about this issue a number of times. See my previous answer:
Playing video on AVD with phonegap
Also, I'm working on monkey patching the video tag on Android so hopefully we'll have something even better soon.
First some details to help explain:
If you load a Vimeo link such as the following:
http://player.vimeo.com/video/40234826, or use their iframe embed code,
into a WebView, one of two things will happen.
If the device has the Adobe Flash Player app/plugin installed, it will display Vimeo's embedded player. Tapping play, plays the video inline as an embed.
If the device does not have the flash plugin, it will display an image with a play button. Tapping play, opens the Video in a system VideoView. (Because the button links to an mp4 file.)
Since Vimeo's embedded play can be a bit buggy on the vast variety of devices available, I have found that option 2, playing the Vimeo video in an Android media player is a much better experience.
Now the question is, how can I convince the WebView not to use Flash?
I have tried webview.getSettings().setPluginsEnabled(false); but it still loads the flash embed version. How can I trick Vimeo's player into thinking the device does not have flash installed?
Thanks
Update
After further investigating, it seems that setPluginState(PluginState.OFF) works pre honeycomb, but this doesn't work on Honeycomb and ICS.
I mean I have a link like this: http://15....../a.stream
I write this code to see the video on android :
VideoView wv = (VideoView)findViewById(R.id.videoView1);
wv.setVideoURI(Uri.parse("rtsp://15........./a.stream"));
MediaController controller = new MediaController(izle.this);
wv.setMediaController(controller);
wv.start();
This code works first.But one day the same code say :
Cannot play video
Sorry,this video cannot played.
My first question is why that alert me like that?
second question is maybe i play video in another way maybe it is work.Like if I play video in webview maybe it is work? How I play the rtsp video stream on webview?
Thanks...
You can't play rtsp in webview. Only Flash(rtmp) stream play in browser with flash player.If streams is rtsp, then browser will open it in the external video player.
HTTPS progressive streams are only supported under 3.0+.
WebView plays rtmp as well as rtsp if your device has somehow flash working on it. It won't play without that so API version is important because flash player used to work on earlier APIs.
The best way to stream live in Android is to use Vitamio. It's the best solution out there. It can play numerous stream formats including rtmp and rtsp.