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.
Related
I need to develop an Android Service (API level > 21), which should be able to detect video playback on a third party Video player, so that it can further disable the Notification pop-ups during a video playback.
On searching, I found several posts talking about detecting the play-states of videos in a VideoView, such as the following:
How to detect when VideoView starts playing (Android)?
But, I couldn't find anything that can help detecting video playback on a video player, wherein, the video player is installed as a third party app and is not a part of the Android application/ service.
So, the challenges are:
1) The android service needs to detect a video playback
2) Registering package names for video player apps with the Service is out of question, since the Service should be able to detect the playback even when a new video player is installed from the Playstore.
3) Need to extend this idea for online video streaming as well.
Any help in this regard would be really appreciated.
Thanks in advance.
There is no way to implement 100% reliable video playback detection :(
Just and idea: try listening to the audio focus changes... this might help with detection of video playback, assuming the target player respects the audio output stream usage policy, recommended by Google. You might also want to get notified about system UI visibility changes (to detect fullscreen playback).
Audio focus:
https://developer.android.com/guide/topics/media-apps/volume-and-earphones.html
System UI visibility changes:
https://developer.android.com/reference/android/view/View.OnSystemUiVisibilityChangeListener.html
Also, you are correct saying that package name based detector is not an option since detecting active/running package is no longer possible on android 7.
i am making a phonegap app which shows videos via an html5 video player. The video play fast and fine on ios, but it takes time to start playing on android. it loads some part of the video or maybe the whle video and then plays it. i have given the preload="none" attribute. how do i make the video play instantly?
Android will not preload the video on mobile web implementations. Also, even after the video has been preloaded (the first few bytes), the decoding takes some time on weak devices.
For this reason, your best bet IMHO would be:
Enable the autoplay without user gesture on the web view that contains your phonegap app
WebView.getSettings().setMediaPlaybackRequiresUserGesture(false);
Then:
In JS, mute and hide the video, and star to play it
When the user performs the action that triggers the play, set the video's location to 0, reveal and umute it:
document.getElementById('myVideo').currentTime = 0;
document.getElementById('myVideo').muted = false;
My question is about media player live streaming from the url in my application?
I'm trying to play live stream mp3 audio by media player.
The problem is that when i am using default URL as given in this link , then it works fine. But i changed the following mp3 link ,
then after playing 1 seconds it taking buffering and after completion its play the song, but i need that it plays the song with the buffering as well.
please help.
Thanks in advance.
It is not easy task to accomplish.
You can use this link https://code.google.com/p/mp3tunes/source/browse/
as reference app to develop your own progressive mediaplayer app.
From the above link you will get the whole architecture for your app.Song downloading and playing is happens at the same time.The architecture developed in the reference app is more robust and reusable.
Specially look at following classes
NanoHTTD.java
HttpServer.java
PlaybackService.java
PlaybackQueue.java
TrackDownloader.java
Thank You.
First of all, sorry for my poor English.
I am developing an application to monitor and get statistics on youtube videos played. I have developed an application on Android withit an embedded Youtube video player and I want to get all events that happen during the video is playing. I know how to get some events such as when it has been stopped, when it is buffering or when it stops buffering.
The problem is that it would be very interesting for me to get some statistics about the bytes that are loaded in the buffer everytime I check it but I don't know how to do that. I have checked the youtube player API and I know that it is possible when you use Javascript but the API that they offer for Android doesn´t have this option.
Please do you have any idea about how I can monitorize the buffer during a video is playing?
Thank you!
Hey I have a few questions about HTML5 VIDEO for Android 4.0 default browser.
I want to play the video always on fullscreen, i was successful on doing that by the following code
onClick = playVideo();
function playVideo() {
player.load();
player.webkitEnterFullScreen();
player.play();
}
So I need to know a couple of things though that would help me so much...,
is there a way to tell if the video is playing fullscreen. I was able to get that for iphone by checking webkitDisplayingFullScreen, so this is fired off on done button by iphone.
Android has only back button, is there a response button for that as well?
pause does not fire an event when playing in default videoplayer, is there a way to implement an event that the default player is paused?
the play() function does not work on Android 4.0 default player, any reason why this is or am i not calling it right? It works on Chrome Browser
Thanx, any help would be great.