shaka-player 4.9.28 → 4.9.30
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/README.md +2 -4
- package/dist/cast-boot.js +7 -0
- package/dist/deps.js +4 -4
- package/dist/locales.js +34 -34
- package/dist/shaka-player.compiled.debug.js +79 -76
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +699 -694
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.debug.js +97 -94
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +445 -440
- package/dist/shaka-player.ui.map +3 -3
- package/lib/dash/dash_parser.js +39 -11
- package/lib/dash/segment_template.js +1 -1
- package/lib/media/drm_engine.js +11 -0
- package/lib/media/media_source_engine.js +19 -30
- package/lib/media/playhead.js +3 -1
- package/lib/media/preload_manager.js +17 -0
- package/lib/media/presentation_timeline.js +7 -1
- package/lib/media/streaming_engine.js +43 -12
- package/lib/player.js +40 -32
- package/lib/polyfill/encryption_scheme.js +9 -0
- package/lib/polyfill/media_capabilities.js +8 -2
- package/lib/util/periods.js +3 -0
- package/lib/util/platform.js +12 -3
- package/lib/util/player_configuration.js +3 -1
- package/package.json +1 -1
- package/ui/externs/ui.js +2 -1
- package/ui/locales/zh-HK.json +30 -11
- package/ui/remote_button.js +3 -2
- package/ui/resolution_selection.js +4 -1
- package/ui/ui.js +6 -3
package/lib/util/platform.js
CHANGED
|
@@ -301,7 +301,8 @@ shaka.util.Platform = class {
|
|
|
301
301
|
!shaka.util.Platform.isPS4() &&
|
|
302
302
|
!shaka.util.Platform.isAmazonFireTV() &&
|
|
303
303
|
!shaka.util.Platform.isWPE() &&
|
|
304
|
-
!shaka.util.Platform.isZenterio()
|
|
304
|
+
!shaka.util.Platform.isZenterio() &&
|
|
305
|
+
!shaka.util.Platform.isSkyQ();
|
|
305
306
|
}
|
|
306
307
|
|
|
307
308
|
/**
|
|
@@ -346,6 +347,13 @@ shaka.util.Platform = class {
|
|
|
346
347
|
return shaka.util.Platform.userAgentContains_('SOPOpenBrowser');
|
|
347
348
|
}
|
|
348
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Check if the current platform is SkyQ STB.
|
|
352
|
+
*/
|
|
353
|
+
static isSkyQ() {
|
|
354
|
+
return shaka.util.Platform.userAgentContains_('Sky_STB');
|
|
355
|
+
}
|
|
356
|
+
|
|
349
357
|
/**
|
|
350
358
|
* Check if the current platform is Amazon Fire TV.
|
|
351
359
|
* https://developer.amazon.com/docs/fire-tv/identify-amazon-fire-tv-devices.html
|
|
@@ -621,7 +629,7 @@ shaka.util.Platform = class {
|
|
|
621
629
|
*
|
|
622
630
|
* Some devices are known not to support `MediaSource.changeType`
|
|
623
631
|
* well. These devices should use the reload strategy. If a device
|
|
624
|
-
* reports that it supports `changeType` but support it
|
|
632
|
+
* reports that it supports `changeType` but support it unreliably
|
|
625
633
|
* it should be added to this list.
|
|
626
634
|
*
|
|
627
635
|
* @return {boolean}
|
|
@@ -630,7 +638,8 @@ shaka.util.Platform = class {
|
|
|
630
638
|
const Platform = shaka.util.Platform;
|
|
631
639
|
if (Platform.isTizen2() || Platform.isTizen3() || Platform.isTizen4() ||
|
|
632
640
|
Platform.isTizen5() || Platform.isTizen6() || Platform.isWebOS3() ||
|
|
633
|
-
Platform.isWebOS4() || Platform.isWebOS5())
|
|
641
|
+
Platform.isWebOS4() || Platform.isWebOS5() || Platform.isPS4() ||
|
|
642
|
+
Platform.isPS5()) {
|
|
634
643
|
return false;
|
|
635
644
|
}
|
|
636
645
|
// Older chromecasts without GoogleTV seem to not support SMOOTH properly.
|
|
@@ -11,6 +11,7 @@ goog.require('shaka.abr.SimpleAbrManager');
|
|
|
11
11
|
goog.require('shaka.config.AutoShowText');
|
|
12
12
|
goog.require('shaka.config.CodecSwitchingStrategy');
|
|
13
13
|
goog.require('shaka.log');
|
|
14
|
+
goog.require('shaka.media.Capabilities');
|
|
14
15
|
goog.require('shaka.net.NetworkingEngine');
|
|
15
16
|
goog.require('shaka.util.ConfigUtils');
|
|
16
17
|
goog.require('shaka.util.FairPlayUtils');
|
|
@@ -103,7 +104,8 @@ shaka.util.PlayerConfiguration = class {
|
|
|
103
104
|
|
|
104
105
|
let codecSwitchingStrategy = shaka.config.CodecSwitchingStrategy.RELOAD;
|
|
105
106
|
let multiTypeVariantsAllowed = false;
|
|
106
|
-
if (shaka.
|
|
107
|
+
if (shaka.media.Capabilities.isChangeTypeSupported() &&
|
|
108
|
+
shaka.util.Platform.supportsSmoothCodecSwitching()) {
|
|
107
109
|
codecSwitchingStrategy = shaka.config.CodecSwitchingStrategy.SMOOTH;
|
|
108
110
|
multiTypeVariantsAllowed = true;
|
|
109
111
|
}
|
package/package.json
CHANGED
package/ui/externs/ui.js
CHANGED
|
@@ -226,7 +226,8 @@ shaka.extern.UIVolumeBarColors;
|
|
|
226
226
|
* @property {boolean} seekOnTaps
|
|
227
227
|
* Indicates whether or not a fast-forward and rewind tap button that seeks
|
|
228
228
|
* video some seconds.
|
|
229
|
-
* Defaults to true.
|
|
229
|
+
* Defaults to true if the browser <code>navigator.maxTouchPoints > 0</code>
|
|
230
|
+
* is true.
|
|
230
231
|
* @property {number} tapSeekDistance
|
|
231
232
|
* The time interval, in seconds, to seek when the user presses the left or
|
|
232
233
|
* right part of the video. If less than or equal to 0,
|
package/ui/locales/zh-HK.json
CHANGED
|
@@ -1,30 +1,49 @@
|
|
|
1
1
|
{
|
|
2
|
+
"AD_DURATION": "廣告長度",
|
|
3
|
+
"AD_PROGRESS": "廣告 [AD_ON]/[NUM_ADS]",
|
|
4
|
+
"AD_STATISTICS": "廣告統計資料",
|
|
5
|
+
"AD_TIME": "廣告:[AD_TIME]",
|
|
6
|
+
"AIRPLAY": "AirPlay",
|
|
2
7
|
"AUTO_QUALITY": "自動",
|
|
3
8
|
"BACK": "返回",
|
|
4
9
|
"CAPTIONS": "字幕",
|
|
5
10
|
"CAST": "投放…",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
11
|
+
"CHAPTERS": "章節",
|
|
12
|
+
"DOWNLOAD_VIDEO_FRAME": "儲存影片影格",
|
|
13
|
+
"ENTER_LOOP_MODE": "循環播放目前的影片",
|
|
14
|
+
"ENTER_PICTURE_IN_PICTURE": "進入子母畫面",
|
|
15
|
+
"EXIT_FULL_SCREEN": "退出全螢幕模式",
|
|
16
|
+
"EXIT_LOOP_MODE": "停止循環播放目前的影片",
|
|
8
17
|
"EXIT_PICTURE_IN_PICTURE": "退出畫中畫",
|
|
9
18
|
"FAST_FORWARD": "快轉",
|
|
10
19
|
"FULL_SCREEN": "全螢幕",
|
|
11
20
|
"LANGUAGE": "語言",
|
|
12
21
|
"LIVE": "直播",
|
|
13
|
-
"
|
|
22
|
+
"LOOP": "循環播放",
|
|
23
|
+
"MORE_SETTINGS": "顯示更多設定",
|
|
14
24
|
"MULTIPLE_LANGUAGES": "多種語言",
|
|
15
|
-
"MUTE": "
|
|
25
|
+
"MUTE": "静音",
|
|
16
26
|
"NOT_APPLICABLE": "不適用",
|
|
17
|
-
"OFF": "
|
|
18
|
-
"ON": "",
|
|
27
|
+
"OFF": "關閉",
|
|
28
|
+
"ON": "開啟",
|
|
19
29
|
"PAUSE": "暫停",
|
|
20
30
|
"PICTURE_IN_PICTURE": "畫中畫",
|
|
21
31
|
"PLAY": "播放",
|
|
22
|
-
"
|
|
32
|
+
"PLAYBACK_RATE": "播放速度",
|
|
33
|
+
"QUALITY": "音質",
|
|
34
|
+
"RECENTER_VR": "重新置中",
|
|
35
|
+
"REPLAY": "重播",
|
|
36
|
+
"RESOLUTION": "解析度",
|
|
23
37
|
"REWIND": "倒帶",
|
|
24
|
-
"SEEK": "
|
|
25
|
-
"
|
|
38
|
+
"SEEK": "進度",
|
|
39
|
+
"SKIP_AD": "略過廣告",
|
|
40
|
+
"SKIP_TO_LIVE": "跳至当前直播",
|
|
41
|
+
"STATISTICS": "統計資料",
|
|
42
|
+
"SUBTITLE_FORCED": "強制",
|
|
43
|
+
"SURROUND": "環迴音效",
|
|
44
|
+
"TOGGLE_STEREOSCOPIC": "切換立體視覺",
|
|
26
45
|
"UNDETERMINED_LANGUAGE": "不明",
|
|
27
|
-
"UNMUTE": "
|
|
28
|
-
"UNRECOGNIZED_LANGUAGE": "
|
|
46
|
+
"UNMUTE": "取消靜音",
|
|
47
|
+
"UNRECOGNIZED_LANGUAGE": "無法辨識",
|
|
29
48
|
"VOLUME": "音量"
|
|
30
49
|
}
|
package/ui/remote_button.js
CHANGED
|
@@ -72,7 +72,7 @@ shaka.ui.RemoteButton = class extends shaka.ui.Element {
|
|
|
72
72
|
|
|
73
73
|
shaka.ui.Utils.setDisplay(this.remoteButton_, false);
|
|
74
74
|
|
|
75
|
-
if (!this.video.remote
|
|
75
|
+
if (!this.video.remote) {
|
|
76
76
|
this.remoteButton_.classList.add('shaka-hidden');
|
|
77
77
|
} else {
|
|
78
78
|
this.eventManager.listen(
|
|
@@ -138,10 +138,11 @@ shaka.ui.RemoteButton = class extends shaka.ui.Element {
|
|
|
138
138
|
} else if (this.video.remote.state == 'disconnected') {
|
|
139
139
|
const handleAvailabilityChange = (availability) => {
|
|
140
140
|
if (this.player) {
|
|
141
|
+
const disableRemote = this.video.disableRemotePlayback;
|
|
141
142
|
const loadMode = this.player.getLoadMode();
|
|
142
143
|
const srcMode = loadMode == shaka.Player.LoadMode.SRC_EQUALS;
|
|
143
144
|
shaka.ui.Utils.setDisplay(
|
|
144
|
-
this.remoteButton_, srcMode && availability);
|
|
145
|
+
this.remoteButton_, srcMode && availability && !disableRemote);
|
|
145
146
|
} else {
|
|
146
147
|
shaka.ui.Utils.setDisplay(this.remoteButton_, false);
|
|
147
148
|
}
|
|
@@ -19,6 +19,7 @@ goog.require('shaka.ui.SettingsMenu');
|
|
|
19
19
|
goog.require('shaka.ui.Utils');
|
|
20
20
|
goog.require('shaka.util.Dom');
|
|
21
21
|
goog.require('shaka.util.FakeEvent');
|
|
22
|
+
goog.require('shaka.util.Functional');
|
|
22
23
|
goog.requireType('shaka.ui.Controls');
|
|
23
24
|
|
|
24
25
|
|
|
@@ -91,6 +92,7 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
|
|
|
91
92
|
return false;
|
|
92
93
|
}
|
|
93
94
|
if (this.controls.getConfig().showAudioChannelCountVariants &&
|
|
95
|
+
track.channelsCount && selectedTrack.channelsCount &&
|
|
94
96
|
track.channelsCount != selectedTrack.channelsCount) {
|
|
95
97
|
return false;
|
|
96
98
|
}
|
|
@@ -117,7 +119,8 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
|
|
|
117
119
|
return tracks.findIndex((t) => t.bandwidth == track.bandwidth) == idx;
|
|
118
120
|
});
|
|
119
121
|
} else {
|
|
120
|
-
const audiosIds = [...new Set(tracks.map((t) => t.audioId))]
|
|
122
|
+
const audiosIds = [...new Set(tracks.map((t) => t.audioId))]
|
|
123
|
+
.filter(shaka.util.Functional.isNotNull);
|
|
121
124
|
if (audiosIds.length > 1) {
|
|
122
125
|
tracks = tracks.filter((track, idx) => {
|
|
123
126
|
// Keep the first one with the same height and framerate or bandwidth.
|
package/ui/ui.js
CHANGED
|
@@ -252,7 +252,7 @@ shaka.ui.Overlay = class {
|
|
|
252
252
|
fullScreenElement: this.videoContainer_,
|
|
253
253
|
preferDocumentPictureInPicture: true,
|
|
254
254
|
showAudioChannelCountVariants: true,
|
|
255
|
-
seekOnTaps:
|
|
255
|
+
seekOnTaps: navigator.maxTouchPoints > 0,
|
|
256
256
|
tapSeekDistance: 10,
|
|
257
257
|
refreshTickInSeconds: 0.125,
|
|
258
258
|
displayInVrMode: false,
|
|
@@ -275,6 +275,9 @@ shaka.ui.Overlay = class {
|
|
|
275
275
|
(name) => name != 'play_pause' && name != 'volume');
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
// Set this button here to push it at the end.
|
|
279
|
+
config.overflowMenuButtons.push('save_video_frame');
|
|
280
|
+
|
|
278
281
|
return config;
|
|
279
282
|
}
|
|
280
283
|
|
|
@@ -476,6 +479,8 @@ shaka.ui.Overlay = class {
|
|
|
476
479
|
video.removeAttribute('src');
|
|
477
480
|
}
|
|
478
481
|
|
|
482
|
+
await player.attach(shaka.util.Dom.asHTMLMediaElement(video));
|
|
483
|
+
|
|
479
484
|
for (const elem of video.querySelectorAll('source')) {
|
|
480
485
|
try { // eslint-disable-next-line no-await-in-loop
|
|
481
486
|
await ui.getControls().getPlayer().load(elem.getAttribute('src'));
|
|
@@ -484,8 +489,6 @@ shaka.ui.Overlay = class {
|
|
|
484
489
|
shaka.log.error('Error auto-loading asset', e);
|
|
485
490
|
}
|
|
486
491
|
}
|
|
487
|
-
|
|
488
|
-
await player.attach(shaka.util.Dom.asHTMLMediaElement(video));
|
|
489
492
|
}
|
|
490
493
|
|
|
491
494
|
|