shaka-player 3.1.5 → 3.2.3
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/CHANGELOG.md +129 -6
- package/README.md +4 -4
- package/build/types/polyfill +1 -0
- package/demo/common/asset.js +9 -7
- package/demo/common/assets.js +10 -1
- package/demo/common/message_ids.js +2 -1
- package/demo/config.js +5 -2
- package/demo/index.html +1 -1
- package/demo/locales/en.json +2 -1
- package/demo/locales/source.json +8 -4
- package/demo/main.js +2 -1
- package/dist/demo.compiled.debug.js +14 -14
- package/dist/demo.compiled.debug.map +2 -2
- package/dist/demo.compiled.js +14 -14
- package/dist/demo.compiled.map +2 -2
- package/dist/deps.js +21 -20
- package/dist/locales.js +30 -30
- package/dist/receiver.compiled.debug.js +8 -8
- package/dist/receiver.compiled.debug.map +2 -2
- package/dist/receiver.compiled.js +8 -8
- package/dist/receiver.compiled.map +2 -2
- package/dist/shaka-player.compiled.d.ts +63 -10
- package/dist/shaka-player.compiled.debug.d.ts +63 -10
- package/dist/shaka-player.compiled.debug.externs.js +786 -716
- package/dist/shaka-player.compiled.debug.js +563 -534
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +786 -716
- package/dist/shaka-player.compiled.js +820 -809
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +63 -10
- package/dist/shaka-player.ui.debug.d.ts +63 -10
- package/dist/shaka-player.ui.debug.externs.js +542 -472
- package/dist/shaka-player.ui.debug.js +594 -566
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +542 -472
- package/dist/shaka-player.ui.js +938 -927
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/ui.md +5 -5
- package/externs/aria.js +6 -0
- package/externs/shaka/ads.js +24 -1
- package/externs/shaka/manifest.js +6 -1
- package/externs/shaka/offline.js +5 -0
- package/externs/shaka/player.js +61 -9
- package/externs/shaka/text.js +10 -10
- package/externs/texttrack.js +3 -0
- package/lib/ads/ad_manager.js +16 -15
- package/lib/ads/client_side_ad_manager.js +6 -2
- package/lib/ads/server_side_ad_manager.js +19 -2
- package/lib/cast/cast_proxy.js +8 -0
- package/lib/cast/cast_utils.js +6 -1
- package/lib/cea/cea608_data_channel.js +56 -56
- package/lib/cea/cea608_memory.js +33 -33
- package/lib/cea/cea708_service.js +43 -43
- package/lib/cea/cea708_window.js +38 -38
- package/lib/cea/cea_decoder.js +13 -14
- package/lib/cea/cea_utils.js +23 -23
- package/lib/cea/dtvcc_packet_builder.js +7 -7
- package/lib/cea/i_caption_decoder.js +2 -3
- package/lib/cea/i_cea_parser.js +2 -2
- package/lib/cea/mp4_cea_parser.js +6 -6
- package/lib/dash/dash_parser.js +5 -0
- package/lib/hls/hls_parser.js +159 -12
- package/lib/media/closed_caption_parser.js +1 -2
- package/lib/media/drm_engine.js +162 -192
- package/lib/media/segment_index.js +4 -1
- package/lib/media/segment_reference.js +37 -2
- package/lib/media/streaming_engine.js +6 -6
- package/lib/net/networking_engine.js +1 -0
- package/lib/offline/download_manager.js +1 -2
- 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 +3 -1
- package/lib/offline/storage.js +12 -14
- package/lib/player.js +426 -149
- package/lib/polyfill/aria.js +82 -0
- package/lib/routing/walker.js +2 -3
- package/lib/text/srt_text_parser.js +4 -4
- package/lib/text/text_engine.js +2 -2
- package/lib/text/vtt_text_parser.js +2 -2
- package/lib/text/web_vtt_generator.js +55 -12
- package/lib/util/error.js +6 -0
- package/lib/util/manifest_parser_utils.js +1 -0
- package/lib/util/mp4_box_parsers.js +20 -20
- package/lib/util/multi_map.js +8 -0
- package/lib/util/player_configuration.js +13 -1
- package/lib/util/stream_utils.js +168 -88
- package/lib/util/xml_utils.js +31 -12
- package/package.json +1 -1
- package/roadmap.md +24 -22
- package/shaka-player.uncompiled.js +1 -0
- package/test/cast/cast_utils_unit.js +1 -0
- package/test/cea/cea608_memory_unit.js +1 -1
- package/test/cea/cea708_service_unit.js +8 -8
- package/test/cea/cea708_window_unit.js +6 -6
- package/test/cea/cea_decoder_unit.js +1 -1
- package/test/cea/dtvcc_packet_builder_unit.js +2 -2
- package/test/dash/dash_parser_manifest_unit.js +43 -1
- package/test/hls/hls_parser_unit.js +250 -0
- package/test/media/drm_engine_integration.js +86 -12
- package/test/media/drm_engine_unit.js +310 -450
- package/test/offline/manifest_convert_unit.js +2 -0
- package/test/offline/storage_integration.js +9 -19
- package/test/player_integration.js +85 -0
- package/test/player_src_equals_integration.js +85 -0
- package/test/player_unit.js +25 -37
- package/test/test/assets/chapters.srt +11 -0
- package/test/test/assets/chapters.vtt +10 -0
- package/test/test/assets/chapters2.vtt +10 -0
- package/test/test/util/cea_utils.js +12 -12
- package/test/test/util/fake_ad_manager.js +7 -0
- package/test/test/util/manifest_generator.js +2 -0
- package/test/test/util/manifest_parser_util.js +3 -1
- package/test/text/web_vtt_generator_unit.js +81 -7
- package/test/util/stream_utils_unit.js +118 -10
- package/ui/airplay_button.js +1 -1
- package/ui/audio_language_selection.js +2 -5
- package/ui/cast_button.js +4 -6
- package/ui/constants.js +0 -3
- package/ui/fast_forward_button.js +2 -3
- package/ui/fullscreen_button.js +1 -3
- package/ui/language_utils.js +1 -1
- package/ui/loop_button.js +1 -3
- package/ui/mute_button.js +1 -3
- package/ui/overflow_menu.js +2 -3
- package/ui/pip_button.js +5 -7
- package/ui/playback_rate_selection.js +3 -6
- package/ui/presentation_time.js +1 -3
- package/ui/resolution_selection.js +4 -7
- package/ui/rewind_button.js +2 -3
- package/ui/seek_bar.js +2 -4
- package/ui/spacer.js +1 -1
- package/ui/text_selection.js +8 -11
- package/ui/ui_utils.js +1 -1
- package/ui/volume_bar.js +1 -3
|
@@ -1004,10 +1004,10 @@ shaka.media.StreamingEngine = class {
|
|
|
1004
1004
|
if (bufferedAhead >= scaledBufferingGoal) {
|
|
1005
1005
|
shaka.log.v2(logPrefix, 'buffering goal met');
|
|
1006
1006
|
|
|
1007
|
-
// Do not try to predict the next update. Just poll
|
|
1008
|
-
// The playback rate can change at any time, so
|
|
1009
|
-
// could be terribly invalid soon.
|
|
1010
|
-
return
|
|
1007
|
+
// Do not try to predict the next update. Just poll according to
|
|
1008
|
+
// configuration (seconds). The playback rate can change at any time, so
|
|
1009
|
+
// any prediction we make now could be terribly invalid soon.
|
|
1010
|
+
return this.config_.updateIntervalSeconds / 2;
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
1013
|
const bufferEnd =
|
|
@@ -1019,7 +1019,7 @@ shaka.media.StreamingEngine = class {
|
|
|
1019
1019
|
// In any case just try again... if the manifest is incomplete or is not
|
|
1020
1020
|
// being updated then we'll idle forever; otherwise, we'll end up getting
|
|
1021
1021
|
// a SegmentReference eventually.
|
|
1022
|
-
return
|
|
1022
|
+
return this.config_.updateIntervalSeconds;
|
|
1023
1023
|
}
|
|
1024
1024
|
|
|
1025
1025
|
// Do not let any one stream get far ahead of any other.
|
|
@@ -1050,7 +1050,7 @@ shaka.media.StreamingEngine = class {
|
|
|
1050
1050
|
// For example, let video buffering catch up to audio buffering before
|
|
1051
1051
|
// fetching another audio segment.
|
|
1052
1052
|
shaka.log.v2(logPrefix, 'waiting for other streams to buffer');
|
|
1053
|
-
return
|
|
1053
|
+
return this.config_.updateIntervalSeconds;
|
|
1054
1054
|
}
|
|
1055
1055
|
|
|
1056
1056
|
const p = this.fetchAndAppend_(mediaState, presentationTime, reference);
|
|
@@ -44,9 +44,8 @@ shaka.offline.DownloadManager = class {
|
|
|
44
44
|
|
|
45
45
|
/** @private {!shaka.util.Destroyer} */
|
|
46
46
|
this.destroyer_ = new shaka.util.Destroyer(() => {
|
|
47
|
-
const promises = Array.from(this.groups_.values());
|
|
48
47
|
// Add a "catch" block to stop errors from being returned.
|
|
49
|
-
return
|
|
48
|
+
return this.abortAll().catch(() => {});
|
|
50
49
|
});
|
|
51
50
|
|
|
52
51
|
/**
|
|
@@ -229,7 +229,9 @@ shaka.offline.ManifestConverter = class {
|
|
|
229
229
|
initSegmentReference,
|
|
230
230
|
segmentDB.timestampOffset,
|
|
231
231
|
segmentDB.appendWindowStart,
|
|
232
|
-
segmentDB.appendWindowEnd
|
|
232
|
+
segmentDB.appendWindowEnd,
|
|
233
|
+
/* partialReferences= */ [],
|
|
234
|
+
segmentDB.tilesLayout || '');
|
|
233
235
|
}
|
|
234
236
|
|
|
235
237
|
/**
|
package/lib/offline/storage.js
CHANGED
|
@@ -484,25 +484,23 @@ shaka.offline.Storage = class {
|
|
|
484
484
|
const maxHwRes = {width: Infinity, height: Infinity};
|
|
485
485
|
StreamUtils.filterByRestrictions(manifest, config.restrictions, maxHwRes);
|
|
486
486
|
|
|
487
|
-
// Filter the manifest based on what we know
|
|
488
|
-
// play later (no point storing something we can't play).
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
manifest, config.offline.usePersistentLicense);
|
|
492
|
-
} else {
|
|
493
|
-
StreamUtils.filterManifestByMediaSource(manifest);
|
|
494
|
-
// Filter the manifest based on what we know our drm system will support
|
|
495
|
-
// playing later.
|
|
496
|
-
StreamUtils.filterManifestByDrm(manifest, drmEngine);
|
|
497
|
-
}
|
|
487
|
+
// Filter the manifest based on what we know MediaCapabilities will be able
|
|
488
|
+
// to play later (no point storing something we can't play).
|
|
489
|
+
StreamUtils.filterManifestByMediaCapabilities(
|
|
490
|
+
manifest, config.offline.usePersistentLicense);
|
|
498
491
|
|
|
499
492
|
// Gather all tracks.
|
|
500
493
|
const allTracks = [];
|
|
501
494
|
|
|
502
495
|
// Choose the codec that has the lowest average bandwidth.
|
|
503
496
|
const preferredAudioChannelCount = config.preferredAudioChannelCount;
|
|
497
|
+
const preferredDecodingAttributes = config.preferredDecodingAttributes;
|
|
498
|
+
const preferredVideoCodecs = config.preferredVideoCodecs;
|
|
499
|
+
const preferredAudioCodecs = config.preferredAudioCodecs;
|
|
500
|
+
|
|
504
501
|
StreamUtils.chooseCodecsAndFilterManifest(
|
|
505
|
-
manifest,
|
|
502
|
+
manifest, preferredVideoCodecs, preferredAudioCodecs,
|
|
503
|
+
preferredAudioChannelCount, preferredDecodingAttributes);
|
|
506
504
|
|
|
507
505
|
for (const variant of manifest.variants) {
|
|
508
506
|
goog.asserts.assert(
|
|
@@ -1001,8 +999,7 @@ shaka.offline.Storage = class {
|
|
|
1001
999
|
|
|
1002
1000
|
drmEngine.configure(config.drm);
|
|
1003
1001
|
await drmEngine.initForStorage(
|
|
1004
|
-
manifest.variants, config.offline.usePersistentLicense
|
|
1005
|
-
config.useMediaCapabilities);
|
|
1002
|
+
manifest.variants, config.offline.usePersistentLicense);
|
|
1006
1003
|
await drmEngine.setServerCertificate();
|
|
1007
1004
|
await drmEngine.createOrLoad();
|
|
1008
1005
|
|
|
@@ -1204,6 +1201,7 @@ shaka.offline.Storage = class {
|
|
|
1204
1201
|
appendWindowStart: segment.appendWindowStart,
|
|
1205
1202
|
appendWindowEnd: segment.appendWindowEnd,
|
|
1206
1203
|
timestampOffset: segment.timestampOffset,
|
|
1204
|
+
tilesLayout: segment.tilesLayout,
|
|
1207
1205
|
dataKey,
|
|
1208
1206
|
});
|
|
1209
1207
|
});
|