@mottosports/motto-video-player 1.0.1-rc.40 → 1.0.1-rc.42
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/index.js +11 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1133,7 +1133,7 @@ var isPlayReadySupported = () => {
|
|
|
1133
1133
|
const isWindows = /Windows/.test(userAgent);
|
|
1134
1134
|
return isXbox || (isEdge || isIE) && isWindows;
|
|
1135
1135
|
};
|
|
1136
|
-
var
|
|
1136
|
+
var supportsWidevinePersistentLicenses = () => {
|
|
1137
1137
|
if (typeof navigator === "undefined") {
|
|
1138
1138
|
return false;
|
|
1139
1139
|
}
|
|
@@ -1159,7 +1159,7 @@ var isChrome64PlusOnMacOrWindows = () => {
|
|
|
1159
1159
|
import initShakaPlayerMux from "@mux/mux-data-shakaplayer";
|
|
1160
1160
|
|
|
1161
1161
|
// package.json
|
|
1162
|
-
var version = "1.0.1-rc.
|
|
1162
|
+
var version = "1.0.1-rc.42";
|
|
1163
1163
|
|
|
1164
1164
|
// src/utils/licenseCache.ts
|
|
1165
1165
|
var PERSISTENT_LICENSE_PREFIX = "motto_lic_";
|
|
@@ -1384,26 +1384,17 @@ var useShakaPlayer = ({
|
|
|
1384
1384
|
"com.widevine.alpha": {
|
|
1385
1385
|
...drmConfig2.advanced?.["com.widevine.alpha"],
|
|
1386
1386
|
// set to `persistent-license` only on Chrome 64+ on MacOS/Windows: https://shaka-player-demo.appspot.com/docs/api/tutorial-faq.html
|
|
1387
|
-
sessionType:
|
|
1388
|
-
"headers": {
|
|
1389
|
-
"x-dt-auth-token": src.drm.token || ""
|
|
1390
|
-
}
|
|
1387
|
+
sessionType: supportsWidevinePersistentLicenses() ? "persistent-license" : "temporary"
|
|
1391
1388
|
},
|
|
1392
1389
|
"com.microsoft.playready": {
|
|
1393
1390
|
...drmConfig2.advanced?.["com.microsoft.playready"],
|
|
1394
|
-
sessionType: "
|
|
1395
|
-
// PlayReady always
|
|
1396
|
-
"headers": {
|
|
1397
|
-
"x-dt-auth-token": src.drm.token || ""
|
|
1398
|
-
}
|
|
1391
|
+
sessionType: "persistent-license"
|
|
1392
|
+
// PlayReady seems to always require persistent-license (temporary won't work, not compatible with license server response)
|
|
1399
1393
|
},
|
|
1400
1394
|
"com.apple.fps": {
|
|
1401
1395
|
...drmConfig2.advanced?.["com.apple.fps"],
|
|
1402
|
-
sessionType: "temporary"
|
|
1396
|
+
sessionType: "temporary"
|
|
1403
1397
|
// FairPlay always uses temporary sessions - Safari won't play with persistent-license
|
|
1404
|
-
"headers": {
|
|
1405
|
-
"x-dt-auth-token": src.drm.token || ""
|
|
1406
|
-
}
|
|
1407
1398
|
}
|
|
1408
1399
|
};
|
|
1409
1400
|
if (storedSessionsMetadata.length > 0) {
|
|
@@ -1417,6 +1408,11 @@ var useShakaPlayer = ({
|
|
|
1417
1408
|
player.configure({ drm: drmConfig2 });
|
|
1418
1409
|
const netEngine = player.getNetworkingEngine();
|
|
1419
1410
|
if (netEngine) {
|
|
1411
|
+
netEngine.registerRequestFilter((type, request) => {
|
|
1412
|
+
if (type === shaka.net.NetworkingEngine.RequestType.LICENSE) {
|
|
1413
|
+
request.headers["x-dt-auth-token"] = src.drm.token;
|
|
1414
|
+
}
|
|
1415
|
+
});
|
|
1420
1416
|
netEngine.registerResponseFilter((type, response) => {
|
|
1421
1417
|
if (type === shaka.net.NetworkingEngine.RequestType.LICENSE) {
|
|
1422
1418
|
const ks = player.keySystem && player.keySystem();
|