Is there any way to get current caption's text from video tag using Video.js?

前端 未结 5 759
日久生厌
日久生厌 2021-01-06 18:30

I want to get current subtitles\' text during playing a video (and than implement own subtitles block (i.e. to hide original) and also use the information in a few different

5条回答
  •  感情败类
    2021-01-06 19:07

    var videoElement = document.querySelector("video");
    var textTracks = videoElement.textTracks; 
    var textTrack = textTracks[0]; 
    var kind = textTrack.kind // e.g. "subtitles"
    var mode = textTrack.mode
    

    Try this one

提交回复
热议问题