HTML5 <audio> textTrack.kind=subtitles cueChange event not working in FireFox

后端 未结 4 2519
北荒
北荒 2021-02-20 01:56

UPDATE:

This issue no longer existing FireFox, cuechange now works. Embedded base64 images also render.

The original code is a simple implementation of am

4条回答
  •  太阳男子
    2021-02-20 02:12

    Firefox still (!) doesn't support oncuechange (as of v38.0, May 2015). However, you can usually use video.ontimeupdate to achieve almost exactly the same thing, e.g.:

    var videoElement = $("video")[0];
    var textTrack = videoElement.textTracks[0];
    if (textTrack.oncuechange !== undefined) {
      $(textTrack).on("cuechange", function() { ... });
    } else {
      // some browsers don't support track.oncuechange, so...
      $(videoElement).on("timeupdate", function() { ... });
    }
    

提交回复
热议问题