What I need to do is the following, I am using the youtube API to play video, what I want is that when the video finishes playing, I need to hide the youtubeplayerview, it is possible? I have tried it from youtubeplayerview.setvisibility(View.GONE) code, but it does not work. Can anybody help me?
Related
I know that when using a YouTubePlayerFragment or YoutubePlayerView, I can use YouTubePlayer.PlayerStateChangeListener to receive onVideoEnded(). Is it possible to be notified similarly when the official android youtube app finishes playing a video?
Yes, this YouTubePlayer.PlayerStateChangeListener that you mention is the one that will tell you if the Youtube video is already finished.
Another way to achieve this problem is explained in these SO questions:
Detecting when a YouTube video has finished playing
Detecting when a youtube video finishes in Android
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 using android-youtube api in my android project. I am using youtube fragment to play a youtube video.
Along with that video, I am playing other media (eg imageview) side-by-side. (I am aware that the youtube fragment should be always on top, so the problem is not related to this constraint).
I am able to play the video successfully, but the problem is, after video starts playing, the pause button does not fade out. It keeps showing that button. It seems like it fades out, but immediately after it disappears, it reappears.
I am not getting any logs related to this (not even in system log). However, when I play video fragment in full layout, there is no such problem.
In short, the problem occurs only when I play video along with some other media side-by-side. I didn't find any work around for this particular problem, so I don't have any code related to this problem.
How do I get rid of this issue?
Thanks in advance for help.
I'm using the youtube API for android, i'm trying to place a button over the player, the problem is every time I try to play a video on the youtube player it stops after one second, i've removed the button and everything works like a charm.
is there a way to solve this? to be able to have any widget over the youtube player?
Thanks
Adi
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.