Open ChristiaanScheermeijer opened 7 years ago
Here's what we do in jwplayer:
var line = settings.get('line', 'auto');
if (line === 'auto' && defaults.line === -1) {
// set numeric line number for Safari
line = -1;
}
cue.line = line;
Here's how we worked around it:
const oldVTTCue = global.VTTCue;
try {
global.VTTCue = VTTCue;
parser.parse(vtt);
parser.flush();
} finally {
global.VTTCue = oldVTTCue;
}
The VTTCue in scope is the one from vtt.js
The spec clearly allows for 'auto'
:|
https://w3c.github.io/webvtt/#webvtt-cue-line
Apple's native VTTCue is not spec compliant.
Agreed, but why not solving it in the polyfill?
Thanks, cue.position
also throws this error.
I added position to my PR
Apparently the travis build failed with that change... :/ position wasn't 'auto'?
Ugh... apparently that breaks the tests. cue.position is auto by default (in chrome & ff...in safari its 50) and I'm just using the default if set... and falling back to what was there... :/
Im using cue.line !== "auto" ? cue.line : "auto"
for line and position which seem to work. Not sure if they pass the test though.
This is not really resolved yet...
my PR should fix it
Oops wrong button!
Hi, is there any progress on this? Or maybe a workaround?
Just waiting for the pr to be merged.
We are still getting this issue in Safari 13.0.3 (15608.3.10.1.4). Any news on the PR being merged?
I believe this is fixed or will soon (in the next release) be fixed in the videojs fork of vtt.js. It's probably the only currently maintained version of vtt.js: https://github.com/videojs/vtt.js (videojs-vtt.js on npm)
When using vtt.js in Safari it throws
Error: The provided value is non-finite
on this partcue.line = settings.get("line", "auto");
.I think this is an issue in the Safari VTTCue implementation, but I hope to find a workaround in this polyfill.
Below the stacktrace: