I have a WebView in my application, this webview contain videos, but the problems is you can still hear the video's playing even you press the back menu.
The answer is Here.
Itseems the Webview thread continues to run even if you press back button.
You can read the answers in this SO question: How to stop youtube video playing in Android webview?
Related
I have an activity with a YouTubePlayerSupportFragment within it to play youtube videos.
The youtube player's style is set to CHROMELESS (only video, no controls), and playback is controlled by my own custom play/pause button outside of the player's view. Every thing works as expected until the moment I leave the video activity for whatever reason and then come back to it.
Upon leaving the activity the video is paused - as expected - but after returning to it, requesting the player to player.play() does nothing. No errors nor exceptions, it just does nothing. Play() will only work again after I load a new video..
I've trying using YouTubePlayerFragment instead, but the result is the same. However, when using the DEFAULT style pressing the default play button will apparently reload the video (I see the buffer being flushed) from the previous position and work as expected. This leads me to believe that they're handling it somehow directly on their UI control code instead of on the player API..
I can reproduce this issue on the SDK's custom controls sample just by starting a video, pressing the recents key and returning to it so I think it's safe to assume that this is a bug..
Has anyone been able to work around this issue? is there any way to detect that the video needs to be reloaded while this isn't fixed?
Info: I'm using youtube's android player API v1.2.2 and the latest youtube app v10.49.59
After hours, the only solution I found was to save video position on Pause event and reload video (player.loadVideo) on PostResume event (when YouTubeFragment is resumed). But I don't known if this is the only/best solution.
I am showing a web page in webview which includes a video. What I need is a way to know when the video streaming starts in the webview? I need to do something when this happens. Is there some kind of event or notification etc. available for this? Any help is appreciated. Thanks.
I am playing youtube videos in webview .In my app i have overridden the ontouch of webview. SO when user clicks on webview playing video, it opens another webview which is full screen . Now here the video is starting from the beginning. Instead of that is there a way to get the current postion of the video and to start playing from that point in the new webview.
ie i am looking for something equivalent to getCurrentposition and seekto in a videoview.
Please let me know if this is possible or is there any work around.
Thank you
I have done this before and I warn you that things might get messy in future!
Anyways, take a look at "JavaScriptInterface" for webview in android. here is a link
Also take a look at google's youtube player
There is Android youtube player as well as players using javascript/iframe etc.
I am connecting to a website which hosts youtube videos via webview. When I click on the youtube video it works fine - the player plays within the webvideo window. But when I make the video full screen it plays. But when I press the back button - it goes back to the webview and I can navigate to the rest of my app - but I can still hear the video play in the background. Whats happening here?
I had a similar problem and found a solution here on StackOverflow. I don't have link to that question though.
Here it is:
webview.loadData("", "text/html", "utf-8");
I would like to know if theres any way to open a webview with a stream flash video on fullscreen.
Right now ive the link of the page. This page has some stuff and a flash video. So i wonder if it would be posible to open the webview only with the stream video. In fullscreen or focused on it, without seing anything else. I mean, only the webview with the video, or the whole page, but with the view focused and zoomed so that i could just see the video.
Also, since there could get different kind of web pages, the video could come on different ways. But for now, would be enough to know if it would be posible to open it on fullscreen.
Thanks.
This may apply to the Android platform, but I think that for web-browser Flash Player - in order to go to full-screen, it requires a user action (like a button click) to initiate the transition. This means that the SWF cannot by itself initiate the transition.
I suspect that it applies to Android too. Are you writing and AIR app or a browser-based webpage.