mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-16 16:16:40 +03:00
committed by
GitHub
parent
83ff40892f
commit
42d9ec052d
@@ -698,7 +698,7 @@ shaka.media.DrmEngine = class {
|
||||
// Create a config entry for each key system.
|
||||
for (const info of allDrmInfo) {
|
||||
const config = {
|
||||
// Ignore initDataTypes.
|
||||
initDataTypes: ['cenc'],
|
||||
audioCapabilities: [],
|
||||
videoCapabilities: [],
|
||||
distinctiveIdentifier: 'optional',
|
||||
@@ -749,6 +749,13 @@ shaka.media.DrmEngine = class {
|
||||
// MediaKeySystemConfiguration
|
||||
config['drmInfos'].push(info);
|
||||
|
||||
if (info.initData && info.initData.length) {
|
||||
config.initDataTypes = [
|
||||
...new Set(
|
||||
info.initData.map((initData) => initData.initDataType)
|
||||
),
|
||||
];
|
||||
}
|
||||
if (info.distinctiveIdentifierRequired) {
|
||||
config.distinctiveIdentifier = 'required';
|
||||
}
|
||||
@@ -1544,6 +1551,7 @@ shaka.media.DrmEngine = class {
|
||||
];
|
||||
|
||||
const basicConfig = {
|
||||
initDataTypes: ['cenc'],
|
||||
videoCapabilities: basicVideoCapabilities,
|
||||
};
|
||||
const offlineConfig = {
|
||||
|
||||
@@ -15,6 +15,7 @@ goog.require('shaka.util.EventManager');
|
||||
goog.require('shaka.util.FakeEvent');
|
||||
goog.require('shaka.util.FakeEventTarget');
|
||||
goog.require('shaka.util.MediaReadyState');
|
||||
goog.require('shaka.util.Platform');
|
||||
goog.require('shaka.util.PublicPromise');
|
||||
goog.require('shaka.util.StringUtils');
|
||||
|
||||
@@ -33,15 +34,15 @@ shaka.polyfill.PatchedMediaKeysApple = class {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Prefer unprefixed EME once we know how to use it.
|
||||
// See: https://bugs.webkit.org/show_bug.cgi?id=197433
|
||||
/*
|
||||
// Only tested in Safari 14.
|
||||
const safariVersion = shaka.util.Platform.safariVersion();
|
||||
if (navigator.requestMediaKeySystemAccess &&
|
||||
MediaKeySystemAccess.prototype.getConfiguration) {
|
||||
// Prefixed EME is preferable.
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
MediaKeySystemAccess.prototype.getConfiguration &&
|
||||
safariVersion && safariVersion >= 14) {
|
||||
// Unprefixed EME is preferable.
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
shaka.log.info('Using Apple-prefixed EME');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user