3

I'm trying to make a video player with VideoView that supports subtitles using a TextView on top of it.

I've already parsed the subtitles but now i need an event that runs every time a frame changes or so to update the subtitles with the current playing position.

I tried making a thread but I am not able to change my TextView in that separate thread. Is there an event on VideoView/MediaPlayer that runs every frame change that I can override to call my updateSubtitle method?

Oak Bytes
  • 4,649
  • 4
  • 36
  • 53
xlar8or
  • 601
  • 9
  • 18
  • Android 4.1 supports TimedText 'out of the box': http://stackoverflow.com/questions/13422673/looking-for-a-working-example-of-addtimedtextsource-for-adding-subtitle-to-a-vid – robd Jul 26 '13 at 22:19

2 Answers2

3

Starting with Android 4.4 , you can put subtitles from within the VideoView itself: https://www.youtube.com/watch?v=hCRGc2PcmB8#t=130

android developer
  • 114,585
  • 152
  • 739
  • 1,270
0

Coming to your first question, there is no event that happens each video frame. Having said that there are ways of getting current time and synchronize subtitles to the current time. Below links might be of help

Oak Bytes
  • 4,649
  • 4
  • 36
  • 53