For MDN I have been updating the WebVTT docs. I can't get anything to work with captions at all. 1. As soon as I assign a VTTRegion to a cue, all cues stop displaying - you can test by uncommenting the line below. - There are no console errors. - Commenting the line does not restore the text track. To do that I have to reboot Firefox ```html <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style> video { width: 420px; height: 300px; } </style> </head> <body contenteditable="false"> <video id="video1" controls src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/friday.mp4" ></video> <script> let video = document.getElementById("video1"); let track = video.addTextTrack("captions", "Captions", "en"); track.mode = "showing"; const region = new VTTRegion(); //region.width = 50; // Use 50% of the video width //region.lines = 4; // Use 4 lines of height. //region.viewportAnchorX = 25; // Have the region start at 25% from the left. const cue1 = new VTTCue(0, 0.9, "HildyX!") //cue1.region=region; // UNCOMMENT THIS LINE track.addCue(cue1); const cue2 = new VTTCue(1, 1.4, "How are you?") track.addCue(cue2); track.addCue( new VTTCue(1.5, 2.9, "Tell me, is the lord of the universe in?") ); track.addCue(new VTTCue(3, 4.2, "Yes, he's in - in a bad humor")); track.addCue( new VTTCue(4.3, 6, "Somebody must've stolen the crown jewels") ); console.log(track.cues); </script> </body> </html> ``` 2. For the WebVTT file format, the spec indicates something like this will work, but these are not displayed. I think I'm being caught by the same bug as above. ```plain WEBVTT REGION id:fred width:20 lines:2 regionanchor:50,50 viewportanchor:50,50 scroll:up 00:00:00.000 --> 00:00:03.000 region:fred <v Fred>Hi, my name is Fred</v> 00:00:00.100 --> 00:00:03.000 region:fred <v Fred>Hi, my name is Fred2</v> ```
Bug 1906787 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
For MDN I have been updating the WebVTT docs. I can't get anything to work with captions at all. 1. As soon as I assign a VTTRegion to a cue, all cues stop displaying - you can test by uncommenting the line below. - There are no console errors. - Commenting the line does not restore the text track. To do that I have to reboot Firefox I have attached a test file 2. For the WebVTT file format, the spec indicates something like this will work, but these are not displayed. I think I'm being caught by the same bug as above. ```plain WEBVTT REGION id:fred width:20 lines:2 regionanchor:50,50 viewportanchor:50,50 scroll:up 00:00:00.000 --> 00:00:03.000 region:fred <v Fred>Hi, my name is Fred</v> 00:00:00.100 --> 00:00:03.000 region:fred <v Fred>Hi, my name is Fred2</v> ```
For MDN I have been updating the WebVTT docs. I can't get anything to work with captions at all. 1. As soon as I assign a VTTRegion to a cue, all cues stop displaying - you can test by uncommenting the line in attached file - There are no console errors. - Commenting the line back does not restore the text track. To do that I have to reboot Firefox 2. For the WebVTT file format, the spec indicates something like this will work, but these are not displayed. I think I'm being caught by the same bug as above. ```plain WEBVTT REGION id:fred width:20 lines:2 regionanchor:50,50 viewportanchor:50,50 scroll:up 00:00:00.000 --> 00:00:03.000 region:fred <v Fred>Hi, my name is Fred</v> 00:00:00.100 --> 00:00:03.000 region:fred <v Fred>Hi, my name is Fred2</v> ```