shaka-player 4.6.7 → 4.6.9
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 +39 -0
- package/README.md +3 -1
- package/dist/locales.js +31 -31
- package/dist/shaka-player.compiled.d.ts +4 -0
- package/dist/shaka-player.compiled.debug.d.ts +4 -0
- package/dist/shaka-player.compiled.debug.externs.js +5 -0
- package/dist/shaka-player.compiled.debug.js +117 -114
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +5 -0
- package/dist/shaka-player.compiled.js +677 -675
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +4 -0
- package/dist/shaka-player.ui.debug.d.ts +4 -0
- package/dist/shaka-player.ui.debug.externs.js +5 -0
- package/dist/shaka-player.ui.debug.js +141 -136
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +5 -0
- package/dist/shaka-player.ui.js +765 -763
- package/dist/shaka-player.ui.map +3 -3
- package/docs/tutorials/index.json +1 -0
- package/docs/tutorials/text-displayer.md +15 -0
- package/lib/ads/client_side_ad.js +4 -2
- package/lib/ads/client_side_ad_manager.js +5 -3
- package/lib/cast/cast_proxy.js +18 -0
- package/lib/cea/cea608_memory.js +1 -1
- package/lib/cea/cea_decoder.js +1 -1
- package/lib/hls/hls_parser.js +16 -0
- package/lib/hls/hls_utils.js +5 -5
- package/lib/media/media_source_engine.js +4 -4
- package/lib/media/play_rate_controller.js +1 -0
- package/lib/media/presentation_timeline.js +11 -0
- package/lib/offline/session_deleter.js +0 -8
- package/lib/player.js +41 -6
- package/lib/polyfill/patchedmediakeys_apple.js +0 -6
- package/lib/text/ttml_text_parser.js +5 -0
- package/lib/text/vtt_text_parser.js +5 -0
- package/lib/util/language_utils.js +7 -8
- package/package.json +1 -1
- package/test/cea/cea_decoder_unit.js +36 -0
- package/test/media/media_source_engine_unit.js +26 -3
- package/test/player_load_graph_integration.js +5 -0
- package/test/player_unit.js +17 -0
- package/test/text/ttml_text_parser_unit.js +16 -16
- package/ui/play_button.js +17 -0
- package/ui/playback_rate_selection.js +4 -0
- package/ui/small_play_button.js +2 -2
|
@@ -638,8 +638,8 @@ describe('TtmlTextParser', () => {
|
|
|
638
638
|
id: 'subtitleArea',
|
|
639
639
|
viewportAnchorX: 50,
|
|
640
640
|
viewportAnchorY: 16,
|
|
641
|
-
width:
|
|
642
|
-
height:
|
|
641
|
+
width: 50,
|
|
642
|
+
height: 84,
|
|
643
643
|
},
|
|
644
644
|
startTime: 62.05,
|
|
645
645
|
endTime: 3723.2,
|
|
@@ -666,8 +666,8 @@ describe('TtmlTextParser', () => {
|
|
|
666
666
|
region: {
|
|
667
667
|
viewportAnchorX: 50,
|
|
668
668
|
viewportAnchorY: 16,
|
|
669
|
-
width:
|
|
670
|
-
height:
|
|
669
|
+
width: 50,
|
|
670
|
+
height: 84,
|
|
671
671
|
},
|
|
672
672
|
startTime: 62.05,
|
|
673
673
|
endTime: 3723.2,
|
|
@@ -694,8 +694,8 @@ describe('TtmlTextParser', () => {
|
|
|
694
694
|
region: {
|
|
695
695
|
viewportAnchorX: 50,
|
|
696
696
|
viewportAnchorY: 16,
|
|
697
|
-
width:
|
|
698
|
-
height:
|
|
697
|
+
width: 50,
|
|
698
|
+
height: 84,
|
|
699
699
|
},
|
|
700
700
|
startTime: 62.05,
|
|
701
701
|
endTime: 3723.2,
|
|
@@ -872,8 +872,8 @@ describe('TtmlTextParser', () => {
|
|
|
872
872
|
viewportAnchorY: 16,
|
|
873
873
|
regionAnchorX: 0,
|
|
874
874
|
regionAnchorY: 0,
|
|
875
|
-
width:
|
|
876
|
-
height:
|
|
875
|
+
width: 50,
|
|
876
|
+
height: 84,
|
|
877
877
|
heightUnits: CueRegion.units.PERCENTAGE,
|
|
878
878
|
widthUnits: CueRegion.units.PERCENTAGE,
|
|
879
879
|
viewportAnchorUnits: CueRegion.units.PERCENTAGE,
|
|
@@ -945,8 +945,8 @@ describe('TtmlTextParser', () => {
|
|
|
945
945
|
id: 'subtitleArea',
|
|
946
946
|
viewportAnchorX: 50,
|
|
947
947
|
viewportAnchorY: 16,
|
|
948
|
-
width:
|
|
949
|
-
height:
|
|
948
|
+
width: 50,
|
|
949
|
+
height: 84,
|
|
950
950
|
},
|
|
951
951
|
startTime: 62.05,
|
|
952
952
|
endTime: 3723.2,
|
|
@@ -973,8 +973,8 @@ describe('TtmlTextParser', () => {
|
|
|
973
973
|
region: {
|
|
974
974
|
viewportAnchorX: 50,
|
|
975
975
|
viewportAnchorY: 16,
|
|
976
|
-
width:
|
|
977
|
-
height:
|
|
976
|
+
width: 50,
|
|
977
|
+
height: 84,
|
|
978
978
|
},
|
|
979
979
|
startTime: 62.05,
|
|
980
980
|
endTime: 3723.2,
|
|
@@ -1001,8 +1001,8 @@ describe('TtmlTextParser', () => {
|
|
|
1001
1001
|
region: {
|
|
1002
1002
|
viewportAnchorX: 50,
|
|
1003
1003
|
viewportAnchorY: 16,
|
|
1004
|
-
width:
|
|
1005
|
-
height:
|
|
1004
|
+
width: 50,
|
|
1005
|
+
height: 84,
|
|
1006
1006
|
},
|
|
1007
1007
|
startTime: 62.05,
|
|
1008
1008
|
endTime: 3723.2,
|
|
@@ -1032,8 +1032,8 @@ describe('TtmlTextParser', () => {
|
|
|
1032
1032
|
id: 'subtitleArea',
|
|
1033
1033
|
viewportAnchorX: 12.2,
|
|
1034
1034
|
viewportAnchorY: 50.005,
|
|
1035
|
-
width:
|
|
1036
|
-
height:
|
|
1035
|
+
width: 87.8,
|
|
1036
|
+
height: 49.995,
|
|
1037
1037
|
},
|
|
1038
1038
|
startTime: 62.05,
|
|
1039
1039
|
endTime: 3723.2,
|
package/ui/play_button.js
CHANGED
|
@@ -72,6 +72,11 @@ shaka.ui.PlayButton = class extends shaka.ui.Element {
|
|
|
72
72
|
this.updateIcon();
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
this.eventManager.listen(this.adManager, AdManager.AD_STOPPED, () => {
|
|
76
|
+
this.updateAriaLabel();
|
|
77
|
+
this.updateIcon();
|
|
78
|
+
});
|
|
79
|
+
|
|
75
80
|
this.eventManager.listen(this.button, 'click', () => {
|
|
76
81
|
if (this.ad && this.ad.isLinear()) {
|
|
77
82
|
this.controls.playPauseAd();
|
|
@@ -99,6 +104,18 @@ shaka.ui.PlayButton = class extends shaka.ui.Element {
|
|
|
99
104
|
return this.controls.presentationIsPaused();
|
|
100
105
|
}
|
|
101
106
|
|
|
107
|
+
/**
|
|
108
|
+
* @return {boolean}
|
|
109
|
+
* @protected
|
|
110
|
+
*/
|
|
111
|
+
isEnded() {
|
|
112
|
+
if (this.ad && this.ad.isLinear()) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return this.video.ended;
|
|
117
|
+
}
|
|
118
|
+
|
|
102
119
|
/**
|
|
103
120
|
* Called when the button's aria label needs to change.
|
|
104
121
|
* 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/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;
|