@brightspace-ui/labs 2.63.0 → 2.63.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/demo/components/media-player/static/sample-vtt-en-descriptions.vtt +7 -0
- package/demo/components/media-player/static/sample-vtt-fr-descriptions.vtt +7 -0
- package/package.json +1 -1
- package/src/components/media-player/README.md +29 -1
- package/src/components/media-player/media-player-audio-bars.js +8 -8
- package/src/components/media-player/media-player-audio-descriptions.js +415 -0
- package/src/components/media-player/media-player.js +170 -145
- package/src/lang/ar.js +6 -0
- package/src/lang/ca.js +6 -0
- package/src/lang/cy.js +6 -0
- package/src/lang/da.js +6 -0
- package/src/lang/de.js +6 -0
- package/src/lang/en-gb.js +6 -0
- package/src/lang/en.js +6 -0
- package/src/lang/es-es.js +6 -0
- package/src/lang/es.js +6 -0
- package/src/lang/fr-fr.js +6 -0
- package/src/lang/fr-on.js +6 -0
- package/src/lang/fr.js +6 -0
- package/src/lang/haw.js +6 -0
- package/src/lang/hi.js +6 -0
- package/src/lang/ja.js +6 -0
- package/src/lang/ko.js +6 -0
- package/src/lang/mi.js +6 -0
- package/src/lang/nl.js +6 -0
- package/src/lang/pl.js +6 -0
- package/src/lang/pt.js +6 -0
- package/src/lang/ru.js +6 -0
- package/src/lang/sv.js +6 -0
- package/src/lang/th.js +6 -0
- package/src/lang/tr.js +6 -0
- package/src/lang/ur.js +6 -0
- package/src/lang/vi.js +6 -0
- package/src/lang/zh-cn.js +6 -0
- package/src/lang/zh-tw.js +6 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import '@brightspace-ui/core/components/alert/alert.js';
|
|
2
1
|
import '@brightspace-ui/core/components/button/button-icon.js';
|
|
3
2
|
import '@brightspace-ui/core/components/colors/colors.js';
|
|
4
3
|
import '@brightspace-ui/core/components/dropdown/dropdown.js';
|
|
@@ -10,10 +9,10 @@ import '@brightspace-ui/core/components/menu/menu.js';
|
|
|
10
9
|
import '@brightspace-ui/core/components/menu/menu-item.js';
|
|
11
10
|
import '@brightspace-ui/core/components/menu/menu-item-link.js';
|
|
12
11
|
import '@brightspace-ui/core/components/menu/menu-item-radio.js';
|
|
13
|
-
import '@brightspace-ui/core/components/offscreen/offscreen.js';
|
|
14
12
|
import './slider-bar.js';
|
|
15
13
|
import 'webvtt-parser';
|
|
16
14
|
import './media-player-audio-bars.js';
|
|
15
|
+
import { AUDIO_DESCRIPTION_REPLAY_KEY, AUDIO_DESCRIPTION_SKIP_KEY, AUDIO_DESCRIPTION_TRACK_KIND, MediaPlayerAudioDescriptionsMixin } from './media-player-audio-descriptions.js';
|
|
17
16
|
import { css, html, LitElement, unsafeCSS } from 'lit';
|
|
18
17
|
import { classMap } from 'lit/directives/class-map.js';
|
|
19
18
|
import fullscreenApi from './fullscreen-api.js';
|
|
@@ -33,7 +32,9 @@ const HIDE_DELAY_MS = 3000;
|
|
|
33
32
|
const KEY_BINDINGS = {
|
|
34
33
|
play: 'k',
|
|
35
34
|
mute: 'm',
|
|
36
|
-
fullscreen: 'f'
|
|
35
|
+
fullscreen: 'f',
|
|
36
|
+
replayAudioDescription: AUDIO_DESCRIPTION_REPLAY_KEY,
|
|
37
|
+
skipAudioDescription: AUDIO_DESCRIPTION_SKIP_KEY
|
|
37
38
|
};
|
|
38
39
|
const MIN_TRACK_WIDTH_PX = 250;
|
|
39
40
|
const IS_IOS = /iPad|iPhone|iPod/.test(navigator.platform);
|
|
@@ -59,7 +60,7 @@ const FUSE_OPTIONS = options => ({
|
|
|
59
60
|
threshold: 0.1,
|
|
60
61
|
...options
|
|
61
62
|
});
|
|
62
|
-
const SEARCH_CONTAINER_HOVER_CLASS = '
|
|
63
|
+
const SEARCH_CONTAINER_HOVER_CLASS = 'search-container-hover';
|
|
63
64
|
const DEFAULT_PREVIEW_WIDTH = 160;
|
|
64
65
|
const DEFAULT_PREVIEW_HEIGHT = 90;
|
|
65
66
|
|
|
@@ -75,7 +76,7 @@ const tryParseUrlExpiry = url => {
|
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
78
|
|
|
78
|
-
class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
79
|
+
class MediaPlayer extends LocalizeLabsElement(MediaPlayerAudioDescriptionsMixin(RtlMixin(LitElement))) {
|
|
79
80
|
|
|
80
81
|
static properties = {
|
|
81
82
|
allowDownload: { type: Boolean, attribute: 'allow-download', reflect: true },
|
|
@@ -83,6 +84,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
83
84
|
crossorigin: { type: String },
|
|
84
85
|
downloadFilename: { type: String, attribute: 'download-filename' },
|
|
85
86
|
durationHint: { type: Number, attribute: 'duration-hint' },
|
|
87
|
+
hideAudioDescriptionSelection: { type: Boolean, attribute: 'hide-audio-description-selection' },
|
|
86
88
|
hideCaptionsSelection: { type: Boolean, attribute: 'hide-captions-selection' },
|
|
87
89
|
hideSeekBar: { type: Boolean, attribute: 'hide-seek-bar' },
|
|
88
90
|
loop: { type: Boolean },
|
|
@@ -94,36 +96,36 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
94
96
|
disableSetPreferences: { type: Boolean, attribute: 'disable-set-preferences' },
|
|
95
97
|
transcriptViewerOn: { type: Boolean, attribute: 'transcript-viewer-on' },
|
|
96
98
|
playInView: { type: Boolean, attribute: 'play-in-view' },
|
|
97
|
-
_chapters: {
|
|
98
|
-
_currentTime: {
|
|
99
|
-
_duration: {
|
|
100
|
-
_heightPixels: {
|
|
101
|
-
_hoverTime: {
|
|
102
|
-
_hovering: {
|
|
103
|
-
_loading: {
|
|
104
|
-
_maintainHeight: {
|
|
105
|
-
_mediaContainerAspectRatio: {
|
|
106
|
-
_message: {
|
|
107
|
-
_muted: {
|
|
108
|
-
_playing: {
|
|
109
|
-
_posterVisible: {
|
|
110
|
-
_recentlyShowedCustomControls: {
|
|
111
|
-
_searchResults: {
|
|
112
|
-
_selectedQuality: {
|
|
113
|
-
_selectedSpeed: {
|
|
114
|
-
_selectedTrackIdentifier: {
|
|
115
|
-
_sources: {
|
|
116
|
-
_thumbnailsImage: {
|
|
117
|
-
_timelinePreviewOffset: {
|
|
118
|
-
_trackFontSizeRem: {
|
|
119
|
-
_timeFontSizeRem: {
|
|
120
|
-
_trackText: {
|
|
121
|
-
_tracks: {
|
|
122
|
-
_usingVolumeContainer: {
|
|
123
|
-
_volume: {
|
|
99
|
+
_chapters: { state: true },
|
|
100
|
+
_currentTime: { state: true },
|
|
101
|
+
_duration: { state: true },
|
|
102
|
+
_heightPixels: { state: true },
|
|
103
|
+
_hoverTime: { state: true },
|
|
104
|
+
_hovering: { state: true },
|
|
105
|
+
_loading: { state: true },
|
|
106
|
+
_maintainHeight: { state: true },
|
|
107
|
+
_mediaContainerAspectRatio: { state: true },
|
|
108
|
+
_message: { state: true },
|
|
109
|
+
_muted: { state: true },
|
|
110
|
+
_playing: { state: true },
|
|
111
|
+
_posterVisible: { state: true },
|
|
112
|
+
_recentlyShowedCustomControls: { state: true },
|
|
113
|
+
_searchResults: { state: true },
|
|
114
|
+
_selectedQuality: { state: true },
|
|
115
|
+
_selectedSpeed: { state: true },
|
|
116
|
+
_selectedTrackIdentifier: { state: true },
|
|
117
|
+
_sources: { state: true },
|
|
118
|
+
_thumbnailsImage: { state: true },
|
|
119
|
+
_timelinePreviewOffset: { state: true },
|
|
120
|
+
_trackFontSizeRem: { state: true },
|
|
121
|
+
_timeFontSizeRem: { state: true },
|
|
122
|
+
_trackText: { state: true },
|
|
123
|
+
_tracks: { state: true },
|
|
124
|
+
_usingVolumeContainer: { state: true },
|
|
125
|
+
_volume: { state: true },
|
|
124
126
|
};
|
|
125
127
|
|
|
126
|
-
static styles = [labelStyles, css`
|
|
128
|
+
static styles = [super.styles, labelStyles, css`
|
|
127
129
|
:host {
|
|
128
130
|
display: block;
|
|
129
131
|
min-height: 140px;
|
|
@@ -134,7 +136,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
134
136
|
display: none;
|
|
135
137
|
}
|
|
136
138
|
|
|
137
|
-
#
|
|
139
|
+
#media-container {
|
|
138
140
|
align-items: center;
|
|
139
141
|
justify-content: center;
|
|
140
142
|
/* This max-height prevents the video from growing out of bounds and appearing cut off inside of ISF iframes */
|
|
@@ -144,17 +146,17 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
144
146
|
width: 100%;
|
|
145
147
|
}
|
|
146
148
|
|
|
147
|
-
.
|
|
149
|
+
.type-is-audio {
|
|
148
150
|
background-color: #ffffff;
|
|
149
151
|
}
|
|
150
152
|
|
|
151
|
-
.
|
|
153
|
+
.type-is-video {
|
|
152
154
|
background-color: #000000;
|
|
153
155
|
color: #ffffff;
|
|
154
156
|
}
|
|
155
157
|
|
|
156
158
|
|
|
157
|
-
#
|
|
159
|
+
#video {
|
|
158
160
|
display: block;
|
|
159
161
|
height: 100%;
|
|
160
162
|
max-height: var(--d2l-labs-media-player-video-max-height, 100vh);
|
|
@@ -163,7 +165,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
163
165
|
width: 100%;
|
|
164
166
|
}
|
|
165
167
|
|
|
166
|
-
#
|
|
168
|
+
#video-poster {
|
|
167
169
|
background-color: #000000;
|
|
168
170
|
cursor: pointer;
|
|
169
171
|
height: 100%;
|
|
@@ -173,7 +175,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
173
175
|
z-index: 1;
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
#
|
|
178
|
+
#video-poster-play-button {
|
|
177
179
|
background-color: rgba(0, 0, 0, 0.69);
|
|
178
180
|
border: none;
|
|
179
181
|
border-radius: 50%;
|
|
@@ -183,7 +185,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
183
185
|
z-index: 2;
|
|
184
186
|
}
|
|
185
187
|
|
|
186
|
-
#
|
|
188
|
+
#video-poster-play-button[transcript] {
|
|
187
189
|
background-color: rgba(0, 0, 0, 0.69);
|
|
188
190
|
border: none;
|
|
189
191
|
border-radius: 50%;
|
|
@@ -197,11 +199,11 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
197
199
|
}
|
|
198
200
|
|
|
199
201
|
|
|
200
|
-
#
|
|
202
|
+
#video-poster-play-button > d2l-icon {
|
|
201
203
|
color: #ffffff;
|
|
202
204
|
}
|
|
203
205
|
|
|
204
|
-
#
|
|
206
|
+
#media-controls {
|
|
205
207
|
bottom: 0;
|
|
206
208
|
position: absolute;
|
|
207
209
|
transition: bottom 500ms ease;
|
|
@@ -209,18 +211,18 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
209
211
|
z-index: 2;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
|
-
.
|
|
214
|
+
.type-is-audio #media-controls {
|
|
213
215
|
background-color: #ffffff;
|
|
214
216
|
}
|
|
215
|
-
.
|
|
217
|
+
.type-is-video #media-controls {
|
|
216
218
|
background-color: rgba(0, 0, 0, 0.69);
|
|
217
219
|
}
|
|
218
220
|
|
|
219
|
-
#
|
|
221
|
+
#media-controls.hidden {
|
|
220
222
|
bottom: -8rem;
|
|
221
223
|
}
|
|
222
224
|
|
|
223
|
-
#
|
|
225
|
+
#seek-bar {
|
|
224
226
|
--d2l-knob-focus-color: #ffffff;
|
|
225
227
|
--d2l-knob-focus-size: 4px;
|
|
226
228
|
--d2l-knob-size: 16px;
|
|
@@ -232,11 +234,11 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
232
234
|
z-index: 1;
|
|
233
235
|
}
|
|
234
236
|
|
|
235
|
-
#
|
|
237
|
+
#seek-bar:focus {
|
|
236
238
|
--d2l-knob-box-shadow: 0 2px 6px 3px rgba(0, 0, 0, 1);
|
|
237
239
|
}
|
|
238
240
|
|
|
239
|
-
#
|
|
241
|
+
#buttons {
|
|
240
242
|
align-items: center;
|
|
241
243
|
direction: ltr;
|
|
242
244
|
display: flex;
|
|
@@ -245,12 +247,12 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
245
247
|
margin-left: 6px;
|
|
246
248
|
}
|
|
247
249
|
|
|
248
|
-
[dir="rtl"] #
|
|
250
|
+
[dir="rtl"] #buttons {
|
|
249
251
|
margin-left: 0;
|
|
250
252
|
margin-right: 6px;
|
|
251
253
|
}
|
|
252
254
|
|
|
253
|
-
.
|
|
255
|
+
.flex-filler {
|
|
254
256
|
flex: auto;
|
|
255
257
|
}
|
|
256
258
|
|
|
@@ -260,15 +262,15 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
260
262
|
margin: 6px 6px 6px 0;
|
|
261
263
|
}
|
|
262
264
|
|
|
263
|
-
#
|
|
265
|
+
#time:hover {
|
|
264
266
|
cursor: auto;
|
|
265
267
|
}
|
|
266
268
|
|
|
267
|
-
#
|
|
269
|
+
#volume-container {
|
|
268
270
|
position: relative;
|
|
269
271
|
}
|
|
270
272
|
|
|
271
|
-
#
|
|
273
|
+
#volume-level-container {
|
|
272
274
|
bottom: calc(1.8rem + 6px);
|
|
273
275
|
height: 11px;
|
|
274
276
|
left: 0;
|
|
@@ -277,11 +279,11 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
277
279
|
z-index: 2;
|
|
278
280
|
}
|
|
279
281
|
|
|
280
|
-
#
|
|
282
|
+
#volume-level-container.hidden {
|
|
281
283
|
left: -10000px;
|
|
282
284
|
}
|
|
283
285
|
|
|
284
|
-
#
|
|
286
|
+
#volume-level-background {
|
|
285
287
|
align-items: center;
|
|
286
288
|
background-color: rgba(0, 0, 0, 0.69);
|
|
287
289
|
border-radius: 0 0.3rem 0.3rem 0;
|
|
@@ -295,12 +297,12 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
295
297
|
width: 6rem;
|
|
296
298
|
}
|
|
297
299
|
|
|
298
|
-
#
|
|
300
|
+
#volume-slider-container {
|
|
299
301
|
height: 100%;
|
|
300
302
|
width: 100%;
|
|
301
303
|
}
|
|
302
304
|
|
|
303
|
-
#
|
|
305
|
+
#volume-slider {
|
|
304
306
|
--d2l-knob-focus-color: #ffffff;
|
|
305
307
|
--d2l-knob-focus-size: 0.25rem;
|
|
306
308
|
--d2l-knob-size: 0.8rem;
|
|
@@ -309,11 +311,11 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
309
311
|
top: calc(0.5rem + 1px);
|
|
310
312
|
}
|
|
311
313
|
|
|
312
|
-
.
|
|
314
|
+
.rotated {
|
|
313
315
|
transform: rotate(-90deg);
|
|
314
316
|
}
|
|
315
317
|
|
|
316
|
-
#
|
|
318
|
+
#audio-bars-container {
|
|
317
319
|
align-items: center;
|
|
318
320
|
display: flex;
|
|
319
321
|
flex-wrap: nowrap;
|
|
@@ -329,7 +331,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
329
331
|
height: 2rem;
|
|
330
332
|
}
|
|
331
333
|
|
|
332
|
-
#
|
|
334
|
+
#track-container {
|
|
333
335
|
align-items: center;
|
|
334
336
|
color: #ffffff;
|
|
335
337
|
display: flex;
|
|
@@ -342,7 +344,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
342
344
|
}
|
|
343
345
|
|
|
344
346
|
@media screen and (min-width: 768px) {
|
|
345
|
-
#
|
|
347
|
+
#track-container > div {
|
|
346
348
|
align-items: center;
|
|
347
349
|
display: flex;
|
|
348
350
|
justify-content: center;
|
|
@@ -352,7 +354,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
352
354
|
}
|
|
353
355
|
|
|
354
356
|
@media screen and (max-width: 767px) {
|
|
355
|
-
#
|
|
357
|
+
#track-container > div {
|
|
356
358
|
align-items: center;
|
|
357
359
|
display: flex;
|
|
358
360
|
justify-content: center;
|
|
@@ -360,7 +362,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
360
362
|
}
|
|
361
363
|
}
|
|
362
364
|
|
|
363
|
-
#
|
|
365
|
+
#track-container > div > span {
|
|
364
366
|
background-color: rgba(0, 0, 0, 0.69);
|
|
365
367
|
box-shadow: 0.3rem 0 0 rgba(0, 0, 0, 0.69), -0.3rem 0 0 rgba(0, 0, 0, 0.69);
|
|
366
368
|
color: white;
|
|
@@ -368,12 +370,12 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
368
370
|
white-space: pre-wrap;
|
|
369
371
|
}
|
|
370
372
|
|
|
371
|
-
#
|
|
373
|
+
#audio-play-button-container {
|
|
372
374
|
background-color: white;
|
|
373
375
|
position: absolute;
|
|
374
376
|
}
|
|
375
377
|
|
|
376
|
-
#
|
|
378
|
+
#audio-play-button {
|
|
377
379
|
background-color: transparent;
|
|
378
380
|
border: none;
|
|
379
381
|
border-radius: 12px;
|
|
@@ -381,26 +383,26 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
381
383
|
padding: 2px;
|
|
382
384
|
}
|
|
383
385
|
|
|
384
|
-
#
|
|
386
|
+
#audio-play-button:focus {
|
|
385
387
|
outline: none;
|
|
386
388
|
}
|
|
387
389
|
|
|
388
|
-
#
|
|
390
|
+
#audio-play-button:hover {
|
|
389
391
|
background: var(--d2l-color-mica);
|
|
390
392
|
background-clip: content-box;
|
|
391
393
|
cursor: pointer;
|
|
392
394
|
}
|
|
393
395
|
|
|
394
|
-
#
|
|
396
|
+
#audio-play-button:${unsafeCSS(getFocusPseudoClass())} {
|
|
395
397
|
border: 2px solid var(--d2l-color-celestine);
|
|
396
398
|
}
|
|
397
399
|
|
|
398
|
-
#
|
|
400
|
+
#audio-play-button > d2l-icon {
|
|
399
401
|
height: 2.75rem;
|
|
400
402
|
width: 2.75rem;
|
|
401
403
|
}
|
|
402
404
|
|
|
403
|
-
.
|
|
405
|
+
.chapter-marker, .chapter-marker-highlight {
|
|
404
406
|
cursor: pointer;
|
|
405
407
|
height: 6px;
|
|
406
408
|
pointer-events: none;
|
|
@@ -410,27 +412,27 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
410
412
|
z-index: 2;
|
|
411
413
|
}
|
|
412
414
|
|
|
413
|
-
.
|
|
415
|
+
.chapter-marker {
|
|
414
416
|
background-color: var(--d2l-color-ferrite);
|
|
415
417
|
}
|
|
416
418
|
|
|
417
|
-
.
|
|
419
|
+
.chapter-marker-highlight {
|
|
418
420
|
background-color: var(--d2l-color-celestine-minus-1);
|
|
419
421
|
}
|
|
420
422
|
|
|
421
|
-
.
|
|
423
|
+
.chapter-marker[theme="dark"] {
|
|
422
424
|
background-color: white;
|
|
423
425
|
}
|
|
424
426
|
|
|
425
|
-
#
|
|
427
|
+
#search-container {
|
|
426
428
|
align-items: center;
|
|
427
429
|
display: flex;
|
|
428
430
|
}
|
|
429
|
-
#
|
|
431
|
+
#search-container.search-container-hidden {
|
|
430
432
|
display: none;
|
|
431
433
|
}
|
|
432
434
|
|
|
433
|
-
#
|
|
435
|
+
#search-container #search-input {
|
|
434
436
|
border-color: rgba(48, 52, 54, 0.1);
|
|
435
437
|
border-radius: 20px;
|
|
436
438
|
color: var(--d2l-color-ferrite);
|
|
@@ -444,19 +446,19 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
444
446
|
width: 0;
|
|
445
447
|
}
|
|
446
448
|
|
|
447
|
-
#
|
|
449
|
+
#search-container #search-input[theme="dark"] {
|
|
448
450
|
background-color: rgba(24, 26, 27, 0.15);
|
|
449
451
|
color: rgb(206, 216, 225);
|
|
450
452
|
}
|
|
451
453
|
|
|
452
|
-
#
|
|
453
|
-
#
|
|
454
|
+
#search-container #search-input:focus,
|
|
455
|
+
#search-container #search-input:active {
|
|
454
456
|
box-shadow: rgb(24 26 27) 0 0 1px;
|
|
455
457
|
outline-color: initial;
|
|
456
458
|
}
|
|
457
459
|
|
|
458
|
-
#
|
|
459
|
-
#
|
|
460
|
+
#search-container:hover #search-input,
|
|
461
|
+
#search-container.search-container-hover #search-input {
|
|
460
462
|
height: 1.2rem;
|
|
461
463
|
opacity: 1;
|
|
462
464
|
padding: 0 0.35rem;
|
|
@@ -464,21 +466,21 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
464
466
|
width: 6rem;
|
|
465
467
|
}
|
|
466
468
|
|
|
467
|
-
#
|
|
469
|
+
#timeline-markers-container {
|
|
468
470
|
position: absolute;
|
|
469
471
|
top: -9px;
|
|
470
472
|
transition: all 0.2s;
|
|
471
473
|
width: 100%;
|
|
472
474
|
}
|
|
473
475
|
|
|
474
|
-
#
|
|
476
|
+
#thumbnails-preview-container {
|
|
475
477
|
bottom: 60px;
|
|
476
478
|
position: absolute;
|
|
477
479
|
transform: translateX(-50%);
|
|
478
480
|
z-index: 2;
|
|
479
481
|
}
|
|
480
482
|
|
|
481
|
-
#
|
|
483
|
+
#thumbnails-preview-chapter {
|
|
482
484
|
background: #00000072;
|
|
483
485
|
position: absolute;
|
|
484
486
|
text-align: center;
|
|
@@ -487,7 +489,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
487
489
|
z-index: 2;
|
|
488
490
|
}
|
|
489
491
|
|
|
490
|
-
#
|
|
492
|
+
#thumbnails-preview-time {
|
|
491
493
|
background: #00000042;
|
|
492
494
|
bottom: 3px;
|
|
493
495
|
font-size: 14px;
|
|
@@ -499,14 +501,14 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
499
501
|
z-index: 2;
|
|
500
502
|
}
|
|
501
503
|
|
|
502
|
-
#
|
|
504
|
+
#thumbnails-preview-image {
|
|
503
505
|
background-repeat: no-repeat;
|
|
504
506
|
position: relative;
|
|
505
507
|
width: 100%;
|
|
506
508
|
z-index: 2;
|
|
507
509
|
}
|
|
508
510
|
|
|
509
|
-
.
|
|
511
|
+
.search-marker {
|
|
510
512
|
color: var(--d2l-color-ferrite);
|
|
511
513
|
cursor: pointer;
|
|
512
514
|
height: 6px;
|
|
@@ -517,11 +519,11 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
517
519
|
z-index: 2;
|
|
518
520
|
}
|
|
519
521
|
|
|
520
|
-
.
|
|
522
|
+
.search-marker[theme="dark"] {
|
|
521
523
|
color: white;
|
|
522
524
|
}
|
|
523
525
|
|
|
524
|
-
.
|
|
526
|
+
.full-area-centered {
|
|
525
527
|
align-items: center;
|
|
526
528
|
display: flex;
|
|
527
529
|
height: 100%;
|
|
@@ -533,18 +535,18 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
533
535
|
z-index: 2;
|
|
534
536
|
}
|
|
535
537
|
|
|
536
|
-
#
|
|
538
|
+
#alert-inner {
|
|
537
539
|
display: flex;
|
|
538
540
|
flex-direction: row;
|
|
539
541
|
justify-content: flex-start;
|
|
540
542
|
}
|
|
541
543
|
|
|
542
|
-
#
|
|
544
|
+
#alert-inner > svg {
|
|
543
545
|
flex-shrink: 0;
|
|
544
546
|
margin-right: 0.5rem;
|
|
545
547
|
}
|
|
546
548
|
|
|
547
|
-
#
|
|
549
|
+
#alert-inner > span {
|
|
548
550
|
font-size: 1rem;
|
|
549
551
|
line-height: 2.1rem;
|
|
550
552
|
}
|
|
@@ -673,6 +675,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
673
675
|
if (this._media) {
|
|
674
676
|
this._media.currentTime = time;
|
|
675
677
|
}
|
|
678
|
+
this._resetAudioDescriptionCursor(time);
|
|
676
679
|
this._syncDisplayedTrackTextToSelectedTrack();
|
|
677
680
|
}
|
|
678
681
|
|
|
@@ -737,14 +740,14 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
737
740
|
if (sourceNodes.length < 1) console.warn('d2l-labs-media-player component requires source tags if src is not set');
|
|
738
741
|
}
|
|
739
742
|
|
|
740
|
-
this._mediaContainer = this.shadowRoot.getElementById('
|
|
741
|
-
this._playButton = this.shadowRoot.getElementById('
|
|
742
|
-
this._seekBar = this.shadowRoot.getElementById('
|
|
743
|
-
this._settingsMenu = this.shadowRoot.getElementById('
|
|
744
|
-
this._speedLevelBackground = this.shadowRoot.getElementById('
|
|
745
|
-
this._volumeSlider = this.shadowRoot.getElementById('
|
|
746
|
-
this._searchInput = this.shadowRoot.getElementById('
|
|
747
|
-
this._searchContainer = this.shadowRoot.getElementById('
|
|
743
|
+
this._mediaContainer = this.shadowRoot.getElementById('media-container');
|
|
744
|
+
this._playButton = this.shadowRoot.getElementById('play-button');
|
|
745
|
+
this._seekBar = this.shadowRoot.getElementById('seek-bar');
|
|
746
|
+
this._settingsMenu = this.shadowRoot.getElementById('settings-menu');
|
|
747
|
+
this._speedLevelBackground = this.shadowRoot.getElementById('speed-level-background');
|
|
748
|
+
this._volumeSlider = this.shadowRoot.getElementById('volume-slider');
|
|
749
|
+
this._searchInput = this.shadowRoot.getElementById('search-input');
|
|
750
|
+
this._searchContainer = this.shadowRoot.getElementById('search-container');
|
|
748
751
|
|
|
749
752
|
this._getMetadata();
|
|
750
753
|
|
|
@@ -803,11 +806,12 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
803
806
|
const trackContainerStyle = { bottom: this._hidingCustomControls() ? '12px' : 'calc(1.8rem + 38px)' };
|
|
804
807
|
const trackSpanStyle = { fontSize: `${this._trackFontSizeRem}rem`, lineHeight: `${this._trackFontSizeRem * 1.2}rem` };
|
|
805
808
|
|
|
806
|
-
const mediaContainerClass = { '
|
|
807
|
-
const mediaControlsClass = { '
|
|
809
|
+
const mediaContainerClass = { 'type-is-audio': this.mediaType === SOURCE_TYPES.audio, 'type-is-video': this.mediaType === SOURCE_TYPES.video };
|
|
810
|
+
const mediaControlsClass = { 'hidden': this._hidingCustomControls() };
|
|
808
811
|
const theme = this.mediaType === SOURCE_TYPES.video ? 'dark' : undefined;
|
|
809
|
-
const volumeLevelContainerClass = { '
|
|
810
|
-
const
|
|
812
|
+
const volumeLevelContainerClass = { 'hidden': !this._usingVolumeContainer || this._hidingCustomControls() };
|
|
813
|
+
const hideSearchForAudioDescriptions = !this.hideAudioDescriptionSelection && this._audioDescriptionTracks.length > 0 && this._audioDescriptionControlsInMenu;
|
|
814
|
+
const searchContainerClass = { 'search-container-hidden' : !this._searchInstances[this._getSrclangFromTrackIdentifier(this._selectedTrackIdentifier)] || hideSearchForAudioDescriptions };
|
|
811
815
|
this._captionsMenuReturnItem?.setAttribute('text', (this.transcriptViewerOn ? this.localize('components:mediaPlayer:language') : this.localize('components:mediaPlayer:captions')));
|
|
812
816
|
|
|
813
817
|
const fullscreenButton = this.mediaType === SOURCE_TYPES.video ? html`<d2l-button-icon
|
|
@@ -822,27 +826,27 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
822
826
|
|
|
823
827
|
${this._getLoadingSpinnerView()}
|
|
824
828
|
|
|
825
|
-
<div id="
|
|
829
|
+
<div id="media-container" class=${classMap(mediaContainerClass)} style=${styleMap(mediaContainerStyle)} @mousemove=${this._onVideoContainerMouseMove} @keydown=${this._listenForKeyboard}>
|
|
826
830
|
${this.transcriptViewerOn ? this._renderTranscriptViewer() : ''}
|
|
827
831
|
${this._getMediaAreaView()}
|
|
828
832
|
|
|
829
833
|
${!this._trackText || this.transcriptViewerOn ? null : html`
|
|
830
|
-
<div id="
|
|
834
|
+
<div id="track-container" style=${styleMap(trackContainerStyle)} @click=${this._onTrackContainerClick}>
|
|
831
835
|
<div>
|
|
832
836
|
<span style=${styleMap(trackSpanStyle)} role="status">${this._trackText}</span>
|
|
833
837
|
</div>
|
|
834
838
|
</div>
|
|
835
839
|
`}
|
|
836
840
|
|
|
837
|
-
<div class=${classMap(mediaControlsClass)} id="
|
|
841
|
+
<div class=${classMap(mediaControlsClass)} id="media-controls" @mouseenter=${this._startHoveringControls} @mouseleave=${this._stopHoveringControls}>
|
|
838
842
|
${this._getTimelinePreview()}
|
|
839
|
-
<div id="
|
|
843
|
+
<div id="timeline-markers-container">
|
|
840
844
|
${this._getSearchResultsView()}
|
|
841
845
|
${this._getChapterMarkersView()}
|
|
842
846
|
</div>
|
|
843
847
|
${this.hideSeekBar ? '' : html`
|
|
844
848
|
<d2l-labs-slider-bar
|
|
845
|
-
id="
|
|
849
|
+
id="seek-bar"
|
|
846
850
|
fullWidth
|
|
847
851
|
solid
|
|
848
852
|
min="0"
|
|
@@ -857,10 +861,10 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
857
861
|
@hovering-end=${this._onHoverEnd}
|
|
858
862
|
></d2l-labs-slider-bar>
|
|
859
863
|
`}
|
|
860
|
-
<div id="
|
|
864
|
+
<div id="buttons">
|
|
861
865
|
<d2l-button-icon icon="${playIcon}" text="${playTooltip}" @click="${this._togglePlay}" theme="${ifDefined(theme)}"></d2l-button-icon>
|
|
862
866
|
|
|
863
|
-
<div id="
|
|
867
|
+
<div id="volume-container" @mouseenter="${this._startUsingVolumeContainer}" @mouseleave="${this._stopUsingVolumeContainer}" ?hidden="${IS_IOS}">
|
|
864
868
|
<d2l-button-icon
|
|
865
869
|
class="d2l-dropdown-opener"
|
|
866
870
|
icon="${volumeIcon}"
|
|
@@ -870,11 +874,11 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
870
874
|
@click="${this._toggleMute}"
|
|
871
875
|
@focus="${this._startUsingVolumeContainer}"
|
|
872
876
|
></d2l-button-icon>
|
|
873
|
-
<div id="
|
|
874
|
-
<div class="
|
|
875
|
-
<div id="
|
|
877
|
+
<div id="volume-level-container" class=${classMap(volumeLevelContainerClass)}>
|
|
878
|
+
<div class="rotated" id="volume-level-background">
|
|
879
|
+
<div id="volume-slider-container">
|
|
876
880
|
<d2l-labs-slider-bar solid
|
|
877
|
-
id="
|
|
881
|
+
id="volume-slider"
|
|
878
882
|
vertical
|
|
879
883
|
value="${Math.round(this._volume * 100)}"
|
|
880
884
|
label="${this.localize('components:mediaPlayer:volumeSlider')}"
|
|
@@ -888,7 +892,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
888
892
|
</div>
|
|
889
893
|
</div>
|
|
890
894
|
|
|
891
|
-
<div id="
|
|
895
|
+
<div id="time"
|
|
892
896
|
aria-live="off"
|
|
893
897
|
aria-hidden="true"
|
|
894
898
|
tabindex="-1"
|
|
@@ -898,16 +902,18 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
898
902
|
${MediaPlayer._formatTime(this.currentTime)} / ${MediaPlayer._formatTime(this.duration)}
|
|
899
903
|
</div>
|
|
900
904
|
|
|
901
|
-
<div class="
|
|
905
|
+
<div class="flex-filler"></div>
|
|
906
|
+
|
|
907
|
+
${this._getAudioDescriptionsButtonView()}
|
|
902
908
|
|
|
903
909
|
<div
|
|
904
910
|
@mouseenter=${this._onSearchContainerHover}
|
|
905
911
|
@mouseleave=${this._onSearchContainerHover}
|
|
906
912
|
class=${classMap(searchContainerClass)}
|
|
907
|
-
id="
|
|
913
|
+
id="search-container"
|
|
908
914
|
><d2l-button-icon
|
|
909
915
|
icon="tier1:search"
|
|
910
|
-
id="
|
|
916
|
+
id="search-button"
|
|
911
917
|
text=${this.localize('components:mediaPlayer:showSearchInput')}
|
|
912
918
|
theme="${ifDefined(theme)}"
|
|
913
919
|
></d2l-button-icon>
|
|
@@ -915,7 +921,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
915
921
|
@blur=${this._onSearchInputBlur}
|
|
916
922
|
@focus=${this._onSearchInputFocus}
|
|
917
923
|
@input=${this._onSearchInputChanged}
|
|
918
|
-
id="
|
|
924
|
+
id="search-input"
|
|
919
925
|
placeholder="${this.localize('components:mediaPlayer:searchPlaceholder')}"
|
|
920
926
|
theme="${ifDefined(theme)}"
|
|
921
927
|
type="text"
|
|
@@ -923,9 +929,9 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
923
929
|
</div>
|
|
924
930
|
<d2l-dropdown>
|
|
925
931
|
<d2l-button-icon class="d2l-dropdown-opener" icon="tier1:gear" text="${this.localize('components:mediaPlayer:settings')}" theme="${ifDefined(theme)}"></d2l-button-icon>
|
|
926
|
-
<d2l-dropdown-menu id="
|
|
932
|
+
<d2l-dropdown-menu id="settings-menu" class="vdiff-target" no-pointer theme="${ifDefined(theme)}">
|
|
927
933
|
<d2l-menu label="${this.localize('components:mediaPlayer:settings')}" theme="${ifDefined(theme)}">
|
|
928
|
-
<d2l-menu-item id="
|
|
934
|
+
<d2l-menu-item id="playback-speeds" text="${this.localize('components:mediaPlayer:playbackSpeed')}">
|
|
929
935
|
<div slot="supporting">${this._selectedSpeed}</div>
|
|
930
936
|
<d2l-menu @d2l-menu-item-change=${this._onPlaybackSpeedsMenuItemChange} theme="${ifDefined(theme)}">
|
|
931
937
|
${PLAYBACK_SPEEDS.map(speed => html`
|
|
@@ -1011,9 +1017,9 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1011
1017
|
if (!this.shadowRoot) return null;
|
|
1012
1018
|
switch (this.mediaType) {
|
|
1013
1019
|
case SOURCE_TYPES.audio:
|
|
1014
|
-
return this.shadowRoot.getElementById('
|
|
1020
|
+
return this.shadowRoot.getElementById('audio');
|
|
1015
1021
|
case SOURCE_TYPES.video:
|
|
1016
|
-
return this.shadowRoot.getElementById('
|
|
1022
|
+
return this.shadowRoot.getElementById('video');
|
|
1017
1023
|
default:
|
|
1018
1024
|
return null;
|
|
1019
1025
|
}
|
|
@@ -1129,7 +1135,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1129
1135
|
const highlight = this._hovering && this._hoverTime >= this._chapters[0].time && (chapter.time === start || chapter.time === end);
|
|
1130
1136
|
return chapter.time > 0 ? html`
|
|
1131
1137
|
<div
|
|
1132
|
-
class=${highlight ? '
|
|
1138
|
+
class=${highlight ? 'chapter-marker-highlight' : 'chapter-marker'}
|
|
1133
1139
|
theme="${ifDefined(this._getTheme())}"
|
|
1134
1140
|
style=${styleMap({ left: `${this._getPercentageTime(chapter.time)}%` })}
|
|
1135
1141
|
></div>
|
|
@@ -1189,7 +1195,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1189
1195
|
|
|
1190
1196
|
_getLoadingSpinnerView() {
|
|
1191
1197
|
return this._loading ? html`
|
|
1192
|
-
<div class="
|
|
1198
|
+
<div class="full-area-centered">
|
|
1193
1199
|
<d2l-loading-spinner size="100"></d2l-loading-spinner>
|
|
1194
1200
|
</div>
|
|
1195
1201
|
` : null;
|
|
@@ -1204,7 +1210,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1204
1210
|
return html`
|
|
1205
1211
|
${this._getPosterView()}
|
|
1206
1212
|
<video
|
|
1207
|
-
id="
|
|
1213
|
+
id="video"
|
|
1208
1214
|
playsinline
|
|
1209
1215
|
webkit-playsinline
|
|
1210
1216
|
?autoplay="${this.autoplay}"
|
|
@@ -1233,7 +1239,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1233
1239
|
case SOURCE_TYPES.audio:
|
|
1234
1240
|
return html`
|
|
1235
1241
|
<audio
|
|
1236
|
-
id="
|
|
1242
|
+
id="audio"
|
|
1237
1243
|
?autoplay="${this.autoplay}"
|
|
1238
1244
|
?loop="${this.loop}"
|
|
1239
1245
|
crossorigin="${ifDefined(this.crossorigin)}"
|
|
@@ -1253,9 +1259,9 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1253
1259
|
<source @error=${this._onError}></source>
|
|
1254
1260
|
</audio>
|
|
1255
1261
|
${this.transcriptViewerOn ? null : html`
|
|
1256
|
-
<div id="
|
|
1257
|
-
<div id="
|
|
1258
|
-
<button id="
|
|
1262
|
+
<div id="audio-bars-container">
|
|
1263
|
+
<div id="audio-play-button-container">
|
|
1264
|
+
<button id="audio-play-button" title="${playTooltip}" aria-label="${playTooltip}" @click=${this._togglePlay}>
|
|
1259
1265
|
<d2l-icon icon="${playIcon}"></d2l-icon>
|
|
1260
1266
|
</button>
|
|
1261
1267
|
</div>
|
|
@@ -1331,7 +1337,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1331
1337
|
if (!this.poster || this.autoplay || !this._posterVisible) return;
|
|
1332
1338
|
|
|
1333
1339
|
const playIcon = !this._loading ? html`
|
|
1334
|
-
<button id="
|
|
1340
|
+
<button id="video-poster-play-button" aria-label=${this.localize('components:mediaPlayer:play')} title=${this.localize('components:mediaPlayer:play')} transcript="${ifDefined(this.transcriptViewerOn ? true : undefined)}"
|
|
1335
1341
|
@click=${this._onVideoClick}>
|
|
1336
1342
|
<d2l-icon icon="tier1:play" theme="${ifDefined(this._getTheme())}"></d2l-icon>
|
|
1337
1343
|
</button>
|
|
@@ -1340,7 +1346,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1340
1346
|
return html`
|
|
1341
1347
|
${playIcon}
|
|
1342
1348
|
<img
|
|
1343
|
-
id="
|
|
1349
|
+
id="video-poster"
|
|
1344
1350
|
src="${ifDefined(this.poster)}"
|
|
1345
1351
|
@click=${this._onVideoClick}
|
|
1346
1352
|
/>
|
|
@@ -1377,7 +1383,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1377
1383
|
return html`
|
|
1378
1384
|
<d2l-icon
|
|
1379
1385
|
@click=${this._onTimelineMarkerClick(result)}
|
|
1380
|
-
class="
|
|
1386
|
+
class="search-marker"
|
|
1381
1387
|
icon="tier1:subscribe-filled"
|
|
1382
1388
|
theme="${ifDefined(this._getTheme())}"
|
|
1383
1389
|
style=${styleMap({ left: `${this._getPercentageTime(result)}%` })}
|
|
@@ -1425,15 +1431,15 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1425
1431
|
|
|
1426
1432
|
if (!(this.thumbnails && this._thumbnailsImage))
|
|
1427
1433
|
return html`
|
|
1428
|
-
<div id="
|
|
1434
|
+
<div id="thumbnails-preview-container"
|
|
1429
1435
|
style="width: ${DEFAULT_PREVIEW_WIDTH}px; left: clamp(${DEFAULT_PREVIEW_WIDTH / 2}px, ${this._timelinePreviewOffset}%, calc(100% - ${DEFAULT_PREVIEW_WIDTH / 2}px));">
|
|
1430
1436
|
<div
|
|
1431
|
-
id="
|
|
1437
|
+
id="thumbnails-preview-image"
|
|
1432
1438
|
>
|
|
1433
|
-
<span id="
|
|
1439
|
+
<span id="thumbnails-preview-time">${MediaPlayer._formatTime(this._hoverTime)}</span>
|
|
1434
1440
|
</div>
|
|
1435
1441
|
${chapterTitleLabel &&
|
|
1436
|
-
html`<span class="d2l-label-text" id="
|
|
1442
|
+
html`<span class="d2l-label-text" id="thumbnails-preview-chapter" style="bottom: ${DEFAULT_PREVIEW_HEIGHT - 60}px">${chapterTitleLabel}</span>`}
|
|
1437
1443
|
</div>
|
|
1438
1444
|
`;
|
|
1439
1445
|
|
|
@@ -1456,16 +1462,16 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1456
1462
|
const column = thumbNum % columns;
|
|
1457
1463
|
|
|
1458
1464
|
return html`
|
|
1459
|
-
<div id="
|
|
1465
|
+
<div id="thumbnails-preview-container"
|
|
1460
1466
|
style="width: ${thumbWidth}px; left: clamp(${thumbWidth / 2}px, ${this._timelinePreviewOffset}%, calc(100% - ${thumbWidth / 2}px));">
|
|
1461
1467
|
<div
|
|
1462
|
-
id="
|
|
1468
|
+
id="thumbnails-preview-image"
|
|
1463
1469
|
style="height: ${thumbHeight}px; background: url(${this._thumbnailsImage.src}) ${-column * thumbWidth}px ${-row * thumbHeight}px / ${width}px ${height}px;"
|
|
1464
1470
|
>
|
|
1465
|
-
<span id="
|
|
1471
|
+
<span id="thumbnails-preview-time">${MediaPlayer._formatTime(this._hoverTime)}</span>
|
|
1466
1472
|
</div>
|
|
1467
1473
|
${chapterTitleLabel &&
|
|
1468
|
-
html`<span class="d2l-label-text" id="
|
|
1474
|
+
html`<span class="d2l-label-text" id="thumbnails-preview-chapter" style="bottom: ${thumbHeight}px">${chapterTitleLabel}</span>`}
|
|
1469
1475
|
</div>
|
|
1470
1476
|
`;
|
|
1471
1477
|
}
|
|
@@ -1486,7 +1492,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1486
1492
|
return this._tracks.length > 0 && !this.hideCaptionsSelection ? html`
|
|
1487
1493
|
<d2l-menu-item text="${this.transcriptViewerOn ? this.localize('components:mediaPlayer:language') : this.localize('components:mediaPlayer:captions')}">
|
|
1488
1494
|
<div slot="supporting">${this._selectedTrackLabel}</div>
|
|
1489
|
-
<d2l-menu id="
|
|
1495
|
+
<d2l-menu id="captions-menu"
|
|
1490
1496
|
@d2l-menu-item-change=${this._onTracksMenuItemChange} theme="${ifDefined(this._getTheme())}">
|
|
1491
1497
|
${this.transcriptViewerOn ? '' : html`
|
|
1492
1498
|
<d2l-menu-item-radio text="${this.localize('components:mediaPlayer:off')}" ?selected="${!this._selectedTrackIdentifier}"></d2l-menu-item-radio>`}
|
|
@@ -1522,6 +1528,12 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1522
1528
|
case KEY_BINDINGS.fullscreen:
|
|
1523
1529
|
this._toggleFullscreen();
|
|
1524
1530
|
break;
|
|
1531
|
+
case KEY_BINDINGS.replayAudioDescription:
|
|
1532
|
+
this._replayAudioDescription();
|
|
1533
|
+
break;
|
|
1534
|
+
case KEY_BINDINGS.skipAudioDescription:
|
|
1535
|
+
this._skipAudioDescription();
|
|
1536
|
+
break;
|
|
1525
1537
|
}
|
|
1526
1538
|
}
|
|
1527
1539
|
|
|
@@ -1592,6 +1604,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1592
1604
|
}
|
|
1593
1605
|
|
|
1594
1606
|
_onDragStartSeek() {
|
|
1607
|
+
this._cancelAudioDescription();
|
|
1595
1608
|
if (this._playing) {
|
|
1596
1609
|
this._media.pause();
|
|
1597
1610
|
this._pausedForSeekDrag = true;
|
|
@@ -1622,6 +1635,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1622
1635
|
}
|
|
1623
1636
|
|
|
1624
1637
|
_onEnded() {
|
|
1638
|
+
this._cancelAudioDescription();
|
|
1625
1639
|
this._playRequested = false;
|
|
1626
1640
|
this.dispatchEvent(new CustomEvent('ended'));
|
|
1627
1641
|
}
|
|
@@ -1684,6 +1698,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1684
1698
|
}
|
|
1685
1699
|
|
|
1686
1700
|
_onPause() {
|
|
1701
|
+
if (!this._audioDescriptionPausedVideo) this._cancelAudioDescription();
|
|
1687
1702
|
this._playing = false;
|
|
1688
1703
|
this.dispatchEvent(new CustomEvent('pause'));
|
|
1689
1704
|
}
|
|
@@ -1786,6 +1801,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1786
1801
|
|
|
1787
1802
|
async _onSlotChange(e) {
|
|
1788
1803
|
this._tracks = [];
|
|
1804
|
+
this._audioDescriptionTracks = [];
|
|
1789
1805
|
const nodes = e.target.assignedNodes();
|
|
1790
1806
|
let defaultTrack;
|
|
1791
1807
|
|
|
@@ -1813,6 +1829,11 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1813
1829
|
|
|
1814
1830
|
if (node.nodeType !== Node.ELEMENT_NODE || node.nodeName !== 'TRACK') continue;
|
|
1815
1831
|
|
|
1832
|
+
if (node.getAttribute('kind') === AUDIO_DESCRIPTION_TRACK_KIND) {
|
|
1833
|
+
await this._loadAudioDescriptionTrack(node);
|
|
1834
|
+
continue;
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1816
1837
|
if (!(node.kind in TRACK_KINDS)) {
|
|
1817
1838
|
console.warn(`d2l-labs-media-player component requires 'kind' text on track to be one of ${Object.keys(TRACK_KINDS)}`);
|
|
1818
1839
|
continue;
|
|
@@ -1871,6 +1892,8 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1871
1892
|
}
|
|
1872
1893
|
}
|
|
1873
1894
|
|
|
1895
|
+
this._restoreAudioDescriptionPreference();
|
|
1896
|
+
|
|
1874
1897
|
await new Promise(resolve => {
|
|
1875
1898
|
const interval = setInterval(() => {
|
|
1876
1899
|
if (!this._media) return;
|
|
@@ -1947,7 +1970,8 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
1947
1970
|
return () => this.currentTime = time;
|
|
1948
1971
|
}
|
|
1949
1972
|
|
|
1950
|
-
_onTimeUpdate() {
|
|
1973
|
+
_onTimeUpdate(e) {
|
|
1974
|
+
this._onAudioDescriptionTimeUpdate(e.target.currentTime);
|
|
1951
1975
|
this.dispatchEvent(new CustomEvent('timeupdate'));
|
|
1952
1976
|
}
|
|
1953
1977
|
|
|
@@ -2044,6 +2068,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
2044
2068
|
}
|
|
2045
2069
|
|
|
2046
2070
|
_reloadSource() {
|
|
2071
|
+
this._cancelAudioDescription();
|
|
2047
2072
|
if (this._media) {
|
|
2048
2073
|
const oldSourceNode = this._media.getElementsByTagName('source')[0];
|
|
2049
2074
|
const updatedSource = this._getCurrentSource();
|
|
@@ -2089,7 +2114,7 @@ class MediaPlayer extends LocalizeLabsElement(RtlMixin(LitElement)) {
|
|
|
2089
2114
|
if (!this._media) {
|
|
2090
2115
|
return;
|
|
2091
2116
|
}
|
|
2092
|
-
const captionsMenu = this.shadowRoot.getElementById('
|
|
2117
|
+
const captionsMenu = this.shadowRoot.getElementById('captions-menu');
|
|
2093
2118
|
if (captionsMenu) {
|
|
2094
2119
|
this._captionsMenuReturnItem = captionsMenu.shadowRoot.querySelector('d2l-menu-item-return');
|
|
2095
2120
|
this._captionsMenuReturnItem?.setAttribute('text', this.localize('components:mediaPlayer:language'));
|