shaka-player 4.3.9 → 4.4.0
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/.github/workflows/build-and-test.yaml +11 -18
- package/.github/workflows/compute-incremental-coverage.py +3 -0
- package/.github/workflows/release-please.yaml +7 -0
- package/.github/workflows/selenium-lab-tests.yaml +45 -10
- package/AUTHORS +9 -0
- package/CHANGELOG.md +295 -190
- package/CONTRIBUTORS +8 -0
- package/LICENSE +32 -0
- package/README.md +63 -10
- package/demo/autoTemplate.txt +40 -5
- package/demo/close_button.js +11 -0
- package/demo/common/asset.js +13 -1
- package/demo/common/assets.js +112 -28
- package/demo/common/message_ids.js +25 -1
- package/demo/config.js +69 -10
- package/demo/customWarning.txt +2 -2
- package/demo/index.html +3 -1
- package/demo/locales/en.json +26 -2
- package/demo/locales/source.json +105 -9
- package/demo/main.js +57 -9
- package/demo/search.js +3 -1
- package/demo/service_worker.js +3 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +132 -118
- package/dist/demo.compiled.debug.map +3 -3
- package/dist/demo.compiled.js +132 -118
- package/dist/demo.compiled.map +3 -3
- package/dist/deps.js +46 -28
- package/dist/locales.js +31 -31
- package/dist/receiver.compiled.debug.js +60 -52
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +60 -52
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.d.ts +676 -391
- package/dist/shaka-player.compiled.debug.d.ts +676 -391
- package/dist/shaka-player.compiled.debug.externs.js +1188 -616
- package/dist/shaka-player.compiled.debug.js +1046 -700
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +1188 -616
- package/dist/shaka-player.compiled.js +1094 -933
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +677 -392
- package/dist/shaka-player.ui.debug.d.ts +677 -392
- package/dist/shaka-player.ui.debug.externs.js +1023 -451
- package/dist/shaka-player.ui.debug.js +1101 -738
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +1023 -451
- package/dist/shaka-player.ui.js +1244 -1071
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/ad_monetization.md +15 -1
- package/docs/tutorials/application-level-redirects.md +1 -1
- package/docs/tutorials/config.md +9 -5
- package/docs/tutorials/drm-config.md +61 -0
- package/docs/tutorials/fairplay.md +19 -4
- package/docs/tutorials/license-server-auth.md +4 -4
- package/docs/tutorials/license-wrapping.md +2 -2
- package/docs/tutorials/ui-customization.md +7 -3
- package/docs/tutorials/ui.md +7 -7
- package/docs/tutorials/upgrade.md +3 -0
- package/externs/ima.js +123 -2
- package/externs/isoboxer.js +217 -0
- package/externs/mediakeys.js +18 -0
- package/externs/mux.js +1 -105
- package/externs/pictureinpicture.js +48 -0
- package/externs/shaka/ads.js +61 -1
- package/externs/shaka/cea.js +110 -0
- package/externs/shaka/codecs.js +32 -0
- package/externs/shaka/manifest.js +101 -1
- package/externs/shaka/manifest_parser.js +0 -10
- package/externs/shaka/net.js +36 -7
- package/externs/shaka/offline.js +8 -1
- package/externs/shaka/player.js +220 -21
- package/externs/shaka/text.js +1 -382
- package/externs/shaka/transmuxer.js +59 -0
- package/karma.conf.js +15 -0
- package/lib/abr/simple_abr_manager.js +6 -3
- package/lib/ads/ad_manager.js +60 -2
- package/lib/ads/client_side_ad.js +86 -0
- package/lib/ads/client_side_ad_manager.js +93 -5
- package/lib/ads/server_side_ad.js +86 -0
- package/lib/ads/server_side_ad_manager.js +13 -0
- package/lib/cast/cast_utils.js +1 -0
- package/lib/cea/cea608_data_channel.js +24 -14
- package/lib/cea/cea608_memory.js +5 -2
- package/lib/cea/cea708_service.js +8 -9
- package/lib/cea/cea708_window.js +1 -2
- package/lib/cea/cea_decoder.js +23 -6
- package/lib/cea/cea_utils.js +25 -2
- package/lib/cea/dummy_caption_decoder.js +21 -0
- package/lib/cea/dummy_cea_parser.js +1 -3
- package/lib/cea/mp4_cea_parser.js +15 -10
- package/lib/cea/ts_cea_parser.js +69 -0
- package/lib/dash/content_protection.js +32 -2
- package/lib/dash/dash_parser.js +93 -31
- package/lib/dash/mpd_utils.js +6 -25
- package/lib/dash/segment_base.js +12 -14
- package/lib/dash/segment_list.js +10 -6
- package/lib/dash/segment_template.js +349 -32
- package/lib/dependencies/all.js +8 -0
- package/lib/hls/hls_classes.js +33 -8
- package/lib/hls/hls_parser.js +805 -191
- package/lib/hls/manifest_text_parser.js +4 -14
- package/lib/media/adaptation_set_criteria.js +43 -3
- package/lib/media/closed_caption_parser.js +74 -12
- package/lib/media/drm_engine.js +189 -49
- package/lib/media/gap_jumping_controller.js +1 -1
- package/lib/media/manifest_parser.js +34 -0
- package/lib/media/media_source_capabilities.js +10 -0
- package/lib/media/media_source_engine.js +475 -231
- package/lib/media/playhead.js +1 -1
- package/lib/media/presentation_timeline.js +62 -0
- package/lib/media/segment_index.js +50 -14
- package/lib/media/segment_prefetch.js +277 -0
- package/lib/media/segment_reference.js +70 -4
- package/lib/media/streaming_engine.js +258 -81
- package/lib/media/video_wrapper.js +15 -7
- package/lib/mss/content_protection.js +353 -0
- package/lib/mss/mss_parser.js +1081 -0
- package/lib/net/networking_engine.js +60 -10
- package/lib/offline/indexeddb/v1_storage_cell.js +1 -0
- package/lib/offline/indexeddb/v2_storage_cell.js +1 -0
- package/lib/offline/manifest_converter.js +6 -0
- package/lib/offline/storage.js +2 -4
- package/lib/player.js +309 -105
- package/lib/polyfill/media_capabilities.js +43 -3
- package/lib/polyfill/patchedmediakeys_apple.js +5 -0
- package/lib/polyfill/patchedmediakeys_nop.js +5 -0
- package/lib/polyfill/patchedmediakeys_webkit.js +5 -0
- package/lib/text/cue.js +208 -130
- package/lib/text/lrc_text_parser.js +2 -2
- package/lib/text/mp4_vtt_parser.js +2 -2
- package/lib/text/sbv_text_parser.js +1 -1
- package/lib/text/simple_text_displayer.js +2 -1
- package/lib/text/srt_text_parser.js +9 -1
- package/lib/text/ssa_text_parser.js +2 -2
- package/lib/text/text_engine.js +3 -21
- package/lib/text/text_utils.js +71 -20
- package/lib/text/ui_text_displayer.js +14 -14
- package/lib/text/vtt_text_parser.js +22 -14
- package/lib/transmuxer/aac_transmuxer.js +224 -0
- package/lib/transmuxer/ac3.js +142 -0
- package/lib/transmuxer/ac3_transmuxer.js +212 -0
- package/lib/transmuxer/adts.js +232 -0
- package/lib/transmuxer/ec3.js +103 -0
- package/lib/transmuxer/ec3_transmuxer.js +212 -0
- package/lib/transmuxer/h264.js +324 -0
- package/lib/transmuxer/mp3_transmuxer.js +204 -0
- package/lib/transmuxer/mpeg_audio.js +196 -0
- package/lib/transmuxer/mpeg_ts_transmuxer.js +182 -0
- package/lib/transmuxer/mss_transmuxer.js +389 -0
- package/lib/{media/transmuxer.js → transmuxer/muxjs_transmuxer.js} +34 -80
- package/lib/transmuxer/transmuxer_engine.js +161 -0
- package/lib/transmuxer/ts_transmuxer.js +738 -0
- package/lib/util/cmcd_manager.js +131 -71
- package/lib/util/error.js +62 -26
- package/lib/util/exp_golomb.js +220 -0
- package/lib/util/fairplay_utils.js +64 -13
- package/lib/util/id3_utils.js +56 -3
- package/lib/util/language_utils.js +11 -8
- package/lib/util/manifest_parser_utils.js +3 -0
- package/lib/util/mime_utils.js +44 -7
- package/lib/util/mp4_box_parsers.js +233 -5
- package/lib/util/mp4_generator.js +1381 -0
- package/lib/util/periods.js +40 -34
- package/lib/util/platform.js +25 -3
- package/lib/util/player_configuration.js +38 -1
- package/lib/util/stream_utils.js +138 -27
- package/lib/util/text_parser.js +1 -1
- package/lib/util/ts_parser.js +470 -47
- package/lib/util/xml_utils.js +16 -3
- package/maintained-branches.md +2 -2
- package/package.json +4 -2
- package/roadmap.md +21 -6
- package/shaka-player.uncompiled.js +18 -0
- package/test/abr/simple_abr_manager_unit.js +32 -4
- package/test/ads/ad_manager_unit.js +18 -2
- package/test/cast/cast_utils_unit.js +7 -2
- package/test/cea/cea608_memory_unit.js +24 -0
- package/test/cea/cea_decoder_unit.js +33 -0
- package/test/dash/dash_parser_content_protection_unit.js +93 -3
- package/test/dash/dash_parser_live_unit.js +56 -13
- package/test/dash/dash_parser_manifest_unit.js +70 -2
- package/test/dash/dash_parser_segment_base_unit.js +14 -9
- package/test/dash/dash_parser_segment_template_unit.js +286 -6
- package/test/demo/demo_unit.js +5 -1
- package/test/hls/hls_live_unit.js +188 -28
- package/test/hls/hls_parser_unit.js +250 -109
- package/test/hls/manifest_text_parser_unit.js +18 -13
- package/test/media/adaptation_set_criteria_unit.js +46 -14
- package/test/media/adaptation_set_unit.js +2 -0
- package/test/media/drm_engine_integration.js +11 -8
- package/test/media/drm_engine_unit.js +220 -7
- package/test/media/media_source_engine_integration.js +122 -38
- package/test/media/media_source_engine_unit.js +133 -153
- package/test/media/playhead_unit.js +3 -0
- package/test/media/presentation_timeline_unit.js +51 -0
- package/test/media/segment_index_unit.js +52 -0
- package/test/media/segment_prefetch_unit.js +243 -0
- package/test/media/streaming_engine_integration.js +9 -3
- package/test/media/streaming_engine_unit.js +440 -59
- package/test/mss/mss_parser_content_protection_unit.js +49 -0
- package/test/mss/mss_parser_unit.js +472 -0
- package/test/mss/mss_player_integration.js +123 -0
- package/test/offline/manifest_convert_unit.js +9 -0
- package/test/offline/storage_integration.js +6 -1
- package/test/player_integration.js +4 -1
- package/test/player_unit.js +386 -133
- package/test/polyfill/media_capabilities_unit.js +18 -0
- package/test/test/assets/hls-raw-aac/fileSequence0.aac +0 -0
- package/test/test/assets/hls-raw-aac/fileSequence1.aac +0 -0
- package/test/test/assets/hls-raw-aac/fileSequence2.aac +0 -0
- package/test/test/assets/hls-raw-aac/fileSequence3.aac +0 -0
- package/test/test/assets/hls-raw-aac/manifest.m3u8 +4 -0
- package/test/test/assets/hls-raw-aac/stream.m4a.m3u8 +14 -0
- package/test/test/assets/hls-raw-ac3/fileSequence0.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence1.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence2.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence3.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence4.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence5.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence6.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/fileSequence7.ac3 +0 -0
- package/test/test/assets/hls-raw-ac3/prog_index.m3u8 +31 -0
- package/test/test/assets/hls-raw-ec3/fileSequence0.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence1.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence2.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence3.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence4.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence5.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence6.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/fileSequence7.ec3 +0 -0
- package/test/test/assets/hls-raw-ec3/prog_index.m3u8 +31 -0
- package/test/test/assets/hls-raw-mp3/chunklist_w905519204.m3u8 +13 -0
- package/test/test/assets/hls-raw-mp3/media_w905519204_0.mp3 +0 -0
- package/test/test/assets/hls-raw-mp3/media_w905519204_1.mp3 +0 -0
- package/test/test/assets/hls-raw-mp3/media_w905519204_2.mp3 +0 -0
- package/test/test/assets/hls-raw-mp3/media_w905519204_3.mp3 +0 -0
- package/test/test/assets/hls-raw-mp3/playlist.m3u8 +4 -0
- package/test/test/assets/hls-ts-aac/playlist.m3u8 +23 -0
- package/test/test/assets/hls-ts-aac/segment_0.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_1.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_2.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_3.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_4.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_5.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_6.ts +0 -0
- package/test/test/assets/hls-ts-aac/segment_7.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0000.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0001.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0002.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0003.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0004.ts +0 -0
- package/test/test/assets/hls-ts-ac3/ChID_voices_6ch_640kbps_dd_sub_0005.ts +0 -0
- package/test/test/assets/hls-ts-ac3/prog_index.m3u8 +19 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0000.ts +0 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0001.ts +0 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0002.ts +0 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0003.ts +0 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0004.ts +0 -0
- package/test/test/assets/hls-ts-ec3/ChID_voices_6ch_256kbps_ddp_sub_0005.ts +0 -0
- package/test/test/assets/hls-ts-ec3/prog_index.m3u8 +19 -0
- package/test/test/assets/hls-ts-h264/fileSequence0.ts +0 -0
- package/test/test/assets/hls-ts-h264/fileSequence1.ts +0 -0
- package/test/test/assets/hls-ts-h264/fileSequence2.ts +0 -0
- package/test/test/assets/hls-ts-h264/fileSequence3.ts +0 -0
- package/test/test/assets/hls-ts-h264/fileSequence4.ts +0 -0
- package/test/test/assets/hls-ts-h264/fileSequence5.ts +0 -0
- package/test/test/assets/hls-ts-h264/prog_index.m3u8 +25 -0
- package/test/test/assets/hls-ts-mp3/manifest.m3u8 +13 -0
- package/test/test/assets/hls-ts-mp3/media_w239891843_0.ts +0 -0
- package/test/test/assets/hls-ts-mp3/media_w239891843_1.ts +0 -0
- package/test/test/assets/hls-ts-mp3/media_w239891843_2.ts +0 -0
- package/test/test/assets/hls-ts-mp3/media_w239891843_3.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/chunk.m3u8 +17 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_0_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_1_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_2_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_3_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_4_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/n_5_0_0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h264/playlist.m3u8 +4 -0
- package/test/test/boot.js +7 -2
- package/test/test/util/fake_ad.js +99 -0
- package/test/test/util/fake_ad_manager.js +7 -1
- package/test/test/util/fake_networking_engine.js +41 -14
- package/test/test/util/fake_segment_prefetch.js +81 -0
- package/test/test/util/manifest_generator.js +19 -5
- package/test/test/util/mss_parser_util.js +115 -0
- package/test/test/util/offline_utils.js +1 -0
- package/test/test/util/simple_fakes.js +12 -3
- package/test/test/util/streaming_engine_util.js +14 -4
- package/test/test/util/ttml_utils.js +2 -2
- package/test/test/util/ui_utils.js +5 -1
- package/test/text/cue_integration.js +1 -1
- package/test/text/srt_text_parser_unit.js +78 -0
- package/test/text/text_engine_unit.js +17 -8
- package/test/text/ui_text_displayer_unit.js +4 -4
- package/test/text/vtt_text_parser_unit.js +59 -40
- package/test/text/web_vtt_generator_unit.js +9 -3
- package/test/{media/transmuxer_integration.js → transmuxer/muxjs_transmuxer_integration.js} +30 -33
- package/test/transmuxer/transmuxer_engine_integration.js +60 -0
- package/test/transmuxer/transmuxer_integration.js +296 -0
- package/test/util/cmcd_manager_unit.js +162 -13
- package/test/util/language_utils_unit.js +9 -2
- package/test/util/mp4_box_parsers_unit.js +39 -4
- package/test/util/periods_unit.js +34 -26
- package/test/util/stream_utils_unit.js +60 -107
- package/ui/controls.js +19 -1
- package/ui/controls.less +1 -0
- package/ui/externs/ui.js +13 -3
- package/ui/language_utils.js +15 -0
- package/ui/less/thumbnails.less +26 -0
- package/ui/locales/oc.json +42 -0
- package/ui/pip_button.js +83 -2
- package/ui/range_element.js +15 -0
- package/ui/resolution_selection.js +9 -2
- package/ui/seek_bar.js +230 -1
- package/ui/ui.js +5 -0
- package/lib/cea/i_caption_decoder.js +0 -51
- package/lib/cea/i_cea_parser.js +0 -68
|
@@ -216,10 +216,27 @@ shaka.polyfill.MediaCapabilities = class {
|
|
|
216
216
|
mediaKeySystemConfig.videoCapabilities = videoCapabilities;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
const cacheKey = shaka.polyfill.MediaCapabilities
|
|
220
|
+
.generateKeySystemCacheKey_(
|
|
221
|
+
mediaDecodingConfig.video ?
|
|
222
|
+
mediaDecodingConfig.video.contentType : '',
|
|
223
|
+
mediaDecodingConfig.audio ?
|
|
224
|
+
mediaDecodingConfig.audio.contentType : '',
|
|
225
|
+
mediaDecodingConfig.keySystemConfiguration.keySystem);
|
|
226
|
+
|
|
219
227
|
let keySystemAccess;
|
|
220
228
|
try {
|
|
221
|
-
|
|
222
|
-
|
|
229
|
+
if (cacheKey in shaka.polyfill.MediaCapabilities
|
|
230
|
+
.memoizedMediaKeySystemAccessRequests_) {
|
|
231
|
+
keySystemAccess = shaka.polyfill.MediaCapabilities
|
|
232
|
+
.memoizedMediaKeySystemAccessRequests_[cacheKey];
|
|
233
|
+
} else {
|
|
234
|
+
keySystemAccess = await navigator.requestMediaKeySystemAccess(
|
|
235
|
+
mediaCapkeySystemConfig.keySystem, [mediaKeySystemConfig]);
|
|
236
|
+
shaka.polyfill.MediaCapabilities
|
|
237
|
+
.memoizedMediaKeySystemAccessRequests_[cacheKey] =
|
|
238
|
+
keySystemAccess;
|
|
239
|
+
}
|
|
223
240
|
} catch (e) {
|
|
224
241
|
shaka.log.info('navigator.requestMediaKeySystemAccess failed.');
|
|
225
242
|
}
|
|
@@ -265,11 +282,24 @@ shaka.polyfill.MediaCapabilities = class {
|
|
|
265
282
|
}
|
|
266
283
|
return cast.__platform__.canDisplayType(displayType);
|
|
267
284
|
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* A method for generating a key for the MediaKeySystemAccessRequests cache.
|
|
288
|
+
*
|
|
289
|
+
* @param {!string} videoCodec
|
|
290
|
+
* @param {!string} audioCodec
|
|
291
|
+
* @param {!string} keySystem
|
|
292
|
+
* @return {!string}
|
|
293
|
+
* @private
|
|
294
|
+
*/
|
|
295
|
+
static generateKeySystemCacheKey_(videoCodec, audioCodec, keySystem) {
|
|
296
|
+
return `${videoCodec}#${audioCodec}#${keySystem}`;
|
|
297
|
+
}
|
|
268
298
|
};
|
|
269
299
|
|
|
270
300
|
/**
|
|
271
301
|
* A copy of the MediaCapabilities instance, to prevent Safari from
|
|
272
|
-
* garbage-collecting the polyfilled method on it.
|
|
302
|
+
* garbage-collecting the polyfilled method on it. We make it public and export
|
|
273
303
|
* it to ensure that it is not stripped out by the compiler.
|
|
274
304
|
*
|
|
275
305
|
* @type {MediaCapabilities}
|
|
@@ -277,6 +307,16 @@ shaka.polyfill.MediaCapabilities = class {
|
|
|
277
307
|
*/
|
|
278
308
|
shaka.polyfill.MediaCapabilities.originalMcap = null;
|
|
279
309
|
|
|
310
|
+
/**
|
|
311
|
+
* A cache that stores the MediaKeySystemAccess result of calling
|
|
312
|
+
* `navigator.requestMediaKeySystemAccess` by a key combination of
|
|
313
|
+
* video/audio codec and key system string.
|
|
314
|
+
*
|
|
315
|
+
* @type {(Object<(!string), (!MediaKeySystemAccess)>)}
|
|
316
|
+
* @export
|
|
317
|
+
*/
|
|
318
|
+
shaka.polyfill.MediaCapabilities.memoizedMediaKeySystemAccessRequests_ = {};
|
|
319
|
+
|
|
280
320
|
// Install at a lower priority than MediaSource polyfill, so that we have
|
|
281
321
|
// MediaSource available first.
|
|
282
322
|
shaka.polyfill.register(shaka.polyfill.MediaCapabilities.install, -1);
|
|
@@ -417,6 +417,11 @@ shaka.polyfill.PatchedMediaKeysWebkit.MediaKeys = class {
|
|
|
417
417
|
return Promise.resolve(false);
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
+
/** @override */
|
|
421
|
+
getStatusForPolicy(policy) {
|
|
422
|
+
return Promise.resolve('usable');
|
|
423
|
+
}
|
|
424
|
+
|
|
420
425
|
/**
|
|
421
426
|
* @param {!MediaKeyEvent} event
|
|
422
427
|
* @suppress {constantProperty} We reassign what would be const on a real
|
package/lib/text/cue.js
CHANGED
|
@@ -11,7 +11,6 @@ goog.require('shaka.util.ArrayUtils');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @implements {shaka.extern.Cue}
|
|
15
14
|
* @export
|
|
16
15
|
*/
|
|
17
16
|
shaka.text.Cue = class {
|
|
@@ -24,220 +23,281 @@ shaka.text.Cue = class {
|
|
|
24
23
|
const Cue = shaka.text.Cue;
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* The start time of the cue in seconds, relative to the start of the
|
|
27
|
+
* presentation.
|
|
28
|
+
* @type {number}
|
|
29
|
+
* @exportDoc
|
|
29
30
|
*/
|
|
30
31
|
this.startTime = startTime;
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @override
|
|
40
|
-
* @exportInterface
|
|
34
|
+
* The end time of the cue in seconds, relative to the start of the
|
|
35
|
+
* presentation.
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @exportDoc
|
|
41
38
|
*/
|
|
42
39
|
this.endTime = endTime;
|
|
43
40
|
|
|
44
41
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
42
|
+
* The text payload of the cue. If nestedCues is non-empty, this should be
|
|
43
|
+
* empty. Top-level block containers should have no payload of their own.
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @exportDoc
|
|
47
46
|
*/
|
|
48
47
|
this.payload = payload;
|
|
49
48
|
|
|
50
49
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* The region to render the cue into. Only supported on top-level cues,
|
|
51
|
+
* because nested cues are inline elements.
|
|
52
|
+
* @type {shaka.text.CueRegion}
|
|
53
|
+
* @exportDoc
|
|
53
54
|
*/
|
|
54
55
|
this.region = new shaka.text.CueRegion();
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
58
|
+
* The indent (in percent) of the cue box in the direction defined by the
|
|
59
|
+
* writing direction.
|
|
60
|
+
* @type {?number}
|
|
61
|
+
* @exportDoc
|
|
59
62
|
*/
|
|
60
63
|
this.position = null;
|
|
61
64
|
|
|
62
65
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @
|
|
66
|
+
* Position alignment of the cue.
|
|
67
|
+
* @type {shaka.text.Cue.positionAlign}
|
|
68
|
+
* @exportDoc
|
|
65
69
|
*/
|
|
66
70
|
this.positionAlign = Cue.positionAlign.AUTO;
|
|
67
71
|
|
|
68
72
|
/**
|
|
69
|
-
*
|
|
70
|
-
* @
|
|
73
|
+
* Size of the cue box (in percents), where 0 means "auto".
|
|
74
|
+
* @type {number}
|
|
75
|
+
* @exportDoc
|
|
71
76
|
*/
|
|
72
77
|
this.size = 0;
|
|
73
78
|
|
|
74
79
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @
|
|
80
|
+
* Alignment of the text inside the cue box.
|
|
81
|
+
* @type {shaka.text.Cue.textAlign}
|
|
82
|
+
* @exportDoc
|
|
77
83
|
*/
|
|
78
84
|
this.textAlign = Cue.textAlign.CENTER;
|
|
79
85
|
|
|
80
86
|
/**
|
|
81
|
-
*
|
|
82
|
-
* @
|
|
87
|
+
* Text direction of the cue.
|
|
88
|
+
* @type {shaka.text.Cue.direction}
|
|
89
|
+
* @exportDoc
|
|
90
|
+
*/
|
|
91
|
+
this.direction = Cue.direction.HORIZONTAL_LEFT_TO_RIGHT;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Text writing mode of the cue.
|
|
95
|
+
* @type {shaka.text.Cue.writingMode}
|
|
96
|
+
* @exportDoc
|
|
83
97
|
*/
|
|
84
98
|
this.writingMode = Cue.writingMode.HORIZONTAL_TOP_TO_BOTTOM;
|
|
85
99
|
|
|
86
100
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
101
|
+
* The way to interpret line field. (Either as an integer line number or
|
|
102
|
+
* percentage from the display box).
|
|
103
|
+
* @type {shaka.text.Cue.lineInterpretation}
|
|
104
|
+
* @exportDoc
|
|
89
105
|
*/
|
|
90
106
|
this.lineInterpretation = Cue.lineInterpretation.LINE_NUMBER;
|
|
91
107
|
|
|
92
108
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
109
|
+
* The offset from the display box in either number of lines or
|
|
110
|
+
* percentage depending on the value of lineInterpretation.
|
|
111
|
+
* @type {?number}
|
|
112
|
+
* @exportDoc
|
|
95
113
|
*/
|
|
96
114
|
this.line = null;
|
|
97
115
|
|
|
98
116
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
117
|
+
* Separation between line areas inside the cue box in px or em
|
|
118
|
+
* (e.g. '100px'/'100em'). If not specified, this should be no less than
|
|
119
|
+
* the largest font size applied to the text in the cue.
|
|
120
|
+
* @type {string}.
|
|
121
|
+
* @exportDoc
|
|
101
122
|
*/
|
|
102
123
|
this.lineHeight = '';
|
|
103
124
|
|
|
104
125
|
/**
|
|
105
|
-
* Line
|
|
106
|
-
*
|
|
107
|
-
*
|
|
126
|
+
* Line alignment of the cue box.
|
|
127
|
+
* Start alignment means the cue box’s top side (for horizontal cues), left
|
|
128
|
+
* side (for vertical growing right), or right side (for vertical growing
|
|
129
|
+
* left) is aligned at the line.
|
|
130
|
+
* Center alignment means the cue box is centered at the line.
|
|
131
|
+
* End alignment The cue box’s bottom side (for horizontal cues), right side
|
|
132
|
+
* (for vertical growing right), or left side (for vertical growing left) is
|
|
133
|
+
* aligned at the line.
|
|
134
|
+
* @type {shaka.text.Cue.lineAlign}
|
|
135
|
+
* @exportDoc
|
|
108
136
|
*/
|
|
109
137
|
this.lineAlign = Cue.lineAlign.START;
|
|
110
138
|
|
|
111
139
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
140
|
+
* Vertical alignments of the cues within their extents.
|
|
141
|
+
* 'BEFORE' means displaying the captions at the top of the text display
|
|
142
|
+
* container box, 'CENTER' means in the middle, 'AFTER' means at the bottom.
|
|
143
|
+
* @type {shaka.text.Cue.displayAlign}
|
|
144
|
+
* @exportDoc
|
|
115
145
|
*/
|
|
116
146
|
this.displayAlign = Cue.displayAlign.AFTER;
|
|
117
147
|
|
|
118
148
|
/**
|
|
119
|
-
*
|
|
120
|
-
* @
|
|
149
|
+
* Text color as a CSS color, e.g. "#FFFFFF" or "white".
|
|
150
|
+
* @type {string}
|
|
151
|
+
* @exportDoc
|
|
121
152
|
*/
|
|
122
153
|
this.color = '';
|
|
123
154
|
|
|
124
155
|
/**
|
|
125
|
-
*
|
|
126
|
-
* @
|
|
156
|
+
* Text background color as a CSS color, e.g. "#FFFFFF" or "white".
|
|
157
|
+
* @type {string}
|
|
158
|
+
* @exportDoc
|
|
127
159
|
*/
|
|
128
160
|
this.backgroundColor = '';
|
|
129
161
|
|
|
130
162
|
/**
|
|
131
|
-
*
|
|
132
|
-
* @
|
|
163
|
+
* The URL of the background image, e.g. "data:[mime type];base64,[data]".
|
|
164
|
+
* @type {string}
|
|
165
|
+
* @exportDoc
|
|
133
166
|
*/
|
|
134
167
|
this.backgroundImage = '';
|
|
135
168
|
|
|
136
169
|
/**
|
|
137
|
-
*
|
|
138
|
-
* @
|
|
170
|
+
* The border around this cue as a CSS border.
|
|
171
|
+
* @type {string}
|
|
172
|
+
* @exportDoc
|
|
139
173
|
*/
|
|
140
174
|
this.border = '';
|
|
141
175
|
|
|
142
176
|
/**
|
|
143
|
-
*
|
|
144
|
-
* @
|
|
177
|
+
* Text font size in px or em (e.g. '100px'/'100em').
|
|
178
|
+
* @type {string}
|
|
179
|
+
* @exportDoc
|
|
145
180
|
*/
|
|
146
|
-
this.
|
|
181
|
+
this.fontSize = '';
|
|
147
182
|
|
|
148
183
|
/**
|
|
149
|
-
*
|
|
150
|
-
* @
|
|
184
|
+
* Text font weight. Either normal or bold.
|
|
185
|
+
* @type {shaka.text.Cue.fontWeight}
|
|
186
|
+
* @exportDoc
|
|
151
187
|
*/
|
|
152
|
-
this.
|
|
188
|
+
this.fontWeight = Cue.fontWeight.NORMAL;
|
|
153
189
|
|
|
154
190
|
/**
|
|
155
|
-
*
|
|
156
|
-
* @
|
|
191
|
+
* Text font style. Normal, italic or oblique.
|
|
192
|
+
* @type {shaka.text.Cue.fontStyle}
|
|
193
|
+
* @exportDoc
|
|
157
194
|
*/
|
|
158
|
-
this.
|
|
195
|
+
this.fontStyle = Cue.fontStyle.NORMAL;
|
|
159
196
|
|
|
160
197
|
/**
|
|
161
|
-
*
|
|
162
|
-
* @
|
|
198
|
+
* Text font family.
|
|
199
|
+
* @type {string}
|
|
200
|
+
* @exportDoc
|
|
163
201
|
*/
|
|
164
|
-
this.
|
|
202
|
+
this.fontFamily = '';
|
|
165
203
|
|
|
166
204
|
/**
|
|
167
|
-
*
|
|
168
|
-
* @
|
|
205
|
+
* Text letter spacing as a CSS letter-spacing value.
|
|
206
|
+
* @type {string}
|
|
207
|
+
* @exportDoc
|
|
169
208
|
*/
|
|
170
|
-
this.
|
|
209
|
+
this.letterSpacing = '';
|
|
171
210
|
|
|
172
211
|
/**
|
|
173
|
-
*
|
|
174
|
-
* @
|
|
212
|
+
* Text line padding as a CSS line-padding value.
|
|
213
|
+
* @type {string}
|
|
214
|
+
* @exportDoc
|
|
175
215
|
*/
|
|
176
|
-
this.
|
|
216
|
+
this.linePadding = '';
|
|
177
217
|
|
|
178
218
|
/**
|
|
179
|
-
*
|
|
180
|
-
* @
|
|
219
|
+
* Opacity of the cue element, from 0-1.
|
|
220
|
+
* @type {number}
|
|
221
|
+
* @exportDoc
|
|
181
222
|
*/
|
|
182
|
-
this.
|
|
223
|
+
this.opacity = 1;
|
|
183
224
|
|
|
184
225
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
226
|
+
* Text decoration. A combination of underline, overline
|
|
227
|
+
* and line through. Empty array means no decoration.
|
|
228
|
+
* @type {!Array.<!shaka.text.Cue.textDecoration>}
|
|
229
|
+
* @exportDoc
|
|
187
230
|
*/
|
|
188
|
-
this.
|
|
231
|
+
this.textDecoration = [];
|
|
189
232
|
|
|
190
233
|
/**
|
|
191
|
-
*
|
|
192
|
-
* @
|
|
234
|
+
* Text shadow color as a CSS text-shadow value.
|
|
235
|
+
* @type {string}
|
|
236
|
+
* @exportDoc
|
|
193
237
|
*/
|
|
194
|
-
this.
|
|
238
|
+
this.textShadow = '';
|
|
195
239
|
|
|
196
240
|
/**
|
|
197
|
-
*
|
|
198
|
-
* @
|
|
241
|
+
* Text stroke color as a CSS color, e.g. "#FFFFFF" or "white".
|
|
242
|
+
* @type {string}
|
|
243
|
+
* @exportDoc
|
|
199
244
|
*/
|
|
200
|
-
this.
|
|
245
|
+
this.textStrokeColor = '';
|
|
201
246
|
|
|
202
247
|
/**
|
|
203
|
-
*
|
|
204
|
-
* @
|
|
248
|
+
* Text stroke width as a CSS stroke-width value.
|
|
249
|
+
* @type {string}
|
|
250
|
+
* @exportDoc
|
|
205
251
|
*/
|
|
206
|
-
this.
|
|
252
|
+
this.textStrokeWidth = '';
|
|
207
253
|
|
|
208
254
|
/**
|
|
209
|
-
*
|
|
210
|
-
* @
|
|
255
|
+
* Whether or not line wrapping should be applied to the cue.
|
|
256
|
+
* @type {boolean}
|
|
257
|
+
* @exportDoc
|
|
211
258
|
*/
|
|
212
259
|
this.wrapLine = true;
|
|
213
260
|
|
|
214
261
|
/**
|
|
215
|
-
*
|
|
216
|
-
* @
|
|
262
|
+
* Id of the cue.
|
|
263
|
+
* @type {string}
|
|
264
|
+
* @exportDoc
|
|
217
265
|
*/
|
|
218
266
|
this.id = '';
|
|
219
267
|
|
|
220
268
|
/**
|
|
221
|
-
*
|
|
222
|
-
*
|
|
269
|
+
* Nested cues, which should be laid out horizontally in one block.
|
|
270
|
+
* Top-level cues are blocks, and nested cues are inline elements.
|
|
271
|
+
* Cues can be nested arbitrarily deeply.
|
|
272
|
+
* @type {!Array.<!shaka.text.Cue>}
|
|
273
|
+
* @exportDoc
|
|
223
274
|
*/
|
|
224
275
|
this.nestedCues = [];
|
|
225
276
|
|
|
226
277
|
/**
|
|
227
|
-
*
|
|
228
|
-
*
|
|
278
|
+
* If true, this represents a container element that is "above" the main
|
|
279
|
+
* cues. For example, the <body> and <div> tags that contain the <p> tags
|
|
280
|
+
* in a TTML file. This controls the flow of the final cues; any nested cues
|
|
281
|
+
* within an "isContainer" cue will be laid out as separate lines.
|
|
282
|
+
* @type {boolean}
|
|
283
|
+
* @exportDoc
|
|
229
284
|
*/
|
|
230
285
|
this.isContainer = false;
|
|
231
286
|
|
|
232
287
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
288
|
+
* Whether or not the cue only acts as a line break between two nested cues.
|
|
289
|
+
* Should only appear in nested cues.
|
|
290
|
+
* @type {boolean}
|
|
291
|
+
* @exportDoc
|
|
235
292
|
*/
|
|
236
293
|
this.lineBreak = false;
|
|
237
294
|
|
|
238
295
|
/**
|
|
239
|
-
*
|
|
240
|
-
*
|
|
296
|
+
* The number of horizontal and vertical cells into which the Root Container
|
|
297
|
+
* Region area is divided.
|
|
298
|
+
*
|
|
299
|
+
* @type {{ columns: number, rows: number }}
|
|
300
|
+
* @exportDoc
|
|
241
301
|
*/
|
|
242
302
|
this.cellResolution = {
|
|
243
303
|
columns: 32,
|
|
@@ -260,6 +320,7 @@ shaka.text.Cue = class {
|
|
|
260
320
|
* Create a copy of the cue with the same properties.
|
|
261
321
|
* @return {!shaka.text.Cue}
|
|
262
322
|
* @suppress {checkTypes} since we must use [] and "in" with a struct type.
|
|
323
|
+
* @export
|
|
263
324
|
*/
|
|
264
325
|
clone() {
|
|
265
326
|
const clone = new shaka.text.Cue(0, 0, '');
|
|
@@ -284,6 +345,7 @@ shaka.text.Cue = class {
|
|
|
284
345
|
* @param {!shaka.text.Cue} cue2
|
|
285
346
|
* @return {boolean}
|
|
286
347
|
* @suppress {checkTypes} since we must use [] and "in" with a struct type.
|
|
348
|
+
* @export
|
|
287
349
|
*/
|
|
288
350
|
static equal(cue1, cue2) {
|
|
289
351
|
// Compare the start time, end time and payload of the cues first for
|
|
@@ -415,14 +477,14 @@ shaka.text.Cue.lineAlign = {
|
|
|
415
477
|
* @export
|
|
416
478
|
*/
|
|
417
479
|
shaka.text.Cue.defaultTextColor = {
|
|
418
|
-
'white': '
|
|
419
|
-
'lime': '
|
|
420
|
-
'cyan': '
|
|
421
|
-
'red': '
|
|
422
|
-
'yellow': '
|
|
423
|
-
'magenta': '
|
|
424
|
-
'blue': '
|
|
425
|
-
'black': '
|
|
480
|
+
'white': 'white',
|
|
481
|
+
'lime': 'lime',
|
|
482
|
+
'cyan': 'cyan',
|
|
483
|
+
'red': 'red',
|
|
484
|
+
'yellow': 'yellow',
|
|
485
|
+
'magenta': 'magenta',
|
|
486
|
+
'blue': 'blue',
|
|
487
|
+
'black': 'black',
|
|
426
488
|
};
|
|
427
489
|
|
|
428
490
|
|
|
@@ -433,14 +495,14 @@ shaka.text.Cue.defaultTextColor = {
|
|
|
433
495
|
* @export
|
|
434
496
|
*/
|
|
435
497
|
shaka.text.Cue.defaultTextBackgroundColor = {
|
|
436
|
-
'bg_white': '
|
|
437
|
-
'bg_lime': '
|
|
438
|
-
'bg_cyan': '
|
|
439
|
-
'bg_red': '
|
|
440
|
-
'bg_yellow': '
|
|
441
|
-
'bg_magenta': '
|
|
442
|
-
'bg_blue': '
|
|
443
|
-
'bg_black': '
|
|
498
|
+
'bg_white': 'white',
|
|
499
|
+
'bg_lime': 'lime',
|
|
500
|
+
'bg_cyan': 'cyan',
|
|
501
|
+
'bg_red': 'red',
|
|
502
|
+
'bg_yellow': 'yellow',
|
|
503
|
+
'bg_magenta': 'magenta',
|
|
504
|
+
'bg_blue': 'blue',
|
|
505
|
+
'bg_black': 'black',
|
|
444
506
|
};
|
|
445
507
|
|
|
446
508
|
|
|
@@ -479,8 +541,6 @@ shaka.text.Cue.textDecoration = {
|
|
|
479
541
|
|
|
480
542
|
|
|
481
543
|
/**
|
|
482
|
-
* @implements {shaka.extern.CueRegion}
|
|
483
|
-
* @struct
|
|
484
544
|
* @export
|
|
485
545
|
*/
|
|
486
546
|
shaka.text.CueRegion = class {
|
|
@@ -489,68 +549,86 @@ shaka.text.CueRegion = class {
|
|
|
489
549
|
const CueRegion = shaka.text.CueRegion;
|
|
490
550
|
|
|
491
551
|
/**
|
|
492
|
-
*
|
|
493
|
-
* @
|
|
552
|
+
* Region identifier.
|
|
553
|
+
* @type {string}
|
|
554
|
+
* @exportDoc
|
|
494
555
|
*/
|
|
495
556
|
this.id = '';
|
|
496
557
|
|
|
497
558
|
/**
|
|
498
|
-
*
|
|
499
|
-
*
|
|
559
|
+
* The X offset to start the rendering area in viewportAnchorUnits of the
|
|
560
|
+
* video width.
|
|
561
|
+
* @type {number}
|
|
562
|
+
* @exportDoc
|
|
500
563
|
*/
|
|
501
564
|
this.viewportAnchorX = 0;
|
|
502
565
|
|
|
503
566
|
/**
|
|
504
|
-
*
|
|
505
|
-
*
|
|
567
|
+
* The X offset to start the rendering area in viewportAnchorUnits of the
|
|
568
|
+
* video height.
|
|
569
|
+
* @type {number}
|
|
570
|
+
* @exportDoc
|
|
506
571
|
*/
|
|
507
572
|
this.viewportAnchorY = 0;
|
|
508
573
|
|
|
509
574
|
/**
|
|
510
|
-
*
|
|
511
|
-
*
|
|
575
|
+
* The X offset to start the rendering area in percentage (0-100) of this
|
|
576
|
+
* region width.
|
|
577
|
+
* @type {number}
|
|
578
|
+
* @exportDoc
|
|
512
579
|
*/
|
|
513
580
|
this.regionAnchorX = 0;
|
|
514
581
|
|
|
515
582
|
/**
|
|
516
|
-
*
|
|
517
|
-
*
|
|
583
|
+
* The Y offset to start the rendering area in percentage (0-100) of the
|
|
584
|
+
* region height.
|
|
585
|
+
* @type {number}
|
|
586
|
+
* @exportDoc
|
|
518
587
|
*/
|
|
519
588
|
this.regionAnchorY = 0;
|
|
520
589
|
|
|
521
590
|
/**
|
|
522
|
-
*
|
|
523
|
-
* @
|
|
591
|
+
* The width of the rendering area in widthUnits.
|
|
592
|
+
* @type {number}
|
|
593
|
+
* @exportDoc
|
|
524
594
|
*/
|
|
525
595
|
this.width = 100;
|
|
526
596
|
|
|
527
597
|
/**
|
|
528
|
-
*
|
|
529
|
-
* @
|
|
598
|
+
* The width of the rendering area in heightUnits.
|
|
599
|
+
* @type {number}
|
|
600
|
+
* @exportDoc
|
|
530
601
|
*/
|
|
531
602
|
this.height = 100;
|
|
532
603
|
|
|
533
604
|
/**
|
|
534
|
-
*
|
|
535
|
-
* @
|
|
605
|
+
* The units (percentage, pixels or lines) the region height is in.
|
|
606
|
+
* @type {shaka.text.CueRegion.units}
|
|
607
|
+
* @exportDoc
|
|
536
608
|
*/
|
|
537
609
|
this.heightUnits = CueRegion.units.PERCENTAGE;
|
|
538
610
|
|
|
539
611
|
/**
|
|
540
|
-
*
|
|
541
|
-
* @
|
|
612
|
+
* The units (percentage or pixels) the region width is in.
|
|
613
|
+
* @type {shaka.text.CueRegion.units}
|
|
614
|
+
* @exportDoc
|
|
542
615
|
*/
|
|
543
616
|
this.widthUnits = CueRegion.units.PERCENTAGE;
|
|
544
617
|
|
|
545
618
|
/**
|
|
546
|
-
*
|
|
547
|
-
* @
|
|
619
|
+
* The units (percentage or pixels) the region viewportAnchors are in.
|
|
620
|
+
* @type {shaka.text.CueRegion.units}
|
|
621
|
+
* @exportDoc
|
|
548
622
|
*/
|
|
549
623
|
this.viewportAnchorUnits = CueRegion.units.PERCENTAGE;
|
|
550
624
|
|
|
551
625
|
/**
|
|
552
|
-
*
|
|
553
|
-
*
|
|
626
|
+
* If scroll=UP, it means that cues in the region will be added to the
|
|
627
|
+
* bottom of the region and will push any already displayed cues in the
|
|
628
|
+
* region up. Otherwise (scroll=NONE) cues will stay fixed at the location
|
|
629
|
+
* they were first painted in.
|
|
630
|
+
* @type {shaka.text.CueRegion.scrollMode}
|
|
631
|
+
* @exportDoc
|
|
554
632
|
*/
|
|
555
633
|
this.scroll = CueRegion.scrollMode.NONE;
|
|
556
634
|
}
|
|
@@ -47,10 +47,10 @@ shaka.text.LrcTextParser = class {
|
|
|
47
47
|
// Get the input as a string.
|
|
48
48
|
const str = StringUtils.fromUTF8(data);
|
|
49
49
|
|
|
50
|
-
/** @type {shaka.
|
|
50
|
+
/** @type {shaka.text.Cue} */
|
|
51
51
|
let prevCue = null;
|
|
52
52
|
|
|
53
|
-
/** @type {!Array.<!shaka.
|
|
53
|
+
/** @type {!Array.<!shaka.text.Cue>} */
|
|
54
54
|
const cues = [];
|
|
55
55
|
const lines = str.split(/\r?\n/);
|
|
56
56
|
for (const line of lines) {
|