Exoplayer: Add subtitle files during playing

Created on 2 Jul 2016  路  6Comments  路  Source: google/ExoPlayer

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.

enhancement

Most helpful comment

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

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings