shaka-player 4.3.13 → 4.3.15
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/ISSUE_TEMPLATE/question.md +7 -0
- package/.github/workflows/release-please.yaml +2 -27
- package/.github/workflows/shaka-bot-commands/lib.sh +37 -12
- package/.github/workflows/shaka-bot-commands/main.sh +4 -2
- package/.github/workflows/talk-to-shaka-bot.yaml +1 -0
- package/AUTHORS +5 -0
- package/CHANGELOG.md +96 -0
- package/CODE_OF_CONDUCT.md +1 -1
- package/CONTRIBUTORS +6 -0
- package/README.md +2 -0
- package/demo/common/asset.js +0 -1
- package/demo/common/assets.js +0 -1
- package/demo/custom.js +2 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +1 -1
- package/dist/demo.compiled.debug.map +1 -1
- package/dist/demo.compiled.js +1 -1
- package/dist/demo.compiled.map +1 -1
- package/dist/deps.js +6 -6
- package/dist/locales.js +30 -30
- package/dist/receiver.compiled.debug.map +1 -1
- package/dist/receiver.compiled.map +1 -1
- package/dist/shaka-player.compiled.d.ts +25 -5
- package/dist/shaka-player.compiled.debug.d.ts +25 -5
- package/dist/shaka-player.compiled.debug.externs.js +73 -45
- package/dist/shaka-player.compiled.debug.js +426 -406
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +73 -45
- package/dist/shaka-player.compiled.js +912 -903
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +37 -6
- package/dist/shaka-player.ui.debug.d.ts +37 -6
- package/dist/shaka-player.ui.debug.externs.js +74 -45
- package/dist/shaka-player.ui.debug.js +449 -428
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +74 -45
- package/dist/shaka-player.ui.js +1060 -1051
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/ad_monetization.md +54 -0
- package/docs/tutorials/fairplay.md +2 -2
- package/docs/tutorials/index.json +1 -0
- package/docs/tutorials/plugins.md +4 -0
- package/docs/tutorials/text-displayer.md +15 -0
- package/docs/tutorials/ui-customization.md +29 -0
- package/docs/tutorials/ui.md +4 -1
- package/externs/lcevc.js +6 -0
- package/externs/shaka/manifest_parser.js +8 -0
- package/externs/shaka/player.js +1 -1
- package/externs/shaka/text.js +3 -1
- package/lib/abr/simple_abr_manager.js +1 -1
- package/lib/ads/client_side_ad.js +9 -0
- package/lib/ads/client_side_ad_manager.js +7 -2
- package/lib/ads/server_side_ad_manager.js +4 -0
- package/lib/cast/cast_proxy.js +18 -0
- package/lib/cea/cea608_memory.js +1 -1
- package/lib/cea/cea_decoder.js +11 -1
- package/lib/dash/dash_parser.js +75 -41
- package/lib/dash/mpd_utils.js +39 -27
- package/lib/deprecate/deprecate.js +1 -1
- package/lib/hls/hls_parser.js +106 -28
- package/lib/hls/hls_utils.js +5 -5
- package/lib/media/content_workarounds.js +30 -0
- package/lib/media/drm_engine.js +16 -12
- package/lib/media/manifest_parser.js +2 -1
- package/lib/media/media_source_engine.js +4 -2
- package/lib/media/play_rate_controller.js +1 -0
- package/lib/media/presentation_timeline.js +11 -0
- package/lib/media/quality_observer.js +1 -1
- package/lib/media/segment_reference.js +5 -2
- package/lib/media/streaming_engine.js +50 -30
- package/lib/media/transmuxer.js +1 -1
- package/lib/media/video_wrapper.js +4 -3
- package/lib/offline/offline_manifest_parser.js +5 -0
- package/lib/offline/session_deleter.js +0 -8
- package/lib/offline/storage.js +4 -1
- package/lib/player.js +80 -19
- package/lib/polyfill/media_capabilities.js +23 -3
- package/lib/polyfill/mediasource.js +5 -36
- package/lib/text/mp4_ttml_parser.js +2 -2
- package/lib/text/simple_text_displayer.js +7 -6
- package/lib/text/srt_text_parser.js +2 -2
- package/lib/text/text_engine.js +3 -2
- package/lib/text/ttml_text_parser.js +33 -5
- package/lib/text/ui_text_displayer.js +81 -15
- package/lib/text/vtt_text_parser.js +17 -3
- package/lib/util/buffer_utils.js +26 -4
- package/lib/util/cmcd_manager.js +10 -0
- package/lib/util/error.js +1 -0
- package/lib/util/fairplay_utils.js +1 -1
- package/lib/util/manifest_parser_utils.js +14 -8
- package/lib/util/object_utils.js +1 -1
- package/lib/util/periods.js +91 -36
- package/lib/util/platform.js +39 -2
- package/lib/util/player_configuration.js +5 -3
- package/lib/util/stream_utils.js +36 -28
- package/lib/util/xml_utils.js +5 -0
- package/package.json +3 -3
- package/test/cea/cea_decoder_unit.js +40 -0
- package/test/dash/dash_parser_live_unit.js +5 -8
- package/test/hls/hls_parser_unit.js +78 -3
- package/test/media/buffering_observer_unit.js +13 -0
- package/test/media/content_workarounds_unit.js +1 -1
- package/test/media/drm_engine_unit.js +30 -3
- package/test/media/media_source_engine_unit.js +1 -1
- package/test/media/transmuxer_integration.js +2 -2
- package/test/offline/storage_integration.js +3 -0
- package/test/player_integration.js +49 -41
- package/test/player_load_graph_integration.js +13 -7
- package/test/player_src_equals_integration.js +2 -2
- package/test/player_unit.js +40 -3
- package/test/polyfill/media_capabilities_unit.js +12 -6
- package/test/test/util/fake_drm_engine.js +7 -0
- package/test/test/util/layout_tests.js +2 -1
- package/test/test/util/simple_fakes.js +2 -2
- package/test/test/util/test_scheme.js +3 -0
- package/test/test/util/waiter.js +5 -0
- package/test/text/mp4_ttml_parser_unit.js +4 -4
- package/test/text/simple_text_displayer_unit.js +1 -1
- package/test/text/srt_text_parser_unit.js +1 -1
- package/test/text/text_engine_unit.js +6 -0
- package/test/text/ttml_text_parser_unit.js +49 -18
- package/test/text/ui_text_displayer_unit.js +9 -0
- package/test/text/vtt_text_parser_unit.js +31 -0
- package/test/util/buffer_utils_unit.js +1 -1
- package/test/util/periods_unit.js +113 -0
- package/third_party/closure-uri/uri.js +1 -1
- package/ui/externs/ui.js +24 -0
- package/ui/language_utils.js +11 -5
- package/ui/less/containers.less +1 -0
- package/ui/play_button.js +20 -0
- package/ui/playback_rate_selection.js +4 -0
- package/ui/presentation_time.js +5 -5
- package/ui/small_play_button.js +2 -2
- package/ui/volume_bar.js +10 -6
- /package/.github/{config.yml → ISSUE_TEMPLATE/config.yml} +0 -0
package/ui/language_utils.js
CHANGED
|
@@ -55,7 +55,11 @@ shaka.ui.LanguageUtils = class {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const getCombination = (language, rolesString) => {
|
|
58
|
+
const getCombination = (language, rolesString, label) => {
|
|
59
|
+
if (label &&
|
|
60
|
+
trackLabelFormat == shaka.ui.Overlay.TrackLabelFormat.LABEL) {
|
|
61
|
+
return language + ': ' + label + ': ' + rolesString;
|
|
62
|
+
}
|
|
59
63
|
return language + ': ' + rolesString;
|
|
60
64
|
};
|
|
61
65
|
|
|
@@ -72,7 +76,8 @@ shaka.ui.LanguageUtils = class {
|
|
|
72
76
|
/** @type {!Set.<string>} */
|
|
73
77
|
const combinationsMade = new Set();
|
|
74
78
|
const selectedCombination = selectedTrack ? getCombination(
|
|
75
|
-
selectedTrack.language, getRolesString(selectedTrack)
|
|
79
|
+
selectedTrack.language, getRolesString(selectedTrack),
|
|
80
|
+
selectedTrack.label) : '';
|
|
76
81
|
|
|
77
82
|
for (const track of tracks) {
|
|
78
83
|
const language = track.language;
|
|
@@ -80,7 +85,8 @@ shaka.ui.LanguageUtils = class {
|
|
|
80
85
|
const LocIds = shaka.ui.Locales.Ids;
|
|
81
86
|
const forcedString = localization.resolve(LocIds.SUBTITLE_FORCED);
|
|
82
87
|
const rolesString = getRolesString(track);
|
|
83
|
-
const
|
|
88
|
+
const label = track.label;
|
|
89
|
+
const combinationName = getCombination(language, rolesString, label);
|
|
84
90
|
if (combinationsMade.has(combinationName)) {
|
|
85
91
|
continue;
|
|
86
92
|
}
|
|
@@ -124,8 +130,8 @@ shaka.ui.LanguageUtils = class {
|
|
|
124
130
|
}
|
|
125
131
|
break;
|
|
126
132
|
case shaka.ui.Overlay.TrackLabelFormat.LABEL:
|
|
127
|
-
if (
|
|
128
|
-
span.textContent =
|
|
133
|
+
if (label) {
|
|
134
|
+
span.textContent = label;
|
|
129
135
|
} else {
|
|
130
136
|
// Fallback behavior. This probably shouldn't happen.
|
|
131
137
|
shaka.log.alwaysWarn('Track #' + track.id + ' does not have a ' +
|
package/ui/less/containers.less
CHANGED
package/ui/play_button.js
CHANGED
|
@@ -16,6 +16,7 @@ goog.requireType('shaka.ui.Controls');
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @extends {shaka.ui.Element}
|
|
19
|
+
* @implements {shaka.extern.IUIPlayButton}
|
|
19
20
|
* @export
|
|
20
21
|
*/
|
|
21
22
|
shaka.ui.PlayButton = class extends shaka.ui.Element {
|
|
@@ -72,6 +73,11 @@ shaka.ui.PlayButton = class extends shaka.ui.Element {
|
|
|
72
73
|
this.updateIcon();
|
|
73
74
|
});
|
|
74
75
|
|
|
76
|
+
this.eventManager.listen(this.adManager, AdManager.AD_STOPPED, () => {
|
|
77
|
+
this.updateAriaLabel();
|
|
78
|
+
this.updateIcon();
|
|
79
|
+
});
|
|
80
|
+
|
|
75
81
|
this.eventManager.listen(this.button, 'click', () => {
|
|
76
82
|
if (this.ad && this.ad.isLinear()) {
|
|
77
83
|
this.controls.playPauseAd();
|
|
@@ -90,6 +96,7 @@ shaka.ui.PlayButton = class extends shaka.ui.Element {
|
|
|
90
96
|
/**
|
|
91
97
|
* @return {boolean}
|
|
92
98
|
* @protected
|
|
99
|
+
* @override
|
|
93
100
|
*/
|
|
94
101
|
isPaused() {
|
|
95
102
|
if (this.ad && this.ad.isLinear()) {
|
|
@@ -99,6 +106,19 @@ shaka.ui.PlayButton = class extends shaka.ui.Element {
|
|
|
99
106
|
return this.controls.presentationIsPaused();
|
|
100
107
|
}
|
|
101
108
|
|
|
109
|
+
/**
|
|
110
|
+
* @return {boolean}
|
|
111
|
+
* @protected
|
|
112
|
+
* @override
|
|
113
|
+
*/
|
|
114
|
+
isEnded() {
|
|
115
|
+
if (this.ad && this.ad.isLinear()) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return this.video.ended;
|
|
120
|
+
}
|
|
121
|
+
|
|
102
122
|
/**
|
|
103
123
|
* Called when the button's aria label needs to change.
|
|
104
124
|
* To be overridden by subclasses.
|
|
@@ -44,6 +44,10 @@ shaka.ui.PlaybackRateSelection = class extends shaka.ui.SettingsMenu {
|
|
|
44
44
|
this.updateLocalizedStrings_();
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
+
this.eventManager.listen(this.player, 'loaded', () => {
|
|
48
|
+
this.updatePlaybackRateSelection_(this.player.getPlaybackRate());
|
|
49
|
+
});
|
|
50
|
+
|
|
47
51
|
this.eventManager.listen(this.player, 'ratechange', () => {
|
|
48
52
|
this.updatePlaybackRateSelection_(this.player.getPlaybackRate());
|
|
49
53
|
});
|
package/ui/presentation_time.js
CHANGED
|
@@ -64,7 +64,6 @@ shaka.ui.PresentationTimeTracker = class extends shaka.ui.Element {
|
|
|
64
64
|
updateTime_() {
|
|
65
65
|
const isSeeking = this.controls.isSeeking();
|
|
66
66
|
let displayTime = this.controls.getDisplayTime();
|
|
67
|
-
const duration = this.video.duration;
|
|
68
67
|
const seekRange = this.player.seekRange();
|
|
69
68
|
const seekRangeSize = seekRange.end - seekRange.start;
|
|
70
69
|
const Utils = shaka.ui.Utils;
|
|
@@ -89,11 +88,12 @@ shaka.ui.PresentationTimeTracker = class extends shaka.ui.Element {
|
|
|
89
88
|
this.currentTime_.disabled = true;
|
|
90
89
|
}
|
|
91
90
|
} else {
|
|
92
|
-
const showHour =
|
|
91
|
+
const showHour = seekRangeSize >= 3600;
|
|
93
92
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
const currentTime = Math.max(0, displayTime - seekRange.start);
|
|
94
|
+
let value = Utils.buildTimeString(currentTime, showHour);
|
|
95
|
+
if (seekRangeSize) {
|
|
96
|
+
value += ' / ' + Utils.buildTimeString(seekRangeSize, showHour);
|
|
97
97
|
}
|
|
98
98
|
this.setValue_(value);
|
|
99
99
|
this.currentTime_.disabled = true;
|
package/ui/small_play_button.js
CHANGED
|
@@ -38,7 +38,7 @@ shaka.ui.SmallPlayButton = class extends shaka.ui.PlayButton {
|
|
|
38
38
|
/** @override */
|
|
39
39
|
updateIcon() {
|
|
40
40
|
const Icons = shaka.ui.Enums.MaterialDesignIcons;
|
|
41
|
-
if (this.
|
|
41
|
+
if (this.isEnded()) {
|
|
42
42
|
this.button.textContent = Icons.REPLAY;
|
|
43
43
|
} else {
|
|
44
44
|
this.button.textContent = this.isPaused() ? Icons.PLAY : Icons.PAUSE;
|
|
@@ -48,7 +48,7 @@ shaka.ui.SmallPlayButton = class extends shaka.ui.PlayButton {
|
|
|
48
48
|
/** @override */
|
|
49
49
|
updateAriaLabel() {
|
|
50
50
|
const LocIds = shaka.ui.Locales.Ids;
|
|
51
|
-
if (this.
|
|
51
|
+
if (this.isEnded()) {
|
|
52
52
|
this.button.ariaLabel = this.localization.resolve(LocIds.REPLAY);
|
|
53
53
|
} else {
|
|
54
54
|
const label = this.isPaused() ? LocIds.PLAY : LocIds.PAUSE;
|
package/ui/volume_bar.js
CHANGED
|
@@ -32,6 +32,10 @@ shaka.ui.VolumeBar = class extends shaka.ui.RangeElement {
|
|
|
32
32
|
/** @private {!shaka.extern.UIConfiguration} */
|
|
33
33
|
this.config_ = this.controls.getConfig();
|
|
34
34
|
|
|
35
|
+
// We use a range of 100 to avoid problems with Firefox.
|
|
36
|
+
// See https://github.com/shaka-project/shaka-player/issues/3987
|
|
37
|
+
this.setRange(0, 100);
|
|
38
|
+
|
|
35
39
|
this.eventManager.listen(this.video,
|
|
36
40
|
'volumechange',
|
|
37
41
|
() => this.onPresentationVolumeChange_());
|
|
@@ -74,9 +78,9 @@ shaka.ui.VolumeBar = class extends shaka.ui.RangeElement {
|
|
|
74
78
|
*/
|
|
75
79
|
onChange() {
|
|
76
80
|
if (this.ad && this.ad.isLinear()) {
|
|
77
|
-
this.ad.setVolume(this.getValue());
|
|
81
|
+
this.ad.setVolume(this.getValue() / 100);
|
|
78
82
|
} else {
|
|
79
|
-
this.video.volume = this.getValue();
|
|
83
|
+
this.video.volume = this.getValue() / 100;
|
|
80
84
|
if (this.video.volume == 0) {
|
|
81
85
|
this.video.muted = true;
|
|
82
86
|
} else {
|
|
@@ -90,7 +94,7 @@ shaka.ui.VolumeBar = class extends shaka.ui.RangeElement {
|
|
|
90
94
|
if (this.video.muted) {
|
|
91
95
|
this.setValue(0);
|
|
92
96
|
} else {
|
|
93
|
-
this.setValue(this.video.volume);
|
|
97
|
+
this.setValue(this.video.volume * 100);
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
this.updateColors_();
|
|
@@ -102,7 +106,7 @@ shaka.ui.VolumeBar = class extends shaka.ui.RangeElement {
|
|
|
102
106
|
'This.ad should exist at this point!');
|
|
103
107
|
|
|
104
108
|
const volume = this.ad.getVolume();
|
|
105
|
-
this.setValue(volume);
|
|
109
|
+
this.setValue(volume * 100);
|
|
106
110
|
this.updateColors_();
|
|
107
111
|
}
|
|
108
112
|
|
|
@@ -110,8 +114,8 @@ shaka.ui.VolumeBar = class extends shaka.ui.RangeElement {
|
|
|
110
114
|
updateColors_() {
|
|
111
115
|
const colors = this.config_.volumeBarColors;
|
|
112
116
|
const gradient = ['to right'];
|
|
113
|
-
gradient.push(colors.level +
|
|
114
|
-
gradient.push(colors.base +
|
|
117
|
+
gradient.push(colors.level + this.getValue() + '%');
|
|
118
|
+
gradient.push(colors.base + this.getValue() + '%');
|
|
115
119
|
gradient.push(colors.base + '100%');
|
|
116
120
|
|
|
117
121
|
this.container.style.background =
|
|
File without changes
|