ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Add subtitle files during playing

Open Bidp opened this issue 8 years ago • 8 comments

Hi, I was wondering if it's possible in ExoPlayer to add a subtitle file during playing without interfering the play. For what I know is we have to inject the corresponding SampleSource to TextTrackRender's constructor, but sometimes users just store their subtitle files anywhere, and they'd like to add the file after the media starts to play.

Bidp avatar Jul 02 '16 14:07 Bidp

this is my question too !!!

Hitexroid avatar Aug 19 '16 08:08 Hitexroid

Me too.

sonvp avatar Sep 08 '16 13:09 sonvp

This is not currently supported (you'd have to prepare the player again, which would cause re-buffering before the playback resumed). Marking as an enhancement for the future.

ojw28 avatar Sep 09 '16 21:09 ojw28

Hi @ojw28 , I'm also facing same issue while adding the subtitle on the fly. I'm using ConcatenatingMediaSource with custom MediaDrmCallback. Now I want to add subtitles to the MediaSource on track change before making Widevine request. But my ConcatenatingMediaSource playlist contains MediaSource and not MergingMediaSource as I do not have .srt files at the time of ConcatenatingMediaSource creation. So Is there any way to add subtitles before drm executeKeyRequest() method call?

kunal-altbalaji avatar Nov 28 '18 09:11 kunal-altbalaji

Adding subtitles after player being prepared is really a common need, hope you will enhance this in the near future.

xiaoxixi615 avatar Feb 22 '19 02:02 xiaoxixi615

it's been 4 years now. Kindly add this feature to exoplayer.

vikasacharya16 avatar Jul 26 '20 08:07 vikasacharya16

Now 5 years. Any progress ?

akshansh01 avatar May 27 '21 02:05 akshansh01

Preparing the player again, has also a side effect when using PlaybackStatsListener. This causes the onSessionFinished callback to be called twice even though the playback has not finished, leading to erroneous analytics data.

MBakhshi96 avatar Dec 07 '21 16:12 MBakhshi96