mozilla / vtt.js

A JavaScript implementation of the WebVTT specification
http://dev.w3.org/html5/webvtt/
Apache License 2.0
479 stars 94 forks source link

[Firefox 50] Setting cue.position with an object throws an exception #354

Closed johnBartos closed 7 years ago

johnBartos commented 7 years ago

Firefox 50 has introduced a change which breaks VTT rendering: https://bugzilla.mozilla.org/show_bug.cgi?id=1276831

Tl;dr: cue.position now only accepts two values: a double, or the keyword 'auto'. Here's the offending line in your codebase: https://github.com/mozilla/vtt.js/blob/master/dist/vtt.js#L723

I'm not sure what the default should be but that object causes an exception to be thrown: Member of DoubleOrAutoKeyword 'undefined' is not a valid value for enumeration AutoKeyword

bzbarsky commented 7 years ago

Looks like the changes made to the in-tree vtt.jsm in https://bugzilla.mozilla.org/show_bug.cgi?id=1276831 need to be applied here too. Specifically https://reviewboard.mozilla.org/r/58410/diff/4#index_header

benjaoming commented 7 years ago

Thanks for working on this @johnBartos !

Sorry to be adding something to a closed issue. I'm using vtt.js with the video.js player, and it's currently broken in Firefox 50 but works in Firefox 49. The above only partly fixed the issue. Before I was experiencing the same exception, now it has changed to the below.

Could you advice if the below traceback looks like something that I should be asking the video-js people about? Shouldn't changes in vtt.js be 100% backwards compatible?

TypeError: Argument 1 of TextDecoder.decode could not be converted to any of: ArrayBufferView, ArrayBuffer.[Learn More]  bundle_video.js:1961:24
    require<[608]</</WebVTT.Parser.prototype.parse http://127.0.0.1:8008/static/js/my_custom_webpack.js:1961:24
    parseCues http://127.0.0.1:8008/static/js/my_custom_webpack.js:19732:3
    loadTrack/< http://127.0.0.1:8008/static/js/my_custom_webpack.js:19759:7
    ret http://127.0.0.1:8008/static/js/my_custom_webpack.js:21181:12
    once/< http://127.0.0.1:8008/static/js/my_custom_webpack.js:4712:12
    loadFunc http://127.0.0.1:8008/static/js/my_custom_webpack.js:4590:9
    readystatechange http://127.0.0.1:8008/static/js/my_custom_webpack.js:4520:13