Android video playing issues - android

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);

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

Play locally stored HTML5 video on Android

I'm making a webpage that needs to run completely offline on Android 4.1 tablet. I'm trying to embed video stored locally on SD card using HTML5 <video> tag. Source attribute is pointing to a subdirectory containing that video using relative path.
The problem is, that after hitting play button, video stays black and plays only sound. After enabling video fullscreen, it plays normally. Same behavior in both native browser and Chrome. When I set source to same video stored online, or enable web server on the tablet and load the video from localhost, everything works fine and embedded video plays well.
Is there any way to force local video to play in embedded mode on Android? Or is this behavior for some security reasons?

How can I let the Android 2.2 browser just stream the video instead of downloading the video from html?

I'm running into a funny problem. I have a html file where a video is embedded. When I'm launching this html from my mobile with Android 2.3, it just streams fine, I can see whole video from the android browser. But when I try to do the same from my other android with 2.2 version, it tries to download the video instead of steaming.
How can I let the Android 2.2 browser just stream the video instead of downloading the video from html?
The media player in the html file used is JW player, and the html file with video is hosted on bitsontherun website.
Any help is greatly appreciated.
The android 2.2 phone probably doesn't understand the plugin (jw player is a flash video player if memory serves).
Does the 2.2. phone have the flash pluing installed and set to use? In the webview make sure it is allowed to use the plugins as well:
webView.getSettings().setPluginsEnabled(true);

Android: webview to run SWF that plays FLVs.

Working on getting a flash project to play from a local app/folder on a Samsung Galaxy 10.1 pad.
the project is basically a flash-file that references a xml for a playlist, which contains references to other swf files or flv videos which are stored in an asset subfolder.
Using video, netConnection and netStream to play the flv's, tried FLVPlayback for a moment but no insta-fix.
The project was embedded with html and works fine for the machines it is being used on, both local and from a server. It "works" from website to the app, but it gets chunky and internet will not be available when these pads are in use.
(But I think it's important to note that flv playback DOES work from the web onto the pad, so I guess the answer to my problems might be in some permission-limitation that I don't know of. )
I've had luck with an app just having a webview load the main swf:
WebView wv = new WebView(this);
WebSettings webSettings = wv.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setPluginsEnabled(true);
wv.loadUrl("file:///android_asset/DemoV6/main.swf");
setContentView(wv);
It successfully loads SWF files from the playlist and plays them, but once it gets to the flvs the
netStream pops out an NetStream.Play.StreamNotFound:[object NetStream], and with a bit of jury-rigging the netConnection pops out a NetConnection.Connect.Closed:[object NetConnection]
[ tl/dr: (Android3.1/galaxy 10.1) --> swf --> flv ==problem ]
So the question is, what do I have to change/add to make this SWF that plays FLVs, that plays fine from the internet, but does not open FLVs from an local app? (Also, I suspect I need to store the FLV's externally later on to reduce app-size, but thats a different riddle)
Found a way around it. Attempting to embed the FLVs into the assets folder for compilation was apparently not the best way to start with. loading the files externally gave me the result I wanted.
if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
Log.d(TAG, "No SDCARD");
} else {
webView.loadUrl("file://"+Environment.getExternalStorageDirectory()+"/Folder/main.swf");
}

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