ExoPlayer
ExoPlayer copied to clipboard
Add subtitle files during playing
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.
this is my question too !!!
Me too.
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.
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?
Adding subtitles after player being prepared is really a common need, hope you will enhance this in the near future.
it's been 4 years now. Kindly add this feature to exoplayer.
Now 5 years. Any progress ?
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.