Since 2 days i am trying to run youtube embeded video in my application but i didn't sucessed.
I have used everything whatever i get from stack overflow and other websites.
I tried these things with my Samsung Y duos with android 2.3.6 version
I set the following properties in in the webview settings
javascriptEnabled
pluginEnable
pluginState
cacheMode
allowContentAccess
appCachePath
and finally I implement a webViewClient of the webView as
well as override its shouldOverrideUrlLoading method.
Result - I got the first page of the video in my player but when i run that i got black screen in my player.
2- I also open the video in the iframe what youtube provide to run embeded videos.
Result - I got the same result as stated above
3- I also used android:hardwareAccelerated="true" in my manifest but it didn't work.
4- I also run this video using VideoPlayer class.
Result : I got message like this video cannot be played.In our android application we are using default video player to run videos and our default video player in Samsung Y and Samsung Y Duos is not supporting youtube embed video. This may be the reason.
5- I have also tried with html page in my assest folder and used embeded code inside my html and open this page in webview but i the front page of the video and when i play it i get blank window.
please help me to solve this problem. Any kind of help would be highly appreciated.
Related
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!
I'm trying to set a video in my Cordova 2.9.0 app by using the HTML5 video tag, I have already tried the Plugin https://github.com/macdonst/VideoPlayer but still doesn't work.
When I run my app all I see is a white square where I should be seeing the poster of the video with the controls and when I want to play it an error message ("Sorry, this video cannot be play") shows up.
I've read a lot about this but couldn't find any solution that works.
Any suggestion?
Your browser does not support the video tag.
I'm developing an app with html, css and javascript which i port trough Phonegap to play on an Android tablet. (android 2.3.1 Gingerbread)
Everything is working fine, except the Youtube embed.
If i place the iframe embed on my page there is no play-button above my youtubescreen, so the user does not know he has to press it. But if you press it, the movie loads into the external android video playing app.
But here's the second problem; when the movie ends, the external android player closes and returns to my app, but then my youtube video screen is black en has these ugly android videocontrols of the external player.
But i can't do anything with it... so the user can't press the movie to watch it again.
Does anybody know how to implement a youtube video correctly into an HTML based android application?
It's HTML, so webviews, videoview, intents and things won't work...
Things i tried:
iframe embed
object embed
html5 video embed
online embed on external page
but in every attempt, those ugly videocontrols keep popping up after the video ended.
I also tried another player, but with the same result... Anyone ideas? :-)
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
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