shaka-player 4.8.12 → 4.8.13
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/dist/locales.js +35 -35
- package/dist/shaka-player.compiled.d.ts +1 -1
- package/dist/shaka-player.compiled.debug.d.ts +1 -1
- package/dist/shaka-player.compiled.debug.js +23 -23
- package/dist/shaka-player.compiled.debug.map +2 -2
- package/dist/shaka-player.compiled.js +1102 -1101
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.d.ts +1 -1
- package/dist/shaka-player.ui.debug.d.ts +1 -1
- package/dist/shaka-player.ui.debug.js +26 -26
- package/dist/shaka-player.ui.debug.map +2 -2
- package/dist/shaka-player.ui.js +1303 -1302
- package/dist/shaka-player.ui.map +3 -3
- package/externs/polyfill.js +1 -1
- package/lib/media/drm_engine.js +7 -1
- package/lib/media/media_source_engine.js +1 -1
- package/lib/media/presentation_timeline.js +1 -1
- package/lib/player.js +8 -16
- package/lib/polyfill/patchedmediakeys_apple.js +9 -2
- package/lib/polyfill/patchedmediakeys_nop.js +8 -1
- package/lib/polyfill/patchedmediakeys_webkit.js +12 -2
- package/lib/util/platform.js +6 -5
- package/package.json +1 -1
package/externs/polyfill.js
CHANGED
package/lib/media/drm_engine.js
CHANGED
|
@@ -177,12 +177,18 @@ shaka.media.DrmEngine = class {
|
|
|
177
177
|
|
|
178
178
|
// |video_| will be |null| if we never attached to a video element.
|
|
179
179
|
if (this.video_) {
|
|
180
|
-
|
|
180
|
+
// Webkit EME implementation requires the src to be defined to clear
|
|
181
|
+
// the MediaKeys.
|
|
182
|
+
if (!shaka.util.Platform.isMediaKeysPolyfilled('webkit')) {
|
|
183
|
+
goog.asserts.assert(!this.video_.src,
|
|
184
|
+
'video src must be removed first!');
|
|
185
|
+
}
|
|
181
186
|
|
|
182
187
|
try {
|
|
183
188
|
await this.video_.setMediaKeys(null);
|
|
184
189
|
} catch (error) {
|
|
185
190
|
// Ignore any failures while removing media keys from the video element.
|
|
191
|
+
shaka.log.debug(`DrmEngine.destroyNow_ exception`, error);
|
|
186
192
|
}
|
|
187
193
|
|
|
188
194
|
this.video_ = null;
|
|
@@ -316,7 +316,7 @@ shaka.media.MediaSourceEngine = class {
|
|
|
316
316
|
'audio/mp4; codecs="mp4a.40.2"',
|
|
317
317
|
'audio/mp4; codecs="ac-3"',
|
|
318
318
|
'audio/mp4; codecs="ec-3"',
|
|
319
|
-
'audio/mp4; codecs="ac-4"',
|
|
319
|
+
'audio/mp4; codecs="ac-4.02.01.01"',
|
|
320
320
|
'audio/mp4; codecs="opus"',
|
|
321
321
|
'audio/mp4; codecs="flac"',
|
|
322
322
|
'audio/mp4; codecs="dtsc"', // DTS Digital Surround
|
package/lib/player.js
CHANGED
|
@@ -828,21 +828,6 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
828
828
|
*/
|
|
829
829
|
setupLcevc_(config) {
|
|
830
830
|
if (config.lcevc.enabled) {
|
|
831
|
-
const tracks = this.getVariantTracks();
|
|
832
|
-
if (tracks && tracks[0] && tracks[0].videoMimeType == 'video/mp2t') {
|
|
833
|
-
const edge = shaka.util.Platform.isEdge() ||
|
|
834
|
-
shaka.util.Platform.isLegacyEdge();
|
|
835
|
-
if (edge) {
|
|
836
|
-
if (!config.mediaSource.forceTransmux) {
|
|
837
|
-
// If forceTransmux is disabled for Microsoft Edge, LCEVC data
|
|
838
|
-
// is stripped out in case of a MPEG-2 TS container.
|
|
839
|
-
// Hence the warning for Microsoft Edge when playing content with
|
|
840
|
-
// MPEG-2 TS container.
|
|
841
|
-
shaka.log.alwaysWarn('LCEVC Warning: For MPEG-2 TS decoding '+
|
|
842
|
-
'the config.mediaSource.forceTransmux must be enabled.');
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
831
|
this.closeLcevcDec_();
|
|
847
832
|
this.createLcevcDec_(config.lcevc);
|
|
848
833
|
} else {
|
|
@@ -1289,6 +1274,13 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
1289
1274
|
this.playhead_ = null;
|
|
1290
1275
|
}
|
|
1291
1276
|
|
|
1277
|
+
// EME v0.1b requires the media element to clear the MediaKeys
|
|
1278
|
+
if (shaka.util.Platform.isMediaKeysPolyfilled('webkit') &&
|
|
1279
|
+
this.drmEngine_) {
|
|
1280
|
+
await this.drmEngine_.destroy();
|
|
1281
|
+
this.drmEngine_ = null;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1292
1284
|
// Media source engine holds onto the media element, and in order to
|
|
1293
1285
|
// detach the media keys (with drm engine), we need to break the
|
|
1294
1286
|
// connection between media source engine and the media element.
|
|
@@ -7248,7 +7240,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5;
|
|
|
7248
7240
|
* @export
|
|
7249
7241
|
*/
|
|
7250
7242
|
// eslint-disable-next-line no-useless-concat
|
|
7251
|
-
shaka.Player.version = 'v4.8.
|
|
7243
|
+
shaka.Player.version = 'v4.8.13' + '-uncompiled'; // x-release-please-version
|
|
7252
7244
|
|
|
7253
7245
|
// Initialize the deprecation system using the version string we just set
|
|
7254
7246
|
// on the player.
|
|
@@ -76,7 +76,7 @@ shaka.polyfill.PatchedMediaKeysApple = class {
|
|
|
76
76
|
navigator.requestMediaKeySystemAccess =
|
|
77
77
|
PatchedMediaKeysApple.requestMediaKeySystemAccess;
|
|
78
78
|
|
|
79
|
-
window.shakaMediaKeysPolyfill =
|
|
79
|
+
window.shakaMediaKeysPolyfill = PatchedMediaKeysApple.apiName_;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/**
|
|
@@ -115,7 +115,7 @@ shaka.polyfill.PatchedMediaKeysApple = class {
|
|
|
115
115
|
PatchedMediaKeysApple.originalNavigatorRequestMediaKeySystemAccess = null;
|
|
116
116
|
PatchedMediaKeysApple.originalHTMLMediaElementPrototypeMediaKeys = null;
|
|
117
117
|
|
|
118
|
-
window.shakaMediaKeysPolyfill =
|
|
118
|
+
window.shakaMediaKeysPolyfill = '';
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/**
|
|
@@ -791,3 +791,10 @@ shaka.polyfill.PatchedMediaKeysApple.MediaKeyStatusMap = class {
|
|
|
791
791
|
goog.asserts.assert(false, 'Not used! Provided only for the compiler.');
|
|
792
792
|
}
|
|
793
793
|
};
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* API name.
|
|
797
|
+
*
|
|
798
|
+
* @private {string}
|
|
799
|
+
*/
|
|
800
|
+
shaka.polyfill.PatchedMediaKeysApple.apiName_ = 'apple';
|
|
@@ -50,7 +50,7 @@ shaka.polyfill.PatchedMediaKeysNop = class {
|
|
|
50
50
|
window.MediaKeys = PatchedMediaKeysNop.MediaKeys;
|
|
51
51
|
window.MediaKeySystemAccess = PatchedMediaKeysNop.MediaKeySystemAccess;
|
|
52
52
|
|
|
53
|
-
window.shakaMediaKeysPolyfill =
|
|
53
|
+
window.shakaMediaKeysPolyfill = PatchedMediaKeysNop.apiName_;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
@@ -136,6 +136,13 @@ shaka.polyfill.PatchedMediaKeysNop.MediaKeySystemAccess = class {
|
|
|
136
136
|
createMediaKeys() {}
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
+
/**
|
|
140
|
+
* API name.
|
|
141
|
+
*
|
|
142
|
+
* @private {string}
|
|
143
|
+
*/
|
|
144
|
+
shaka.polyfill.PatchedMediaKeysNop.apiName_ = 'nop';
|
|
145
|
+
|
|
139
146
|
|
|
140
147
|
// A low priority ensures this is the last and acts as a fallback.
|
|
141
148
|
shaka.polyfill.register(shaka.polyfill.PatchedMediaKeysNop.install, -10);
|
|
@@ -73,7 +73,7 @@ shaka.polyfill.PatchedMediaKeysWebkit = class {
|
|
|
73
73
|
window.MediaKeys = PatchedMediaKeysWebkit.MediaKeys;
|
|
74
74
|
window.MediaKeySystemAccess = PatchedMediaKeysWebkit.MediaKeySystemAccess;
|
|
75
75
|
|
|
76
|
-
window.shakaMediaKeysPolyfill =
|
|
76
|
+
window.shakaMediaKeysPolyfill = PatchedMediaKeysWebkit.apiName_;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
@@ -860,7 +860,9 @@ class extends shaka.util.FakeEventTarget {
|
|
|
860
860
|
PatchedMediaKeysWebkit.prefixApi_('cancelKeyRequest');
|
|
861
861
|
try {
|
|
862
862
|
this.media_[cancelKeyRequestName](this.keySystem_, this.sessionId);
|
|
863
|
-
} catch (exception) {
|
|
863
|
+
} catch (exception) {
|
|
864
|
+
shaka.log.debug(`${cancelKeyRequestName} exception`, exception);
|
|
865
|
+
}
|
|
864
866
|
}
|
|
865
867
|
|
|
866
868
|
// Resolve the 'closed' promise and return it.
|
|
@@ -977,4 +979,12 @@ shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap = class {
|
|
|
977
979
|
shaka.polyfill.PatchedMediaKeysWebkit.prefix_ = '';
|
|
978
980
|
|
|
979
981
|
|
|
982
|
+
/**
|
|
983
|
+
* API name.
|
|
984
|
+
*
|
|
985
|
+
* @private {string}
|
|
986
|
+
*/
|
|
987
|
+
shaka.polyfill.PatchedMediaKeysWebkit.apiName_ = 'webkit';
|
|
988
|
+
|
|
989
|
+
|
|
980
990
|
shaka.polyfill.register(shaka.polyfill.PatchedMediaKeysWebkit.install);
|
package/lib/util/platform.js
CHANGED
|
@@ -644,16 +644,17 @@ shaka.util.Platform = class {
|
|
|
644
644
|
/**
|
|
645
645
|
* Returns true if MediaKeys is polyfilled
|
|
646
646
|
*
|
|
647
|
+
* @param {string=} polyfillType
|
|
647
648
|
* @return {boolean}
|
|
648
649
|
*/
|
|
649
|
-
static isMediaKeysPolyfilled() {
|
|
650
|
-
if (
|
|
651
|
-
return
|
|
650
|
+
static isMediaKeysPolyfilled(polyfillType) {
|
|
651
|
+
if (polyfillType) {
|
|
652
|
+
return polyfillType === window.shakaMediaKeysPolyfill;
|
|
652
653
|
}
|
|
653
|
-
|
|
654
|
-
return false;
|
|
654
|
+
return !!window.shakaMediaKeysPolyfill;
|
|
655
655
|
}
|
|
656
656
|
|
|
657
|
+
|
|
657
658
|
/**
|
|
658
659
|
* Detect the maximum resolution that the platform's hardware can handle.
|
|
659
660
|
*
|