ExoPlayer - How to know if HLS video is Live or not? - android

I'm developing a video application when an HLS video starts as Live but after the .m3u8 playlist has completed loading we want to move back to seeing VOD HLS instead of Live.
How can I tell if HLS video is in Live mode and changed to VOD ?

You can try mExoPlayer.isCurrentWindowDynamic() link
so in the code you will use it like this:
if (mExoPlayer.isCurrentWindowDynamic()) {
// treat me as live stream
} else {
// treat me as VOD (Video On Demand)
}

I have tried for detecting the HLS video is Live or VOD. We can able to differentiate a live stream from a VOD by getting the player's duration after it is prepared. The live streams will return UNKNOWN_TIME, where as VOD streams will return the fixed known duration of the stream which is currently playing.

Related

Detect end of a live video on Android Exoplayer

How do I detect the end of a live video playing in Exoplayer on Android?
The Player.STATE_ENDED state gets called(logged) only for videos which are not live.

how to implement a custom video player with media controls in android?

it should just take video server url. should buffer and start playing video.
are there any libraries available for playing a video with buffering ?
How to implement custom video player with media controls similar to youtube?

Record and playback live stream video in android

How can I record and stream a live video from an rtsp link and playback it later?
I don't think the framework directly allows you to do that. Install ffmpeg to do this if you want to do it.

Problem playing media from RTSP URL in Android

I have made a Android streaming application that plays media from online URL's. For playing the media, I am using the
standard MediaPlayer class for playing media.
As per the Android documentation, it supports RTSP protocol for audio & video playback
http://developer.android.com/guide/appendix/media-formats.html
But when I am trying to play media from a RTSP URL, it gets connected but I am not able to hear any media
Following is one of those RTSP URL -
rtsp://sfera.live24.gr/sfera4132
Does anybody media have an idea of playing RTSP URL's through the Android MediaPlayer
Thanks
That link you provided has 3 audio tracks, with the first and last tracks appearing to be silent and don't contain any valid audio.
The middle track has audio (as per VLC). I don't know how Android deals with multiple audio tracks. I imagine you may get better results if you use links that only contain 1 audio and 1 video track at most.
I expect for an rtsp stream with multiple audio tracks, android is only going to play the first one as there is no user interface to select a specific audio stream, hence why you aren't hearing any audio.
If this is a stream from your own server, to hear the audio you should adjust the SDP file the valid audio track first. If this is not from your server, I don't know what you're options are.

Android Mediaplayer :: How to detect streaming content type (audio or video)

I am completely new to displaying streaming either audio or video content using media player.
Somehow using post available here, i am able to display RTSP content(.3gp video) in my MediaPlayer implementation.
How to identify streaming content is audio only stream or audio/video stream using MediaPlayer class or streaming link?
I could be wrong here, but I believe there is only a MediaPLayer.OnInfoListner API available in Java to get information about the content stream being played. Not sure of how helpful that API actually is though. You might also want to try stream scrapers(is what I believe they are called) to get stream data and see if there is both audio and video channel to make a determination.

Categories

Resources