@mottosports/motto-video-player 1.0.1-rc.32 → 1.0.1-rc.35
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.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +15 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -12,17 +12,17 @@ interface DVRSettings {
|
|
|
12
12
|
window_size_seconds: number;
|
|
13
13
|
}
|
|
14
14
|
interface Widevine {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
playlistUrl: string;
|
|
16
|
+
licenseUrl: string;
|
|
17
17
|
}
|
|
18
18
|
interface Fairplay {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
certificateUrl: string;
|
|
20
|
+
licenseUrl: string;
|
|
21
|
+
playlistUrl: string;
|
|
22
22
|
}
|
|
23
23
|
interface Playready {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
playlistUrl: string;
|
|
25
|
+
licenseUrl: string;
|
|
26
26
|
}
|
|
27
27
|
interface DRM {
|
|
28
28
|
token?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,17 +12,17 @@ interface DVRSettings {
|
|
|
12
12
|
window_size_seconds: number;
|
|
13
13
|
}
|
|
14
14
|
interface Widevine {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
playlistUrl: string;
|
|
16
|
+
licenseUrl: string;
|
|
17
17
|
}
|
|
18
18
|
interface Fairplay {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
certificateUrl: string;
|
|
20
|
+
licenseUrl: string;
|
|
21
|
+
playlistUrl: string;
|
|
22
22
|
}
|
|
23
23
|
interface Playready {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
playlistUrl: string;
|
|
25
|
+
licenseUrl: string;
|
|
26
26
|
}
|
|
27
27
|
interface DRM {
|
|
28
28
|
token?: string;
|
package/dist/index.js
CHANGED
|
@@ -1178,7 +1178,7 @@ var isPlayReadySupported = () => {
|
|
|
1178
1178
|
var import_mux_data_shakaplayer = __toESM(require("@mux/mux-data-shakaplayer"));
|
|
1179
1179
|
|
|
1180
1180
|
// package.json
|
|
1181
|
-
var version = "1.0.1-rc.
|
|
1181
|
+
var version = "1.0.1-rc.35";
|
|
1182
1182
|
|
|
1183
1183
|
// src/hooks/useShakePlayer.ts
|
|
1184
1184
|
var useShakePlayer = ({
|
|
@@ -1209,21 +1209,21 @@ var useShakePlayer = ({
|
|
|
1209
1209
|
let cert = null;
|
|
1210
1210
|
if (isDRM) {
|
|
1211
1211
|
const isPlayReady = isPlayReadySupported();
|
|
1212
|
-
if (isAppleDevice() && src.drm.fairplay?.
|
|
1213
|
-
const req = await fetch(src.drm.fairplay.
|
|
1212
|
+
if (isAppleDevice() && src.drm.fairplay?.certificateUrl) {
|
|
1213
|
+
const req = await fetch(src.drm.fairplay.certificateUrl);
|
|
1214
1214
|
cert = await req.arrayBuffer();
|
|
1215
|
-
manifestUrl = src.drm.fairplay.
|
|
1216
|
-
} else if (isPlayReady && src.drm.playready?.
|
|
1217
|
-
manifestUrl = src.drm.playready.
|
|
1215
|
+
manifestUrl = src.drm.fairplay.playlistUrl;
|
|
1216
|
+
} else if (isPlayReady && src.drm.playready?.licenseUrl) {
|
|
1217
|
+
manifestUrl = src.drm.playready.playlistUrl;
|
|
1218
1218
|
} else {
|
|
1219
|
-
manifestUrl = src.drm?.widevine?.
|
|
1219
|
+
manifestUrl = src.drm?.widevine?.playlistUrl || "";
|
|
1220
1220
|
}
|
|
1221
1221
|
player.configure({
|
|
1222
1222
|
drm: {
|
|
1223
1223
|
servers: {
|
|
1224
|
-
"com.widevine.alpha": src.drm.widevine?.
|
|
1225
|
-
"com.microsoft.playready": src.drm.playready?.
|
|
1226
|
-
"com.apple.fps": src.drm.fairplay?.
|
|
1224
|
+
"com.widevine.alpha": src.drm.widevine?.licenseUrl,
|
|
1225
|
+
"com.microsoft.playready": src.drm.playready?.licenseUrl,
|
|
1226
|
+
"com.apple.fps": src.drm.fairplay?.licenseUrl
|
|
1227
1227
|
},
|
|
1228
1228
|
...cert && {
|
|
1229
1229
|
advanced: {
|
|
@@ -1238,7 +1238,7 @@ var useShakePlayer = ({
|
|
|
1238
1238
|
if (netEngine) {
|
|
1239
1239
|
netEngine.registerRequestFilter((type, request) => {
|
|
1240
1240
|
if (type === import_shaka_player.default.net.NetworkingEngine.RequestType.LICENSE) {
|
|
1241
|
-
request.headers["x-dt-
|
|
1241
|
+
request.headers["x-dt-auth-token"] = src.drm.token;
|
|
1242
1242
|
}
|
|
1243
1243
|
});
|
|
1244
1244
|
netEngine.registerResponseFilter((type, response) => {
|
|
@@ -3541,8 +3541,6 @@ var Player = (0, import_react12.forwardRef)(
|
|
|
3541
3541
|
ref: containerRef,
|
|
3542
3542
|
className: containerClasses,
|
|
3543
3543
|
style: containerStyle,
|
|
3544
|
-
"data-shaka-player-container": true,
|
|
3545
|
-
"data-shaka-player-cast-receiver-id": chromecastConfig?.receiverApplicationId,
|
|
3546
3544
|
children: [
|
|
3547
3545
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3548
3546
|
"video",
|
|
@@ -4080,7 +4078,8 @@ var Video = ({
|
|
|
4080
4078
|
const video = providedVideoData || data;
|
|
4081
4079
|
const { t } = useMessages_default(locale);
|
|
4082
4080
|
const activePlaylist = findHLSPlaylist(video);
|
|
4083
|
-
const
|
|
4081
|
+
const activePlaylistUrl = activePlaylist?.url ?? activePlaylist?.drm?.widevine?.playlistUrl ?? activePlaylist?.drm?.playready?.playlistUrl ?? activePlaylist?.drm?.fairplay?.playlistUrl;
|
|
4082
|
+
const activePlaylistHasUrl = !!activePlaylistUrl;
|
|
4084
4083
|
(0, import_react14.useEffect)(() => {
|
|
4085
4084
|
if (events?.onVideoData && video) {
|
|
4086
4085
|
events.onVideoData(video);
|
|
@@ -4089,7 +4088,7 @@ var Video = ({
|
|
|
4089
4088
|
if (isLoading || !providedVideoData && !video) {
|
|
4090
4089
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "relative w-full h-full bg-[#151515]", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Loading, {}) }) });
|
|
4091
4090
|
}
|
|
4092
|
-
if (!isLoading && video && !
|
|
4091
|
+
if (!isLoading && video && !activePlaylistHasUrl && events?.onEmptyPlaylists) {
|
|
4093
4092
|
events.onEmptyPlaylists();
|
|
4094
4093
|
}
|
|
4095
4094
|
if (error || video?.error) {
|
|
@@ -4111,7 +4110,7 @@ var Video = ({
|
|
|
4111
4110
|
children
|
|
4112
4111
|
] }) });
|
|
4113
4112
|
}
|
|
4114
|
-
if (!
|
|
4113
|
+
if (!activePlaylist || !activePlaylistHasUrl) {
|
|
4115
4114
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_tailwind_merge3.twMerge)("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative w-full h-full bg-[#151515]", children: [
|
|
4116
4115
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Title, { title: video?.name || "" }),
|
|
4117
4116
|
children
|