Android webview video play inline on 4.2 - android

I'm building an app with a WebView thats supposed to play a mp4 video inline (not fullscreen) by html5 "video" tag.
It worked on my tablet(also 4.2), but failed on another target device.
Tested with default browser, always played in fullscreen and can't play second time.
I tried changing Webview Class to VideoEnabledWebView which says could solve most video problem,
but my webview still can't play video inline, only in fullscreen.
Then I install Chrome browser to test, Chrome could play video inline, but it's abnormal.
test image
Did anyone manage to solve it? Help would be much appreciated!

Related

Kaltura open source player does not play video in Android webview

I am loading a webpage inside Android WebView, the webpage has video playback using Kultura's open source video player. The same webpage plays the video fine if opened through a normal phone browser but on webview there is no playback and it continuously keeps on showing the loader.
This issue is being seen only on samsung android devices. The webpage has authenticated access therefore cant share the webpage. Any thoughts?
I resolved the issue, turns out I had to simply provide a custom implementation of WebChromeClient and now the videos magically plays:
mWebView.setWebChromeClient(new WebChromeClient(){});

Cannot play flash in android web view after many try

I am doing an android app which shows my website in the webview. My website contains a flash player for playing movie.
Here is the link which contains the flash player and I want to display on the webview.
After reading many articles, I have tried the following code:
webview2.getSettings().setPluginsEnabled(true);
webview2.getSettings().setPluginState(PluginState.ON);
webview2.getSettings().setJavaScriptEnabled(true);
webview2.getSettings().setAllowFileAccess(true);
But it is still not working.
This may sound very simple, but make sure the platform you're testing this on has the Flash Player installed.
Many android phones do not have flash player in their browsers anymore, and there isnt a flash player plugin for the WebView object.
Your best chance would be to make this video in your page viewed with html5 video tags, or let people view your website in their own browser, which may or may not work (some browsers have flash, some dont)

Video playing on Android

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.

Force non-flash Vimeo embed or disable Flash in a WebView?

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.

you tube video not playing

I am new to android. I am trying play a youtube video whose path is present in an html file.. But when I do that I get black screen and upon tapping that a link will be displayed.. But I want the video to be displayed in my webview and on touching that video should be played..
I am using the following code..
webView = (WebView)findViewById(R.id.webView1);
WebSettings websets = webView.getSettings();
websets.setJavaScriptEnabled(true);
webView.loadUrl("file:///android_asset/youtubes.html");
any help on this ?
Thanks,
Keerthi
YouTube usually requires flash. Are your links pointing to desktop version of YouTube? Do this links play in your browser in Android (not opening the YouTube app)?
Also take a look at m.youtube.com - this links are created to run on mobile devices by opening external player.
If you are running it on an emulator, then videos will not play from the youtube as you require flash. But if you are running it on a phone, then check if you added the methods properly or not. Also try using the VideoView class which takes the video source from your SD card. If it works, then it might be some problem with your code or if it doesnt works try installing any external player

Categories

Resources