Kaltura open source player does not play video in Android webview - android

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(){});

Related

Android: unable to play/pause html5 video programatically until manually started

I have an Android KitKat application with an embedded WebView. The page contains an html5 video element. The video loads fine, but play() has no effect until I tap the play button on the screen, and then play() and pause() work fine. I have also tried myWebView.setWebChromeClient(new WebChromeClient());, but this makes no difference. Also, this same page works fine in Chrome browsers on Mac and Linux.
Well, I found the problem. Android 4+ will not allow autoplay of video or programmatic start of play without first having the user tap the play button on the screen. This is so the user will implicitly acknowledge the use of bandwidth by manually activating playback. While I understand why this would be reasonable for a phone user with a cell connection, my application is a television with an Android HDMI stick. This is a very unfortunate restriction. See more here: Autostart html5 video using android 4 browser
EDIT: There is a workaround - while the stock browser cannot achieve this, using an embedded WebView gives you a little more control:
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.setWebChromeClient(new WebChromeClient());
myWebView.getSettings().setMediaPlaybackRequiresUserGesture(false);
This solved the problem!

Android webview video play inline on 4.2

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!

Errors playing YouTube content from within an Android Webview on Google TV

I have a requirement to play YouTube video content from within an Android application on Google TV. Specifically, we'd like to play it from within a Webview inside a Google TV app. This works on Honeycomb devices (3.1), but does not work on GTV.
Here is the video we are testing with, and how we are linking it via a URL that is loaded into a Webview:
<iframe class="youtube-player" type="text/html" width="400" height="285" src="http://www.youtube.com/embed/u1zgFlCw8Aw" frameborder="0">
The page we are loading in the Webview also WORKS fine when using the regular Browser app (the video plays there, embedded via an iframe, just fine!).
Here are the Webview settings that we are using:
web.getSettings().setJavaScriptEnabled(true);
web.getSettings().setPluginState(PluginState.ON);
When loading the same URL that works in the Browser app from our own app, via a Webview, it fails. The screen shows the initial YouTube video in the box with the controls, but when play is pressed the box turns to plain black and no video plays. SOMETIMES audio plays, but never video.
Logcat shows:
E/libEGL(14956): call to OpenGL ES API with no current context (logged once per thread)
D/ShaderProgram(14956): couldn't load the vertex shader!
I did find an open bug report with another user having the same problem (http://code.google.com/p/android/issues/detail?id=22018) , but there is no follow up there, so I thought I would see if SO gets more attention. Does anyone have any more insight about this issue?
thanks
I've been working on a solution to the same problem. It is working on both tablets and Google TV (including the revue).
The major difference from your code is that I create the HTML code in the android app in code and pass this to webView.loadDataWithBaseURL
webView.loadDataWithBaseURL("http://www.youtube.com", html, "text/html", "utf-8", null);
For more details, please see the source I am working on:
http://code.google.com/p/android-reddittv/source/browse/trunk/RedditTV%20HD%20Android/src/com/elsewhat/reddittv/hd/YoutubePlayerActivty.java

Android video playing issues

I have a HTML5 webapp with videos, stored in internal memory.
If I open the webapp in a WebView from the internal memory, the video doesn't play with a message: "Sorry, this video is not playable".
However if I copy the webapp to a server and open it via http, video plays fine.
I also tried to play the video in a VideoView, but the same happens like above:
From internal memory it doesn't play, however if opened via http from a website it works just fine.
Any workarounds? How to solve this problem?
Have you enabled javascript and other plugins to your webview?
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setJavaScriptEnabled(true);

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