shaka-player 4.4.3 → 4.6.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/ISSUE_TEMPLATE/bug_report.md +1 -1
- package/.github/workflows/release-please.yaml +2 -27
- package/AUTHORS +2 -0
- package/CHANGELOG.md +156 -39
- package/CODE_OF_CONDUCT.md +1 -1
- package/CONTRIBUTORS +2 -0
- package/README.md +54 -42
- package/demo/asset_card.js +18 -21
- package/demo/cast_receiver/index.html +0 -1
- package/demo/close_button.js +0 -3
- package/demo/common/asset.js +33 -22
- package/demo/common/assets.js +249 -60
- package/demo/config.js +219 -253
- package/demo/custom.js +88 -133
- package/demo/front.js +7 -10
- package/demo/index.html +19 -22
- package/demo/input.js +6 -11
- package/demo/input_container.js +8 -9
- package/demo/main.js +62 -126
- package/demo/search.js +29 -34
- package/demo/service_worker.js +0 -3
- package/demo/tooltip.js +3 -5
- package/demo/visualizer.js +3 -5
- package/demo/visualizer_button.js +1 -20
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +211 -228
- package/dist/demo.compiled.debug.map +4 -4
- package/dist/demo.compiled.js +211 -228
- package/dist/demo.compiled.map +4 -4
- package/dist/deps.js +42 -37
- package/dist/locales.js +34 -30
- package/dist/receiver.compiled.debug.js +64 -77
- package/dist/receiver.compiled.debug.map +4 -4
- package/dist/receiver.compiled.js +64 -77
- package/dist/receiver.compiled.map +4 -4
- package/dist/shaka-player.compiled.d.ts +343 -151
- package/dist/shaka-player.compiled.debug.d.ts +343 -151
- package/dist/shaka-player.compiled.debug.externs.js +356 -117
- package/dist/shaka-player.compiled.debug.js +952 -811
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +356 -117
- package/dist/shaka-player.compiled.js +1165 -1078
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +359 -153
- package/dist/shaka-player.ui.debug.d.ts +359 -153
- package/dist/shaka-player.ui.debug.externs.js +382 -117
- package/dist/shaka-player.ui.debug.js +1084 -918
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +382 -117
- package/dist/shaka-player.ui.js +1377 -1274
- package/dist/shaka-player.ui.map +4 -4
- package/docs/design/lcevc-integration.md +14 -14
- package/docs/tutorials/ad_monetization.md +54 -0
- package/docs/tutorials/basic-usage.md +2 -1
- package/docs/tutorials/errors.md +2 -1
- package/docs/tutorials/faq.md +27 -55
- package/docs/tutorials/index.json +2 -1
- package/docs/tutorials/lcevc.md +118 -0
- package/docs/tutorials/offline.md +10 -8
- package/docs/tutorials/plugins.md +5 -0
- package/docs/tutorials/ui-customization.md +17 -0
- package/docs/tutorials/ui.md +2 -1
- package/docs/tutorials/upgrade.md +3 -0
- package/externs/css_style_declaration.js +19 -0
- package/externs/lcevc.js +37 -13
- package/externs/managedmediasource.js +24 -0
- package/externs/media_remote.js +68 -0
- package/externs/mediatailor.js +193 -0
- package/externs/pictureinpicture.js +11 -0
- package/externs/shaka/abr_manager.js +6 -2
- package/externs/shaka/ads.js +27 -0
- package/externs/shaka/cea.js +7 -0
- package/externs/shaka/codecs.js +5 -3
- package/externs/shaka/manifest.js +31 -10
- package/externs/shaka/manifest_parser.js +24 -1
- package/externs/shaka/net.js +2 -2
- package/externs/shaka/offline.js +13 -2
- package/externs/shaka/player.js +65 -8
- package/externs/shaka/text.js +3 -1
- package/externs/shaka/transmuxer.js +1 -1
- package/karma.conf.js +7 -3
- package/lib/abr/simple_abr_manager.js +66 -9
- package/lib/ads/ad_manager.js +104 -50
- package/lib/ads/media_tailor_ad.js +297 -0
- package/lib/ads/media_tailor_ad_manager.js +839 -0
- package/lib/cast/cast_receiver.js +1 -1
- package/lib/cea/cea_decoder.js +28 -0
- package/lib/cea/dummy_caption_decoder.js +5 -0
- package/lib/cea/ts_cea_parser.js +15 -2
- package/lib/config/codec_switching_strategy.js +24 -0
- package/lib/dash/content_protection.js +120 -2
- package/lib/dash/dash_parser.js +322 -93
- package/lib/dash/mpd_utils.js +62 -37
- package/lib/dash/segment_base.js +17 -10
- package/lib/dash/segment_list.js +18 -9
- package/lib/dash/segment_template.js +122 -107
- package/lib/dependencies/all.js +8 -7
- package/lib/hls/hls_classes.js +28 -43
- package/lib/hls/hls_parser.js +798 -658
- package/lib/hls/hls_utils.js +64 -5
- package/lib/hls/manifest_text_parser.js +7 -11
- package/lib/lcevc/lcevc_dec.js +220 -0
- package/lib/media/adaptation_set.js +32 -14
- package/lib/media/adaptation_set_criteria.js +86 -16
- package/lib/media/closed_caption_parser.js +13 -0
- package/lib/media/content_workarounds.js +6 -0
- package/lib/media/drm_engine.js +8 -13
- package/lib/media/manifest_parser.js +8 -113
- package/lib/media/media_source_capabilities.js +10 -3
- package/lib/media/media_source_engine.js +286 -44
- package/lib/media/play_rate_controller.js +8 -38
- package/lib/media/presentation_timeline.js +7 -1
- package/lib/media/quality_observer.js +1 -1
- package/lib/media/segment_index.js +6 -6
- package/lib/media/segment_prefetch.js +92 -24
- package/lib/media/segment_reference.js +73 -7
- package/lib/media/segment_utils.js +343 -0
- package/lib/media/stall_detector.js +0 -3
- package/lib/media/streaming_engine.js +73 -38
- package/lib/mss/mss_parser.js +19 -2
- package/lib/net/networking_engine.js +67 -12
- package/lib/net/networking_utils.js +95 -0
- package/lib/offline/indexeddb/v1_storage_cell.js +3 -0
- package/lib/offline/indexeddb/v2_storage_cell.js +3 -0
- package/lib/offline/manifest_converter.js +3 -0
- package/lib/offline/offline_manifest_parser.js +10 -0
- package/lib/offline/storage.js +14 -7
- package/lib/player.js +1098 -1537
- package/lib/polyfill/mediasource.js +22 -1
- package/lib/text/cue.js +15 -0
- package/lib/text/mp4_ttml_parser.js +2 -2
- package/lib/text/srt_text_parser.js +2 -2
- package/lib/text/stub_text_displayer.js +51 -0
- package/lib/text/text_engine.js +3 -2
- package/lib/text/ttml_text_parser.js +45 -5
- package/lib/text/ui_text_displayer.js +8 -0
- package/lib/text/vtt_text_parser.js +40 -22
- package/lib/transmuxer/aac_transmuxer.js +1 -1
- package/lib/transmuxer/ac3_transmuxer.js +1 -1
- package/lib/transmuxer/ec3_transmuxer.js +1 -1
- package/lib/transmuxer/h264.js +5 -4
- package/lib/transmuxer/h265.js +863 -0
- package/lib/transmuxer/mp3_transmuxer.js +1 -1
- package/lib/transmuxer/mpeg_ts_transmuxer.js +4 -3
- package/lib/transmuxer/mss_transmuxer.js +1 -1
- package/lib/transmuxer/ts_transmuxer.js +187 -22
- package/lib/util/buffer_utils.js +26 -4
- package/lib/util/content_steering_manager.js +358 -0
- package/lib/util/error.js +30 -15
- package/lib/util/exp_golomb.js +30 -2
- package/lib/util/fairplay_utils.js +1 -1
- package/lib/util/fake_event.js +8 -1
- package/lib/util/id3_utils.js +50 -1
- package/lib/util/manifest_parser_utils.js +12 -8
- package/lib/util/mp4_generator.js +6 -8
- package/lib/util/mutex.js +59 -0
- package/lib/util/object_utils.js +1 -1
- package/lib/util/periods.js +156 -179
- package/lib/util/platform.js +44 -3
- package/lib/util/player_configuration.js +43 -6
- package/lib/util/state_history.js +6 -2
- package/lib/util/stream_utils.js +206 -283
- package/lib/util/ts_parser.js +335 -98
- package/lib/util/uint8array_utils.js +5 -1
- package/lib/util/xml_utils.js +5 -0
- package/maintained-branches.md +3 -2
- package/package.json +4 -6
- package/roadmap.md +25 -5
- package/shaka-player.uncompiled.js +2 -2
- package/support.html +0 -1
- package/test/abr/simple_abr_manager_unit.js +33 -33
- package/test/ads/ad_manager_unit.js +3 -2
- package/test/cast/cast_receiver_integration.js +50 -4
- package/test/cast/cast_utils_unit.js +2 -0
- package/test/cea/cea_decoder_unit.js +7 -0
- package/test/codec_switching/codec_switching_integration.js +182 -0
- package/test/dash/dash_parser_content_protection_unit.js +2 -0
- package/test/dash/dash_parser_integration.js +74 -0
- package/test/dash/dash_parser_live_unit.js +2 -19
- package/test/dash/dash_parser_manifest_unit.js +536 -2
- package/test/dash/dash_parser_segment_base_unit.js +2 -0
- package/test/dash/dash_parser_segment_list_unit.js +2 -0
- package/test/dash/dash_parser_segment_template_unit.js +2 -0
- package/test/dash/mpd_utils_unit.js +61 -30
- package/test/demo/demo_unit.js +0 -16
- package/test/hls/hls_live_unit.js +14 -3
- package/test/hls/hls_parser_unit.js +385 -33
- package/test/hls/manifest_text_parser_unit.js +32 -99
- package/test/media/adaptation_set_criteria_unit.js +284 -15
- package/test/media/adaptation_set_unit.js +2 -0
- package/test/media/content_workarounds_unit.js +1 -1
- package/test/media/drm_engine_unit.js +3 -3
- package/test/media/media_source_engine_unit.js +166 -2
- package/test/media/play_rate_controller_unit.js +0 -48
- package/test/media/segment_index_unit.js +5 -4
- package/test/media/segment_prefetch_unit.js +1 -1
- package/test/media/streaming_engine_unit.js +17 -17
- package/test/mss/mss_parser_unit.js +2 -0
- package/test/mss/mss_player_integration.js +3 -2
- package/test/net/networking_engine_unit.js +3 -3
- package/test/{media/manifest_parser_unit.js → net/networking_utils_unit.js} +2 -2
- package/test/offline/manifest_convert_unit.js +14 -0
- package/test/offline/offline_integration.js +2 -1
- package/test/offline/storage_integration.js +22 -13
- package/test/player_external.js +4 -2
- package/test/player_integration.js +15 -4
- package/test/player_load_graph_integration.js +47 -151
- package/test/player_src_equals_external.js +1 -0
- package/test/player_src_equals_integration.js +71 -4
- package/test/player_unit.js +182 -158
- package/test/test/assets/dash-aes-128/Fragments(video=0,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=20000000,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=40000000,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=60000000,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/Fragments(video=i,format=mpd-time-csf) +0 -0
- package/test/test/assets/dash-aes-128/dash.mpd +18 -0
- package/test/test/assets/dash-aes-128/license +1 -0
- package/test/test/assets/dash-multi-codec/audio_en_2c_128k_aac.mp4 +0 -0
- package/test/test/assets/dash-multi-codec/audio_es_2c_64k_opus.webm +0 -0
- package/test/test/assets/dash-multi-codec/dash.mpd +32 -0
- package/test/test/assets/dash-multi-codec/video_144p_108k_h264.mp4 +0 -0
- package/test/test/assets/hls-ts-h265/0.ts +0 -0
- package/test/test/assets/hls-ts-h265/hevc.m3u8 +6 -0
- package/test/test/assets/hls-ts-h265/index.m3u8 +7 -0
- package/test/test/assets/hls-ts-muxed-aac-h265/0.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h265/1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-aac-h265/media.m3u8 +9 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/media.m3u8 +24 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00000.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00001.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00002.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00003.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00004.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ac3-h264/s_00005.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0000.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0001.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0002.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/ChID_voices_1280x720p_25fps_h264_6ch_256kbps_ddp_sub_0003.ts +0 -0
- package/test/test/assets/hls-ts-muxed-ec3-h264/prog_index.m3u8 +14 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/index.m3u8 +23 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-1-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-2-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-3-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-4-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-5-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-6-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-7-v1-a1.ts +0 -0
- package/test/test/assets/hls-ts-muxed-mp3-h264/seg-8-v1-a1.ts +0 -0
- package/test/test/util/dash_parser_util.js +4 -0
- package/test/test/util/fake_ad_manager.js +20 -0
- package/test/test/util/fake_media_source_engine.js +13 -2
- package/test/test/util/fake_networking_engine.js +9 -1
- package/test/test/util/fake_segment_prefetch.js +3 -0
- package/test/test/util/manifest_generator.js +11 -3
- package/test/test/util/manifest_parser_util.js +14 -2
- package/test/test/util/mss_parser_util.js +4 -0
- package/test/test/util/offline_utils.js +2 -0
- package/test/test/util/simple_fakes.js +2 -2
- package/test/test/util/streaming_engine_util.js +10 -4
- package/test/test/util/test_scheme.js +6 -0
- package/test/test/util/ui_utils.js +4 -3
- package/test/text/mp4_ttml_parser_unit.js +4 -4
- package/test/text/srt_text_parser_unit.js +1 -1
- package/test/text/text_displayer_layout_unit.js +1 -1
- package/test/text/text_engine_unit.js +6 -0
- package/test/text/ttml_text_parser_unit.js +85 -2
- package/test/text/vtt_text_parser_unit.js +103 -31
- package/test/transmuxer/transmuxer_engine_integration.js +9 -0
- package/test/transmuxer/transmuxer_integration.js +150 -3
- package/test/ui/ad_ui_unit.js +2 -2
- package/test/ui/ui_customization_unit.js +17 -16
- package/test/ui/ui_integration.js +30 -20
- package/test/ui/ui_unit.js +28 -29
- package/test/util/buffer_utils_unit.js +1 -1
- package/test/util/content_steering_manager_unit.js +427 -0
- package/test/util/id3_utils_unit.js +52 -0
- package/test/util/stream_utils_unit.js +207 -169
- package/test/util/ts_parser_unit.js +3 -3
- package/third_party/closure-uri/uri.js +13 -1
- package/ui/audio_language_selection.js +9 -2
- package/ui/controls.js +125 -0
- package/ui/externs/ui.js +24 -2
- package/ui/language_utils.js +43 -8
- package/ui/less/range_elements.less +33 -0
- package/ui/locales/en.json +1 -0
- package/ui/locales/es-419.json +1 -0
- package/ui/locales/es.json +1 -0
- package/ui/locales/source.json +4 -0
- package/ui/localization.js +10 -0
- package/ui/pip_button.js +22 -120
- package/ui/remote_button.js +203 -0
- package/ui/resolution_selection.js +47 -10
- package/ui/seek_bar.js +296 -3
- package/ui/text_selection.js +2 -1
- package/ui/ui.js +11 -4
- package/demo/common/message_ids.js +0 -309
- package/demo/locales/en.json +0 -288
- package/demo/locales/source.json +0 -1146
- package/externs/mux.js +0 -69
- package/lib/lcevc/lcevc_dil.js +0 -152
- package/lib/routing/node.js +0 -23
- package/lib/routing/payload.js +0 -43
- package/lib/routing/walker.js +0 -587
- package/lib/transmuxer/muxjs_transmuxer.js +0 -242
- package/test/routing/walker_unit.js +0 -504
- package/test/transmuxer/muxjs_transmuxer_integration.js +0 -177
|
@@ -36,17 +36,19 @@ shaka.dash.SegmentTemplate = class {
|
|
|
36
36
|
* @param {number} segmentLimit The maximum number of segments to generate for
|
|
37
37
|
* a SegmentTemplate with fixed duration.
|
|
38
38
|
* @param {!Object.<string, number>} periodDurationMap
|
|
39
|
+
* @param {shaka.extern.aes128Key|undefined} aes128Key
|
|
39
40
|
* @return {shaka.dash.DashParser.StreamInfo}
|
|
40
41
|
*/
|
|
41
42
|
static createStreamInfo(
|
|
42
43
|
context, requestSegment, streamMap, isUpdate, segmentLimit,
|
|
43
|
-
periodDurationMap) {
|
|
44
|
+
periodDurationMap, aes128Key) {
|
|
44
45
|
goog.asserts.assert(context.representation.segmentTemplate,
|
|
45
46
|
'Should only be called with SegmentTemplate');
|
|
46
47
|
const SegmentTemplate = shaka.dash.SegmentTemplate;
|
|
47
48
|
const TimelineSegmentIndex = shaka.dash.TimelineSegmentIndex;
|
|
48
49
|
|
|
49
|
-
const initSegmentReference =
|
|
50
|
+
const initSegmentReference =
|
|
51
|
+
SegmentTemplate.createInitSegment_(context, aes128Key);
|
|
50
52
|
|
|
51
53
|
/** @type {shaka.dash.SegmentTemplate.SegmentTemplateInfo} */
|
|
52
54
|
const info = SegmentTemplate.parseSegmentTemplateInfo_(context);
|
|
@@ -82,7 +84,7 @@ shaka.dash.SegmentTemplate = class {
|
|
|
82
84
|
generateSegmentIndex: () => {
|
|
83
85
|
return SegmentTemplate.generateSegmentIndexFromDuration_(
|
|
84
86
|
shallowCopyOfContext, info, segmentLimit, initSegmentReference,
|
|
85
|
-
periodDurationMap);
|
|
87
|
+
periodDurationMap, aes128Key);
|
|
86
88
|
},
|
|
87
89
|
};
|
|
88
90
|
} else {
|
|
@@ -129,11 +131,13 @@ shaka.dash.SegmentTemplate = class {
|
|
|
129
131
|
info,
|
|
130
132
|
context.representation.id,
|
|
131
133
|
context.bandwidth,
|
|
132
|
-
context.representation.
|
|
134
|
+
context.representation.getBaseUris,
|
|
133
135
|
periodStart,
|
|
134
136
|
periodEnd,
|
|
135
137
|
initSegmentReference,
|
|
136
138
|
shouldFit,
|
|
139
|
+
aes128Key,
|
|
140
|
+
context.representation.segmentSequenceCadence,
|
|
137
141
|
);
|
|
138
142
|
} else {
|
|
139
143
|
const tsi = /** @type {!TimelineSegmentIndex} */(segmentIndex);
|
|
@@ -281,10 +285,10 @@ shaka.dash.SegmentTemplate = class {
|
|
|
281
285
|
goog.asserts.assert(info.indexTemplate, 'must be using index template');
|
|
282
286
|
const filledTemplate = MpdUtils.fillUriTemplate(
|
|
283
287
|
info.indexTemplate, context.representation.id,
|
|
284
|
-
null, context.bandwidth || null, null);
|
|
288
|
+
null, null, context.bandwidth || null, null);
|
|
285
289
|
|
|
286
290
|
const resolvedUris = ManifestParserUtils.resolveUris(
|
|
287
|
-
context.representation.
|
|
291
|
+
context.representation.getBaseUris(), [filledTemplate]);
|
|
288
292
|
|
|
289
293
|
return shaka.dash.SegmentBase.generateSegmentIndexFromUris(
|
|
290
294
|
context, requestSegment, init, resolvedUris, 0, null,
|
|
@@ -299,11 +303,13 @@ shaka.dash.SegmentTemplate = class {
|
|
|
299
303
|
* @param {number} segmentLimit The maximum number of segments to generate.
|
|
300
304
|
* @param {shaka.media.InitSegmentReference} initSegmentReference
|
|
301
305
|
* @param {!Object.<string, number>} periodDurationMap
|
|
306
|
+
* @param {shaka.extern.aes128Key|undefined} aes128Key
|
|
302
307
|
* @return {!Promise.<shaka.media.SegmentIndex>}
|
|
303
308
|
* @private
|
|
304
309
|
*/
|
|
305
310
|
static generateSegmentIndexFromDuration_(
|
|
306
|
-
context, info, segmentLimit, initSegmentReference, periodDurationMap
|
|
311
|
+
context, info, segmentLimit, initSegmentReference, periodDurationMap,
|
|
312
|
+
aes128Key) {
|
|
307
313
|
goog.asserts.assert(info.mediaTemplate,
|
|
308
314
|
'There should be a media template with duration');
|
|
309
315
|
|
|
@@ -340,7 +346,7 @@ shaka.dash.SegmentTemplate = class {
|
|
|
340
346
|
const template = info.mediaTemplate;
|
|
341
347
|
const bandwidth = context.bandwidth || null;
|
|
342
348
|
const id = context.representation.id;
|
|
343
|
-
const
|
|
349
|
+
const getBaseUris = context.representation.getBaseUris;
|
|
344
350
|
|
|
345
351
|
const timestampOffset = periodStart - info.scaledPresentationTimeOffset;
|
|
346
352
|
|
|
@@ -419,10 +425,13 @@ shaka.dash.SegmentTemplate = class {
|
|
|
419
425
|
info.scaledPresentationTimeOffset;
|
|
420
426
|
|
|
421
427
|
const getUris = () => {
|
|
428
|
+
let time = segmentMediaTime * timescale;
|
|
429
|
+
if ('BigInt' in window && time > Number.MAX_SAFE_INTEGER) {
|
|
430
|
+
time = BigInt(segmentMediaTime) * BigInt(timescale);
|
|
431
|
+
}
|
|
422
432
|
const mediaUri = MpdUtils.fillUriTemplate(
|
|
423
|
-
template, id, position, bandwidth,
|
|
424
|
-
|
|
425
|
-
return ManifestParserUtils.resolveUris(baseUris, [mediaUri]);
|
|
433
|
+
template, id, position, /* subNumber= */ null, bandwidth, time);
|
|
434
|
+
return ManifestParserUtils.resolveUris(getBaseUris(), [mediaUri]);
|
|
426
435
|
};
|
|
427
436
|
|
|
428
437
|
// Relative to the presentation.
|
|
@@ -446,7 +455,13 @@ shaka.dash.SegmentTemplate = class {
|
|
|
446
455
|
initSegmentReference,
|
|
447
456
|
timestampOffset,
|
|
448
457
|
/* appendWindowStart= */ periodStart,
|
|
449
|
-
/* appendWindowEnd= */ getPeriodEnd()
|
|
458
|
+
/* appendWindowEnd= */ getPeriodEnd(),
|
|
459
|
+
/* partialReferences= */ [],
|
|
460
|
+
/* tilesLayout= */ '',
|
|
461
|
+
/* tileDuration= */ null,
|
|
462
|
+
/* syncTime= */ null,
|
|
463
|
+
shaka.media.SegmentReference.Status.AVAILABLE,
|
|
464
|
+
aes128Key);
|
|
450
465
|
// This is necessary information for thumbnail streams:
|
|
451
466
|
ref.trueEndTime = trueSegmentEnd;
|
|
452
467
|
return ref;
|
|
@@ -505,87 +520,15 @@ shaka.dash.SegmentTemplate = class {
|
|
|
505
520
|
return Promise.resolve(segmentIndex);
|
|
506
521
|
}
|
|
507
522
|
|
|
508
|
-
/**
|
|
509
|
-
* Creates segment references from a timeline.
|
|
510
|
-
*
|
|
511
|
-
* @param {shaka.dash.DashParser.Context} context
|
|
512
|
-
* @param {shaka.dash.SegmentTemplate.SegmentTemplateInfo} info
|
|
513
|
-
* @param {shaka.media.InitSegmentReference} initSegmentReference
|
|
514
|
-
* @return {!Array.<!shaka.media.SegmentReference>}
|
|
515
|
-
* @private
|
|
516
|
-
*/
|
|
517
|
-
static createFromTimeline_(context, info, initSegmentReference) {
|
|
518
|
-
const MpdUtils = shaka.dash.MpdUtils;
|
|
519
|
-
const ManifestParserUtils = shaka.util.ManifestParserUtils;
|
|
520
|
-
|
|
521
|
-
const periodStart = context.periodInfo.start;
|
|
522
|
-
const periodDuration = context.periodInfo.duration;
|
|
523
|
-
|
|
524
|
-
const timestampOffset = periodStart - info.scaledPresentationTimeOffset;
|
|
525
|
-
const appendWindowStart = periodStart;
|
|
526
|
-
const appendWindowEnd = periodDuration ?
|
|
527
|
-
periodStart + periodDuration : Infinity;
|
|
528
|
-
|
|
529
|
-
/** @type {!Array.<!shaka.media.SegmentReference>} */
|
|
530
|
-
const references = [];
|
|
531
|
-
for (let i = 0; i < info.timeline.length; i++) {
|
|
532
|
-
const {start, unscaledStart, end} = info.timeline[i];
|
|
533
|
-
|
|
534
|
-
// Note: i = k - 1, where k indicates the k'th segment listed in the MPD.
|
|
535
|
-
// (See section 5.3.9.5.3 of the DASH spec.)
|
|
536
|
-
const segmentReplacement = i + info.startNumber;
|
|
537
|
-
|
|
538
|
-
// Consider the presentation time offset in segment uri computation
|
|
539
|
-
const timeReplacement = unscaledStart +
|
|
540
|
-
info.unscaledPresentationTimeOffset;
|
|
541
|
-
const repId = context.representation.id;
|
|
542
|
-
const bandwidth = context.bandwidth || null;
|
|
543
|
-
const mediaTemplate = info.mediaTemplate;
|
|
544
|
-
const baseUris = context.representation.baseUris;
|
|
545
|
-
|
|
546
|
-
// This callback must not capture any non-local
|
|
547
|
-
// variables, such as info, context, etc. Make
|
|
548
|
-
// sure any values you reference here have
|
|
549
|
-
// been assigned to local variables within the
|
|
550
|
-
// loop, or else we will end up with a leak.
|
|
551
|
-
const createUris =
|
|
552
|
-
() => {
|
|
553
|
-
goog.asserts.assert(
|
|
554
|
-
mediaTemplate,
|
|
555
|
-
'There should be a media template with a timeline');
|
|
556
|
-
const mediaUri = MpdUtils.fillUriTemplate(
|
|
557
|
-
mediaTemplate, repId,
|
|
558
|
-
segmentReplacement, bandwidth || null, timeReplacement);
|
|
559
|
-
return ManifestParserUtils
|
|
560
|
-
.resolveUris(baseUris, [mediaUri])
|
|
561
|
-
.map((g) => {
|
|
562
|
-
return g.toString();
|
|
563
|
-
});
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
references.push(new shaka.media.SegmentReference(
|
|
567
|
-
periodStart + start,
|
|
568
|
-
periodStart + end,
|
|
569
|
-
createUris,
|
|
570
|
-
/* startByte= */ 0,
|
|
571
|
-
/* endByte= */ null,
|
|
572
|
-
initSegmentReference,
|
|
573
|
-
timestampOffset,
|
|
574
|
-
appendWindowStart,
|
|
575
|
-
appendWindowEnd));
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
return references;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
523
|
/**
|
|
582
524
|
* Creates an init segment reference from a context object.
|
|
583
525
|
*
|
|
584
526
|
* @param {shaka.dash.DashParser.Context} context
|
|
527
|
+
* @param {shaka.extern.aes128Key|undefined} aes128Key
|
|
585
528
|
* @return {shaka.media.InitSegmentReference}
|
|
586
529
|
* @private
|
|
587
530
|
*/
|
|
588
|
-
static createInitSegment_(context) {
|
|
531
|
+
static createInitSegment_(context, aes128Key) {
|
|
589
532
|
const MpdUtils = shaka.dash.MpdUtils;
|
|
590
533
|
const ManifestParserUtils = shaka.util.ManifestParserUtils;
|
|
591
534
|
const SegmentTemplate = shaka.dash.SegmentTemplate;
|
|
@@ -598,17 +541,24 @@ shaka.dash.SegmentTemplate = class {
|
|
|
598
541
|
|
|
599
542
|
const repId = context.representation.id;
|
|
600
543
|
const bandwidth = context.bandwidth || null;
|
|
601
|
-
const
|
|
544
|
+
const getBaseUris = context.representation.getBaseUris;
|
|
602
545
|
const getUris = () => {
|
|
603
546
|
goog.asserts.assert(initialization, 'Should have returned earler');
|
|
604
547
|
const filledTemplate = MpdUtils.fillUriTemplate(
|
|
605
|
-
initialization, repId, null, bandwidth, null);
|
|
548
|
+
initialization, repId, null, null, bandwidth, null);
|
|
606
549
|
const resolvedUris = ManifestParserUtils.resolveUris(
|
|
607
|
-
|
|
550
|
+
getBaseUris(), [filledTemplate]);
|
|
608
551
|
return resolvedUris;
|
|
609
552
|
};
|
|
610
553
|
const qualityInfo = shaka.dash.SegmentBase.createQualityInfo(context);
|
|
611
|
-
return new shaka.media.InitSegmentReference(
|
|
554
|
+
return new shaka.media.InitSegmentReference(
|
|
555
|
+
getUris,
|
|
556
|
+
/* startByte= */ 0,
|
|
557
|
+
/* endByte= */ null,
|
|
558
|
+
qualityInfo,
|
|
559
|
+
/* timescale= */ null,
|
|
560
|
+
/* segmentData= */ null,
|
|
561
|
+
aes128Key);
|
|
612
562
|
}
|
|
613
563
|
};
|
|
614
564
|
|
|
@@ -630,15 +580,17 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
|
|
|
630
580
|
* @param {!shaka.dash.SegmentTemplate.SegmentTemplateInfo} templateInfo
|
|
631
581
|
* @param {?string} representationId
|
|
632
582
|
* @param {number} bandwidth
|
|
633
|
-
* @param {Array.<string>}
|
|
583
|
+
* @param {function():Array.<string>} getBaseUris
|
|
634
584
|
* @param {number} periodStart
|
|
635
585
|
* @param {number} periodEnd
|
|
636
586
|
* @param {shaka.media.InitSegmentReference} initSegmentReference
|
|
637
587
|
* @param {boolean} shouldFit
|
|
638
|
-
*
|
|
588
|
+
* @param {shaka.extern.aes128Key|undefined} aes128Key
|
|
589
|
+
* @param {number} segmentSequenceCadence
|
|
639
590
|
*/
|
|
640
|
-
constructor(templateInfo, representationId, bandwidth,
|
|
641
|
-
periodStart, periodEnd, initSegmentReference, shouldFit
|
|
591
|
+
constructor(templateInfo, representationId, bandwidth, getBaseUris,
|
|
592
|
+
periodStart, periodEnd, initSegmentReference, shouldFit,
|
|
593
|
+
aes128Key, segmentSequenceCadence) {
|
|
642
594
|
super([]);
|
|
643
595
|
|
|
644
596
|
/** @private {?shaka.dash.SegmentTemplate.SegmentTemplateInfo} */
|
|
@@ -647,14 +599,18 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
|
|
|
647
599
|
this.representationId_ = representationId;
|
|
648
600
|
/** @private {number} */
|
|
649
601
|
this.bandwidth_ = bandwidth;
|
|
650
|
-
/** @private {Array.<string>} */
|
|
651
|
-
this.
|
|
602
|
+
/** @private {function():Array.<string>} */
|
|
603
|
+
this.getBaseUris_ = getBaseUris;
|
|
652
604
|
/** @private {number} */
|
|
653
605
|
this.periodStart_ = periodStart;
|
|
654
606
|
/** @private {number} */
|
|
655
607
|
this.periodEnd_ = periodEnd;
|
|
656
608
|
/** @private {shaka.media.InitSegmentReference} */
|
|
657
609
|
this.initSegmentReference_ = initSegmentReference;
|
|
610
|
+
/** @private {shaka.extern.aes128Key|undefined} */
|
|
611
|
+
this.aes128Key_ = aes128Key;
|
|
612
|
+
/** @private {number} */
|
|
613
|
+
this.segmentSequenceCadence_ = segmentSequenceCadence;
|
|
658
614
|
|
|
659
615
|
|
|
660
616
|
if (shouldFit) {
|
|
@@ -862,29 +818,81 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
|
|
|
862
818
|
let ref = this.references[correctedPosition];
|
|
863
819
|
|
|
864
820
|
if (!ref) {
|
|
821
|
+
const mediaTemplate = this.templateInfo_.mediaTemplate;
|
|
865
822
|
const range = this.templateInfo_.timeline[correctedPosition];
|
|
866
|
-
const segmentReplacement =
|
|
823
|
+
const segmentReplacement = range.segmentPosition;
|
|
867
824
|
const timeReplacement = this.templateInfo_
|
|
868
825
|
.unscaledPresentationTimeOffset + range.unscaledStart;
|
|
826
|
+
const timestampOffset = this.periodStart_ -
|
|
827
|
+
this.templateInfo_.scaledPresentationTimeOffset;
|
|
828
|
+
|
|
829
|
+
const partialSegmentRefs = [];
|
|
830
|
+
|
|
831
|
+
const partialDuration = (range.end - range.start) / range.partialSegments;
|
|
832
|
+
|
|
833
|
+
for (let i = 0; i < range.partialSegments; i++) {
|
|
834
|
+
const start = range.start + partialDuration * i;
|
|
835
|
+
const end = start + partialDuration;
|
|
836
|
+
const subNumber = i + 1;
|
|
837
|
+
let uris = null;
|
|
838
|
+
const getPartialUris = () => {
|
|
839
|
+
if (!this.templateInfo_) {
|
|
840
|
+
return [];
|
|
841
|
+
}
|
|
842
|
+
if (uris == null) {
|
|
843
|
+
uris = shaka.dash.TimelineSegmentIndex.createUris_(
|
|
844
|
+
this.templateInfo_.mediaTemplate,
|
|
845
|
+
this.representationId_,
|
|
846
|
+
segmentReplacement,
|
|
847
|
+
this.bandwidth_,
|
|
848
|
+
timeReplacement,
|
|
849
|
+
subNumber,
|
|
850
|
+
this.getBaseUris_);
|
|
851
|
+
}
|
|
852
|
+
return uris;
|
|
853
|
+
};
|
|
854
|
+
const partial = new shaka.media.SegmentReference(
|
|
855
|
+
this.periodStart_ + start,
|
|
856
|
+
this.periodStart_ + end,
|
|
857
|
+
getPartialUris,
|
|
858
|
+
/* startByte= */ 0,
|
|
859
|
+
/* endByte= */ null,
|
|
860
|
+
this.initSegmentReference_,
|
|
861
|
+
timestampOffset,
|
|
862
|
+
this.periodStart_,
|
|
863
|
+
this.periodEnd_,
|
|
864
|
+
/* partialReferences= */ [],
|
|
865
|
+
/* tilesLayout= */ '',
|
|
866
|
+
/* tileDuration= */ null,
|
|
867
|
+
/* syncTime= */ null,
|
|
868
|
+
shaka.media.SegmentReference.Status.AVAILABLE,
|
|
869
|
+
this.aes128Key_);
|
|
870
|
+
if (this.segmentSequenceCadence_ == 0) {
|
|
871
|
+
if (i > 0) {
|
|
872
|
+
partial.markAsNonIndependent();
|
|
873
|
+
}
|
|
874
|
+
} else if ((i % this.segmentSequenceCadence_) != 0) {
|
|
875
|
+
partial.markAsNonIndependent();
|
|
876
|
+
}
|
|
877
|
+
partialSegmentRefs.push(partial);
|
|
878
|
+
}
|
|
869
879
|
|
|
870
880
|
const createUrisCb = () => {
|
|
871
|
-
if (
|
|
881
|
+
if (range.partialSegments > 0) {
|
|
872
882
|
return [];
|
|
873
883
|
}
|
|
874
884
|
return shaka.dash.TimelineSegmentIndex
|
|
875
885
|
.createUris_(
|
|
876
|
-
|
|
886
|
+
mediaTemplate,
|
|
877
887
|
this.representationId_,
|
|
878
888
|
segmentReplacement,
|
|
879
889
|
this.bandwidth_,
|
|
880
890
|
timeReplacement,
|
|
881
|
-
|
|
891
|
+
/* subNumber= */ null,
|
|
892
|
+
this.getBaseUris_,
|
|
882
893
|
);
|
|
883
894
|
};
|
|
884
895
|
|
|
885
|
-
const timestampOffset = this.periodStart_ -
|
|
886
|
-
this.templateInfo_.scaledPresentationTimeOffset;
|
|
887
|
-
|
|
888
896
|
ref = new shaka.media.SegmentReference(
|
|
889
897
|
this.periodStart_ + range.start,
|
|
890
898
|
this.periodStart_ + range.end,
|
|
@@ -894,7 +902,14 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
|
|
|
894
902
|
this.initSegmentReference_,
|
|
895
903
|
timestampOffset,
|
|
896
904
|
this.periodStart_,
|
|
897
|
-
this.periodEnd_
|
|
905
|
+
this.periodEnd_,
|
|
906
|
+
partialSegmentRefs,
|
|
907
|
+
/* tilesLayout= */ '',
|
|
908
|
+
/* tileDuration= */ null,
|
|
909
|
+
/* syncTime= */ null,
|
|
910
|
+
shaka.media.SegmentReference.Status.AVAILABLE,
|
|
911
|
+
this.aes128Key_,
|
|
912
|
+
/* allPartialSegments= */ range.partialSegments > 0);
|
|
898
913
|
this.references[correctedPosition] = ref;
|
|
899
914
|
}
|
|
900
915
|
|
|
@@ -908,12 +923,12 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
|
|
|
908
923
|
* @private
|
|
909
924
|
*/
|
|
910
925
|
static createUris_(mediaTemplate, repId, segmentReplacement,
|
|
911
|
-
bandwidth, timeReplacement,
|
|
926
|
+
bandwidth, timeReplacement, subNumber, getBaseUris) {
|
|
912
927
|
const mediaUri = shaka.dash.MpdUtils.fillUriTemplate(
|
|
913
928
|
mediaTemplate, repId,
|
|
914
|
-
segmentReplacement, bandwidth || null, timeReplacement);
|
|
929
|
+
segmentReplacement, subNumber, bandwidth || null, timeReplacement);
|
|
915
930
|
return shaka.util.ManifestParserUtils
|
|
916
|
-
.resolveUris(
|
|
931
|
+
.resolveUris(getBaseUris(), [mediaUri])
|
|
917
932
|
.map((g) => {
|
|
918
933
|
return g.toString();
|
|
919
934
|
});
|
package/lib/dependencies/all.js
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
goog.provide('shaka.dependencies');
|
|
8
8
|
|
|
9
|
+
goog.require('shaka.Deprecate');
|
|
10
|
+
|
|
9
11
|
/**
|
|
10
12
|
* @export
|
|
11
13
|
*/
|
|
@@ -22,6 +24,12 @@ shaka.dependencies = class {
|
|
|
22
24
|
if (!shaka.dependencies.Allowed[key]) {
|
|
23
25
|
throw new Error(`${key} is not supported`);
|
|
24
26
|
}
|
|
27
|
+
if (key == shaka.dependencies.Allowed.muxjs) {
|
|
28
|
+
shaka.Deprecate.deprecateFeature(5,
|
|
29
|
+
'mux.js',
|
|
30
|
+
'mux.js is no longer used in Shaka Player.');
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
25
33
|
shaka.dependencies.dependencies_.set(key, () => dep);
|
|
26
34
|
}
|
|
27
35
|
|
|
@@ -36,12 +44,6 @@ shaka.dependencies = class {
|
|
|
36
44
|
return shaka.dependencies.dependencies_.has(key);
|
|
37
45
|
}
|
|
38
46
|
|
|
39
|
-
/** @return {?muxjs} */
|
|
40
|
-
static muxjs() {
|
|
41
|
-
return /** @type {?muxjs} */ (shaka.dependencies.dependencies_.get(
|
|
42
|
-
shaka.dependencies.Allowed.muxjs)());
|
|
43
|
-
}
|
|
44
|
-
|
|
45
47
|
/** @return {?ISOBoxer} */
|
|
46
48
|
static isoBoxer() {
|
|
47
49
|
return /** @type {?ISOBoxer} */ (shaka.dependencies.dependencies_.get(
|
|
@@ -65,6 +67,5 @@ shaka.dependencies.Allowed = {
|
|
|
65
67
|
* @private {!Map.<shaka.dependencies.Allowed, function():?>}
|
|
66
68
|
*/
|
|
67
69
|
shaka.dependencies.dependencies_ = new Map([
|
|
68
|
-
[shaka.dependencies.Allowed.muxjs, () => window.muxjs],
|
|
69
70
|
[shaka.dependencies.Allowed.ISOBoxer, () => window.ISOBoxer],
|
|
70
71
|
]);
|
package/lib/hls/hls_classes.js
CHANGED
|
@@ -11,7 +11,6 @@ goog.provide('shaka.hls.Segment');
|
|
|
11
11
|
goog.provide('shaka.hls.Tag');
|
|
12
12
|
|
|
13
13
|
goog.require('goog.asserts');
|
|
14
|
-
goog.require('shaka.hls.Utils');
|
|
15
14
|
goog.require('shaka.util.Error');
|
|
16
15
|
|
|
17
16
|
|
|
@@ -20,19 +19,11 @@ goog.require('shaka.util.Error');
|
|
|
20
19
|
*/
|
|
21
20
|
shaka.hls.Playlist = class {
|
|
22
21
|
/**
|
|
23
|
-
* @param {string} absoluteUri An absolute, final URI after redirects.
|
|
24
22
|
* @param {!shaka.hls.PlaylistType} type
|
|
25
23
|
* @param {!Array.<shaka.hls.Tag>} tags
|
|
26
24
|
* @param {!Array.<shaka.hls.Segment>=} segments
|
|
27
25
|
*/
|
|
28
|
-
constructor(
|
|
29
|
-
/**
|
|
30
|
-
* An absolute, final URI after redirects.
|
|
31
|
-
*
|
|
32
|
-
* @const {string}
|
|
33
|
-
*/
|
|
34
|
-
this.absoluteUri = absoluteUri;
|
|
35
|
-
|
|
26
|
+
constructor(type, tags, segments) {
|
|
36
27
|
/** @const {shaka.hls.PlaylistType} */
|
|
37
28
|
this.type = type;
|
|
38
29
|
|
|
@@ -87,10 +78,11 @@ shaka.hls.Tag = class {
|
|
|
87
78
|
* As in some cases (like in tests) the tag never existed in string form, it
|
|
88
79
|
* is far easier to recreate the tag from the parsed form.
|
|
89
80
|
*
|
|
81
|
+
* @param {?Set.<string>=} attributesToSkip
|
|
90
82
|
* @return {string}
|
|
91
83
|
* @override
|
|
92
84
|
*/
|
|
93
|
-
toString() {
|
|
85
|
+
toString(attributesToSkip) {
|
|
94
86
|
/**
|
|
95
87
|
* @param {shaka.hls.Attribute} attr
|
|
96
88
|
* @return {string}
|
|
@@ -107,7 +99,12 @@ shaka.hls.Tag = class {
|
|
|
107
99
|
// 4) <NAME>:<VALUE>,<ATTRIBUTE_LIST>
|
|
108
100
|
|
|
109
101
|
let tagStr = '#' + this.name;
|
|
110
|
-
const appendages = this.attributes ? this.attributes.
|
|
102
|
+
const appendages = this.attributes ? this.attributes.filter((attr) => {
|
|
103
|
+
if (!attributesToSkip) {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
return !attributesToSkip.has(attr.name);
|
|
107
|
+
}).map(attrToStr) : [];
|
|
111
108
|
|
|
112
109
|
if (this.value) {
|
|
113
110
|
appendages.unshift(this.value);
|
|
@@ -120,6 +117,22 @@ shaka.hls.Tag = class {
|
|
|
120
117
|
return tagStr;
|
|
121
118
|
}
|
|
122
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Create the string key of the tag.
|
|
122
|
+
*
|
|
123
|
+
* @return {string}
|
|
124
|
+
*/
|
|
125
|
+
getTagKey() {
|
|
126
|
+
const attributesToSkip = new Set()
|
|
127
|
+
.add('AUDIO')
|
|
128
|
+
.add('VIDEO')
|
|
129
|
+
.add('SUBTITLES')
|
|
130
|
+
.add('PATHWAY-ID')
|
|
131
|
+
.add('GROUP-ID')
|
|
132
|
+
.add('URI');
|
|
133
|
+
return this.toString(attributesToSkip);
|
|
134
|
+
}
|
|
135
|
+
|
|
123
136
|
/**
|
|
124
137
|
* Adds an attribute to an HLS Tag.
|
|
125
138
|
*
|
|
@@ -203,48 +216,20 @@ shaka.hls.Segment = class {
|
|
|
203
216
|
/**
|
|
204
217
|
* Creates an HLS segment object.
|
|
205
218
|
*
|
|
206
|
-
* @param {string} absoluteMediaPlaylistUri An absolute Media Playlist URI.
|
|
207
219
|
* @param {string} verbatimSegmentUri verbatim segment URI.
|
|
208
220
|
* @param {!Array.<shaka.hls.Tag>} tags
|
|
209
221
|
* @param {!Array.<shaka.hls.Tag>=} partialSegments
|
|
210
222
|
*/
|
|
211
|
-
constructor(
|
|
212
|
-
partialSegments=[]) {
|
|
223
|
+
constructor(verbatimSegmentUri, tags, partialSegments=[]) {
|
|
213
224
|
/** @const {!Array.<shaka.hls.Tag>} */
|
|
214
225
|
this.tags = tags;
|
|
215
226
|
|
|
216
|
-
/** @
|
|
217
|
-
this.
|
|
218
|
-
|
|
219
|
-
/** @type {?string} */
|
|
220
|
-
this.absoluteMediaPlaylistUri_ = absoluteMediaPlaylistUri;
|
|
221
|
-
|
|
222
|
-
/** @type {?string} */
|
|
223
|
-
this.verbatimSegmentUri_ = verbatimSegmentUri;
|
|
227
|
+
/** @const {?string} */
|
|
228
|
+
this.verbatimSegmentUri = verbatimSegmentUri;
|
|
224
229
|
|
|
225
230
|
/** @type {!Array.<shaka.hls.Tag>} */
|
|
226
231
|
this.partialSegments = partialSegments;
|
|
227
232
|
}
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Returns an absolute URI.
|
|
231
|
-
*
|
|
232
|
-
* @return {string}
|
|
233
|
-
*/
|
|
234
|
-
get absoluteUri() {
|
|
235
|
-
if (!this.absoluteUri_ &&
|
|
236
|
-
this.absoluteMediaPlaylistUri_ && this.verbatimSegmentUri_) {
|
|
237
|
-
goog.asserts.assert(this.absoluteMediaPlaylistUri_,
|
|
238
|
-
'An absolute Media Playlist URI should be defined!');
|
|
239
|
-
goog.asserts.assert(this.verbatimSegmentUri_,
|
|
240
|
-
'An verbatim segment URI should be defined!');
|
|
241
|
-
this.absoluteUri_ = shaka.hls.Utils.constructAbsoluteUri(
|
|
242
|
-
this.absoluteMediaPlaylistUri_, this.verbatimSegmentUri_);
|
|
243
|
-
this.absoluteMediaPlaylistUri_ = null;
|
|
244
|
-
this.verbatimSegmentUri_ = null;
|
|
245
|
-
}
|
|
246
|
-
return this.absoluteUri_ || '';
|
|
247
|
-
}
|
|
248
233
|
};
|
|
249
234
|
|
|
250
235
|
|