Exoplayer: Allow transition to ended if all tracks except subtitle track have ended

Created on 16 May 2019  路  10Comments  路  Source: google/ExoPlayer

EXOPLAYER_VERSION=2.10.0

I'm testing with a video and 2 subtitles, and 1 subtitle's timeline is 3seconds longer than a video.

What happens now is, video is finished, but I don't get COMPLETED event until subtitle finish playing... and also "current time" keep updates and "video play time" didn't updated.

What I want to do is, I want to focus on Video play time and get the COMPLETED event when video is finished.... what should I do?

Thank you !!!

enhancement low priority

All 10 comments

Confirmed that durationUs in createMediaSource doesn't affect the run time of any medias..

ExoPlayer considers the end of the media to be the point at which all media has been played, including subtitles. _Why_ is the subtitle longer than the video? It sounds like the media is kind of broken to me.

I don't think we have any plans to provide an easy mechanism for working around this.

You can also try to use a ClippingMediaSource to clip the subtitle source to the length of the video. This requires to know that in advance though.

@ojw28 @tonihei
First, I appreciate your reply and time.
It is human error for subtitle makers, but it would have be awesome if media finish playing when video is done playing no matter what, since human error can happen anytime.

Now I'll try to work on ClippingMediaSource and see if the subtitle actually clipped as the duration I manually set...

@tonihei
ClippingMediaSource doesn't work as expected in my use case...

I approached like this >> I got a DASH media source with DashMediaSource.Factory and 3 different subtitles by ClippingMediaSource(Factory.createTextSampleFormat(source), durationUs) and made them to a single media source via MergingMediaSource. And the user can change the subtitle manually with custom subtitle choice view.

Media plays well so as subtitle, all I need now is just clipping subtitle length.. (since MergedMedia doesn't focus on Video timeline but on longest MediaSource...)

And I've set durationUs as 3000L or 3000000L for testing, and it didn't work as I expected...

Any idea why...?

I just confirmed that ClippingMediaSource works on Videos, but not on Subtitles...
Follow up >> issue#5317

@ojw28 I guess it's still a bug..
btw, player in iOS seems focusing on video timeline than other media sources. My college has no problem without any changes...

Feel free to close this issue if there's no updates !

Sorry, I forgot about #5317. Clipping text and metadata is not supported yet and implementation is tracked by the linked issue.

Looks like you just found that out yourself :)

Nah, I should have searched more- before I raise this issue, but hopped that this would be solved by now- hahah

But...now my issue is that I cannot get event when the video is finished playing........until subtitle makers don't make mistake...

Changed this to a feature request. I think it should probably be an option, possibly passed via the track Format.

Was this page helpful?
0 / 5 - 0 ratings