-1

Please Who knows how to implement subtitles in an already made video player? I have created a video player but I just don't know the code for subtitle implementation in a Video player.I am working with java.

1 Answers1

1

Ignore this answer if you expect specific code, I am just telling how I would approach it. I'd create a srt. file for easement, where the text and time to display the text is defined. srt file

For the GUI I would want to stack a video layer on top of the existing video player, where the Text will be displayed.

Then I would make and event listener on the time slider on the video, when ever it changes read the exact time, find the next text to display in the .srt file and calculate the time difference. With the difference a ScheduledExecutorService will be used to display the next text after a given time and that periodically.

david-1160
  • 62
  • 1
  • 5