Commit 9a02920
Self styled subtitles (#14790)
* Use subtitles file and use in looping video
* WIP - Trying to change the line cues are rendered on
* Update hardcoded assets for testing m3u8, mp4 and vtt. This needs to be removed before merge
* Remove background colour as this does not affect the existing cue box drawn by the browser. It instead draws another box around the cue box which is not desired.
* Require CORS without credentials using "anonymous". This ensure the subtitles are available to JS on all browsers.
* Measure the height of the video and set the absolute positioning of the cues by % off of that.
* Remove background colour palette for subtitles as the background colour cannot currently be modified whilst we only support the browser subtitle implementation.
* Remove hardcoded testing properties
* Add a useSubtitles hook to allow players to customise subtitles
* Add a useeffect to extra the track from the video element.
* Store active track so we can extract cues
* Add a listener for cue changes and update an activeCue state to keep track of the current cue. This is exposed by the hook for rendering in an overlay
* Use subtitles file and use in looping video
* WIP - Trying to change the line cues are rendered on
* Update hardcoded assets for testing m3u8, mp4 and vtt. This needs to be removed before merge
* Remove background colour as this does not affect the existing cue box drawn by the browser. It instead draws another box around the cue box which is not desired.
* Require CORS without credentials using "anonymous". This ensure the subtitles are available to JS on all browsers.
* Measure the height of the video and set the absolute positioning of the cues by % off of that.
* Remove background colour palette for subtitles as the background colour cannot currently be modified whilst we only support the browser subtitle implementation.
* Remove hardcoded testing properties
* Reduce space from bottom to 12px on browser cues
* Alias vidRef.current to video for easier parsing
* Draw on subtitles
* Move subtitles into its own component
* If track is not available or we the video has not been started, reset active cues to null
* Tidy up comments
* Adjust overlay styling
* Prefer keeping trackmode as showing so that ios is more reliable
* Remove height protection as we should always be able to retrieve getBoundingClientRect
* Add comment to support future development of the loop video player
* Test hls fix with polling
* skip failing test for testing
* Hide cues by default
* Remove need for polling by running onCueChange ahead of listener to kickstart iOS.
* Rename subtitles -> activeCue so its clearer that this is seperate from the subtitleSource
* Tidy up comment
* Use source where possible
* revert skipped test
* Tidy up comments
* Temporarily remove looping video stories to unblock PR.
* fix linting
* Remove unnecessary english=label
---------
Co-authored-by: Dominik Lander <[email protected]>1 parent ed3c08c commit 9a02920
File tree
5 files changed
+206
-4
lines changed- dotcom-rendering/src
- components
- lib
5 files changed
+206
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
180 | 187 | | |
181 | 188 | | |
182 | 189 | | |
| |||
669 | 676 | | |
670 | 677 | | |
671 | 678 | | |
| 679 | + | |
672 | 680 | | |
673 | 681 | | |
674 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| 126 | + | |
| 127 | + | |
122 | 128 | | |
123 | 129 | | |
124 | 130 | | |
| |||
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
| 169 | + | |
163 | 170 | | |
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
167 | 174 | | |
168 | | - | |
169 | 175 | | |
170 | 176 | | |
171 | 177 | | |
| |||
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
179 | | - | |
180 | 185 | | |
181 | 186 | | |
182 | 187 | | |
| |||
222 | 227 | | |
223 | 228 | | |
224 | 229 | | |
225 | | - | |
| 230 | + | |
| 231 | + | |
226 | 232 | | |
227 | 233 | | |
| 234 | + | |
228 | 235 | | |
229 | 236 | | |
230 | 237 | | |
231 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
232 | 245 | | |
233 | 246 | | |
234 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7335 | 7335 | | |
7336 | 7336 | | |
7337 | 7337 | | |
| 7338 | + | |
| 7339 | + | |
| 7340 | + | |
| 7341 | + | |
7338 | 7342 | | |
7339 | 7343 | | |
7340 | 7344 | | |
| |||
0 commit comments