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.
Related
is my first question on the website, so i hope to post it in the right way.
Context
I'm developing an application that plays two web videos at the same time.
To do so I have two web views in my activity, each showing a different website (each website contains a video).
If one of the video is muted i can play both of the video without problems, but if they are both unmuted, resuming a video, pauses the other.
Behaviour explanation (guess)
I'm guessing that this is due to audio focus: when a web view video starts playing it requests and obtain audio focus, if another is played it does the same, so the first looses the audio focus and the web view pauses it.
Question
There is a way to prevent this behavior? Preventing the web view to ask audio focus or not pausing the videos when it is lost.
I checked, and while chrome and web views have this behavior, other media apps don't, so maybe is not impossible to fix it.
I was trying to understand if an override was possible, but the audio focus behavior seems quite deep in the source code.
Any suggestion or workaround my be useful!
Thanks everyone!
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?
I need a web based video player that provides "time duration for which a user played a video" and "instance at which the video stopped playing".
It would be great if it can provide details like the time at which the video was started (if he has skipped to a certain location when the video has started) and the stop time of the video.
Could anyone please suggest a ready made player available in market which provides all these information OR some alternate approach to achieve the same.
I want to achieve the same for iOS and Android devices. Is this something possible? And if yes please help me on its feasibility with Phonegap?
Thanks in advance
You won't need a speical player for this. The mediaelements audio and video already have a property called played.
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 playing a live tv channel in android browser using flash player.
Video takes some time to load in browser so i want to play some animation until video buffering ends.
The weird thing for me is how to know when will video buffering be complete in browser flash player?
I am not an expert in this subject - but i got this reference from another SO question itself:
How to detect when video is buffering?
This refers to the event called NetStream.Buffer.Full event that could be your help.