You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Co-authored-by: Tom Coward <34864926+tom-coward@users.noreply.github.com>
Co-authored-by: Peter Clay Holden Morris-Hind <peter.morris-hind@bbc.co.uk>
Co-authored-by: Eirik Jo Björnerstedt <eirik.bjornerstedt@bbc.co.uk>
// 2️⃣ Pass playback data that contains captions to the player.
16
-
player.init(document.querySelector("video"), playbackData,/* other opts */);
18
+
player.init(document.querySelector("video"), playbackData /* other opts */)
17
19
```
18
20
19
21
1.`media.captions` MUST be an array containing at least one object.
@@ -34,7 +36,7 @@ const captions = [
34
36
{ url:"https://some.cdn/subtitles.xml" },
35
37
{ url:"https://other.cdn/subtitles.xml" },
36
38
/* ... */
37
-
];
39
+
]
38
40
```
39
41
40
42
Subtitles delivered as a whole do not require any additional metadata in the manifest to work.
@@ -49,13 +51,15 @@ const captions = [
49
51
{
50
52
url:"https://some.cdn/subtitles/$segment$.m4s",
51
53
segmentLength:3.84,
54
+
cdn:"default",
52
55
},
53
56
{
54
57
url:"https://other.cdn/subtitles/$segment$.m4s",
55
58
segmentLength:3.84,
59
+
cdn:"default",
56
60
},
57
61
/* ... */
58
-
];
62
+
]
59
63
```
60
64
61
65
The segment number is calculated from the presentation timeline. You MUST ensure your subtitle segments are enumerated to match your media segments and you account for offsets such as:
@@ -73,12 +77,24 @@ You can style the subtitles by setting `media.subtitleCustomisation` in the `.in
73
77
74
78
```js
75
79
// 1️⃣ Create an object mapping out styles for your subtitles.
// 2️⃣ Pass playback data that contains subtitle customisation (and captions) to the player.
79
-
player.init(document.querySelector("video"), playbackData,/* other opts */);
83
+
player.init(document.querySelector("video"), playbackData /* other opts */)
80
84
```
81
85
86
+
### Low Latency Streams
87
+
88
+
When using Dash.js with a low-latency MPD segments are delivered using Chunked Transfer Encoding (CTE) - the default side chain doesn't allow for delivery in this case.
89
+
90
+
Whilst it is possible to collect chunks as they are delivered, wait until a full segment worth of subtitles have been delivered and pass these to the render function this breaks the low-latency workflow.
91
+
92
+
An override has been added to allow subtitles to be rendered directly by Dash.js instead of the current side-chain.
93
+
94
+
Subtitles can be enabled and disabled in the usual way using the `setSubtitlesEnabled()` function. However, they are signalled and delivered by the chosen MPD.
95
+
96
+
Using Dash.js subtitles can be enabled using `window.bigscreenPlayer.overrides.embeddedSubtitles = true`.
0 commit comments