shaka-player 4.9.35 → 4.9.36
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/AUTHORS +1 -0
- package/CONTRIBUTORS +1 -0
- package/README.md +9 -3
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/deps.js +5 -5
- package/dist/locales.js +36 -36
- package/dist/shaka-player.compiled.d.ts +1 -0
- package/dist/shaka-player.compiled.debug.d.ts +1 -0
- package/dist/shaka-player.compiled.debug.externs.js +4 -3
- package/dist/shaka-player.compiled.debug.js +436 -421
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.externs.js +4 -3
- package/dist/shaka-player.compiled.js +1263 -1251
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.dash.d.ts +4099 -0
- package/dist/shaka-player.dash.debug.d.ts +4099 -0
- package/dist/shaka-player.dash.debug.externs.js +4188 -0
- package/dist/shaka-player.dash.debug.js +2161 -0
- package/dist/shaka-player.dash.debug.map +8 -0
- package/dist/shaka-player.dash.externs.js +4188 -0
- package/dist/shaka-player.dash.js +1007 -0
- package/dist/shaka-player.dash.map +8 -0
- package/dist/shaka-player.hls.d.ts +4196 -0
- package/dist/shaka-player.hls.debug.d.ts +4196 -0
- package/dist/shaka-player.hls.debug.externs.js +4403 -0
- package/dist/shaka-player.hls.debug.js +2243 -0
- package/dist/shaka-player.hls.debug.map +8 -0
- package/dist/shaka-player.hls.externs.js +4403 -0
- package/dist/shaka-player.hls.js +1076 -0
- package/dist/shaka-player.hls.map +8 -0
- package/dist/shaka-player.ui.d.ts +1 -0
- package/dist/shaka-player.ui.debug.d.ts +1 -0
- package/dist/shaka-player.ui.debug.externs.js +4 -3
- package/dist/shaka-player.ui.debug.js +460 -445
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.externs.js +4 -3
- package/dist/shaka-player.ui.js +1462 -1453
- package/dist/shaka-player.ui.map +3 -3
- package/externs/shaka/player.js +8 -4
- package/lib/cast/cast_proxy.js +48 -10
- package/lib/cea/cea708_service.js +9 -16
- package/lib/dash/dash_parser.js +23 -16
- package/lib/dash/segment_template.js +41 -40
- package/lib/hls/hls_parser.js +2 -2
- package/lib/media/content_workarounds.js +110 -72
- package/lib/media/drm_engine.js +72 -11
- package/lib/media/gap_jumping_controller.js +14 -1
- package/lib/media/media_source_engine.js +29 -11
- package/lib/media/region_timeline.js +4 -3
- package/lib/media/streaming_engine.js +37 -11
- package/lib/net/http_plugin_utils.js +1 -1
- package/lib/net/networking_engine.js +8 -0
- package/lib/net/networking_utils.js +1 -0
- package/lib/player.js +109 -37
- package/lib/polyfill/patchedmediakeys_apple.js +21 -0
- package/lib/text/cue.js +6 -2
- package/lib/text/mp4_ttml_parser.js +94 -6
- package/lib/text/ui_text_displayer.js +35 -4
- package/lib/transmuxer/ac3_transmuxer.js +6 -1
- package/lib/util/config_utils.js +13 -3
- package/lib/util/drm_utils.js +8 -0
- package/lib/util/error.js +6 -0
- package/lib/util/mp4_generator.js +19 -4
- package/lib/util/periods.js +4 -2
- package/lib/util/platform.js +60 -12
- package/lib/util/player_configuration.js +6 -1
- package/lib/util/stream_utils.js +18 -0
- package/lib/util/tXml.js +3 -2
- package/package.json +3 -3
- package/ui/controls.js +2 -6
- package/ui/less/thumbnails.less +1 -0
- package/ui/statistics_button.js +3 -1
- package/ui/ui.js +44 -35
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shaka-player",
|
|
3
3
|
"description": "DASH/EME video player library",
|
|
4
|
-
"version": "4.9.
|
|
4
|
+
"version": "4.9.36",
|
|
5
5
|
"homepage": "https://github.com/shaka-project/shaka-player",
|
|
6
6
|
"author": "Google",
|
|
7
7
|
"maintainers": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"karma-coverage": "^2.2.0",
|
|
44
44
|
"karma-jasmine": "^4.0.1",
|
|
45
45
|
"karma-jasmine-ajax": "^0.1.13",
|
|
46
|
-
"karma-local-wd-launcher": "^1.6.
|
|
46
|
+
"karma-local-wd-launcher": "^1.6.9",
|
|
47
47
|
"karma-opera-launcher": "^1.0.0",
|
|
48
48
|
"karma-sourcemap-loader": "^0.3.8",
|
|
49
49
|
"karma-spec-reporter": "^0.0.34",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"prepublishOnly": "python build/checkversion.py && python build/all.py --force"
|
|
106
106
|
},
|
|
107
107
|
"dependencies": {
|
|
108
|
-
"eme-encryption-scheme-polyfill": "^2.1
|
|
108
|
+
"eme-encryption-scheme-polyfill": "^2.2.1"
|
|
109
109
|
},
|
|
110
110
|
"clean-package": {
|
|
111
111
|
"remove": [
|
package/ui/controls.js
CHANGED
|
@@ -1613,12 +1613,8 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
|
|
|
1613
1613
|
goog.asserts.assert(
|
|
1614
1614
|
this.seekBar_, 'Caller of seek_ must check for seekBar_ first!');
|
|
1615
1615
|
|
|
1616
|
-
this.
|
|
1617
|
-
|
|
1618
|
-
if (this.isOpaque()) {
|
|
1619
|
-
// Only update the time and seek range if it's visible.
|
|
1620
|
-
this.updateTimeAndSeekRange_();
|
|
1621
|
-
}
|
|
1616
|
+
this.video_.currentTime = currentTime;
|
|
1617
|
+
this.updateTimeAndSeekRange_();
|
|
1622
1618
|
}
|
|
1623
1619
|
|
|
1624
1620
|
/**
|
package/ui/less/thumbnails.less
CHANGED
package/ui/statistics_button.js
CHANGED
|
@@ -119,7 +119,9 @@ shaka.ui.StatisticsButton = class extends shaka.ui.Element {
|
|
|
119
119
|
|
|
120
120
|
const parseBytesDownloaded = (name) => {
|
|
121
121
|
const bytes = parseInt(this.currentStats_[name], 10);
|
|
122
|
-
if (bytes >
|
|
122
|
+
if (bytes > 2 * 1e9) {
|
|
123
|
+
return (bytes / 1e9).toFixed(2) + 'GB';
|
|
124
|
+
} else if (bytes > 1e6) {
|
|
123
125
|
return (bytes / 1e6).toFixed(2) + 'MB';
|
|
124
126
|
} else if (bytes > 1e3) {
|
|
125
127
|
return (bytes / 1e3).toFixed(2) + 'KB';
|
package/ui/ui.js
CHANGED
|
@@ -41,6 +41,35 @@ shaka.ui.Overlay = class {
|
|
|
41
41
|
/** @private {!shaka.extern.UIConfiguration} */
|
|
42
42
|
this.config_ = this.defaultConfig_();
|
|
43
43
|
|
|
44
|
+
// Get and configure cast app id.
|
|
45
|
+
let castAppId = '';
|
|
46
|
+
|
|
47
|
+
// Get and configure cast Android Receiver Compatibility
|
|
48
|
+
let castAndroidReceiverCompatible = false;
|
|
49
|
+
|
|
50
|
+
// Cast receiver id can be specified on either container or video.
|
|
51
|
+
// It should not be provided on both. If it was, we will use the last
|
|
52
|
+
// one we saw.
|
|
53
|
+
if (videoContainer['dataset'] &&
|
|
54
|
+
videoContainer['dataset']['shakaPlayerCastReceiverId']) {
|
|
55
|
+
const dataSet = videoContainer['dataset'];
|
|
56
|
+
castAppId = dataSet['shakaPlayerCastReceiverId'];
|
|
57
|
+
castAndroidReceiverCompatible =
|
|
58
|
+
dataSet['shakaPlayerCastAndroidReceiverCompatible'] === 'true';
|
|
59
|
+
} else if (video['dataset'] &&
|
|
60
|
+
video['dataset']['shakaPlayerCastReceiverId']) {
|
|
61
|
+
const dataSet = video['dataset'];
|
|
62
|
+
castAppId = dataSet['shakaPlayerCastReceiverId'];
|
|
63
|
+
castAndroidReceiverCompatible =
|
|
64
|
+
dataSet['shakaPlayerCastAndroidReceiverCompatible'] === 'true';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (castAppId.length) {
|
|
68
|
+
this.config_.castReceiverAppId = castAppId;
|
|
69
|
+
this.config_.castAndroidReceiverCompatible =
|
|
70
|
+
castAndroidReceiverCompatible;
|
|
71
|
+
}
|
|
72
|
+
|
|
44
73
|
// Make sure this container is discoverable and that the UI can be reached
|
|
45
74
|
// through it.
|
|
46
75
|
videoContainer['dataset']['shakaPlayerContainer'] = '';
|
|
@@ -55,10 +84,6 @@ shaka.ui.Overlay = class {
|
|
|
55
84
|
this.controls_ = new shaka.ui.Controls(
|
|
56
85
|
player, videoContainer, video, vrCanvas, this.config_);
|
|
57
86
|
|
|
58
|
-
// Run the initial setup so that no configure() call is required for default
|
|
59
|
-
// settings.
|
|
60
|
-
this.configure({});
|
|
61
|
-
|
|
62
87
|
// If the browser's native controls are disabled, use UI TextDisplayer.
|
|
63
88
|
if (!video.controls) {
|
|
64
89
|
player.setVideoContainer(videoContainer);
|
|
@@ -130,18 +155,29 @@ shaka.ui.Overlay = class {
|
|
|
130
155
|
|
|
131
156
|
goog.asserts.assert(typeof(config) == 'object', 'Should be an object!');
|
|
132
157
|
|
|
158
|
+
const newConfig = /** @type {!shaka.extern.UIConfiguration} */(
|
|
159
|
+
Object.assign({}, this.config_));
|
|
133
160
|
shaka.util.ConfigUtils.mergeConfigObjects(
|
|
134
|
-
|
|
161
|
+
newConfig, config, this.defaultConfig_(),
|
|
135
162
|
/* overrides= */ {}, /* path= */ '');
|
|
136
163
|
|
|
137
164
|
// If a cast receiver app id has been given, add a cast button to the UI
|
|
138
|
-
if (
|
|
139
|
-
!
|
|
140
|
-
|
|
165
|
+
if (newConfig.castReceiverAppId &&
|
|
166
|
+
!newConfig.overflowMenuButtons.includes('cast')) {
|
|
167
|
+
newConfig.overflowMenuButtons.push('cast');
|
|
141
168
|
}
|
|
142
169
|
|
|
143
170
|
goog.asserts.assert(this.player_ != null, 'Should have a player!');
|
|
144
171
|
|
|
172
|
+
const diff = shaka.util.ConfigUtils.getDifferenceFromConfigObjects(
|
|
173
|
+
newConfig, this.config_);
|
|
174
|
+
if (!Object.keys(diff).length) {
|
|
175
|
+
// No changes
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
this.config_ = newConfig;
|
|
180
|
+
|
|
145
181
|
this.controls_.configure(this.config_);
|
|
146
182
|
|
|
147
183
|
this.controls_.dispatchEvent(new shaka.util.FakeEvent('uiupdated'));
|
|
@@ -432,33 +468,6 @@ shaka.ui.Overlay = class {
|
|
|
432
468
|
// Attach Canvas used for LCEVC Decoding
|
|
433
469
|
player.attachCanvas(/** @type {HTMLCanvasElement} */(lcevcCanvas));
|
|
434
470
|
|
|
435
|
-
// Get and configure cast app id.
|
|
436
|
-
let castAppId = '';
|
|
437
|
-
|
|
438
|
-
// Get and configure cast Android Receiver Compatibility
|
|
439
|
-
let castAndroidReceiverCompatible = false;
|
|
440
|
-
|
|
441
|
-
// Cast receiver id can be specified on either container or video.
|
|
442
|
-
// It should not be provided on both. If it was, we will use the last
|
|
443
|
-
// one we saw.
|
|
444
|
-
if (container['dataset'] &&
|
|
445
|
-
container['dataset']['shakaPlayerCastReceiverId']) {
|
|
446
|
-
castAppId = container['dataset']['shakaPlayerCastReceiverId'];
|
|
447
|
-
castAndroidReceiverCompatible =
|
|
448
|
-
container['dataset']['shakaPlayerCastAndroidReceiverCompatible'] ===
|
|
449
|
-
'true';
|
|
450
|
-
} else if (video['dataset'] &&
|
|
451
|
-
video['dataset']['shakaPlayerCastReceiverId']) {
|
|
452
|
-
castAppId = video['dataset']['shakaPlayerCastReceiverId'];
|
|
453
|
-
castAndroidReceiverCompatible =
|
|
454
|
-
video['dataset']['shakaPlayerCastAndroidReceiverCompatible'] === 'true';
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
if (castAppId.length) {
|
|
458
|
-
ui.configure({castReceiverAppId: castAppId,
|
|
459
|
-
castAndroidReceiverCompatible: castAndroidReceiverCompatible});
|
|
460
|
-
}
|
|
461
|
-
|
|
462
471
|
if (shaka.util.Dom.asHTMLMediaElement(video).controls) {
|
|
463
472
|
ui.getControls().setEnabledNativeControls(true);
|
|
464
473
|
}
|