@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.mjs CHANGED
@@ -1137,7 +1137,7 @@ var isPlayReadySupported = () => {
1137
1137
  import initShakaPlayerMux from "@mux/mux-data-shakaplayer";
1138
1138
 
1139
1139
  // package.json
1140
- var version = "1.0.1-rc.32";
1140
+ var version = "1.0.1-rc.35";
1141
1141
 
1142
1142
  // src/hooks/useShakePlayer.ts
1143
1143
  var useShakePlayer = ({
@@ -1168,21 +1168,21 @@ var useShakePlayer = ({
1168
1168
  let cert = null;
1169
1169
  if (isDRM) {
1170
1170
  const isPlayReady = isPlayReadySupported();
1171
- if (isAppleDevice() && src.drm.fairplay?.certificate_url) {
1172
- const req = await fetch(src.drm.fairplay.certificate_url);
1171
+ if (isAppleDevice() && src.drm.fairplay?.certificateUrl) {
1172
+ const req = await fetch(src.drm.fairplay.certificateUrl);
1173
1173
  cert = await req.arrayBuffer();
1174
- manifestUrl = src.drm.fairplay.playlist_url;
1175
- } else if (isPlayReady && src.drm.playready?.license_url) {
1176
- manifestUrl = src.drm.playready.playlist_url;
1174
+ manifestUrl = src.drm.fairplay.playlistUrl;
1175
+ } else if (isPlayReady && src.drm.playready?.licenseUrl) {
1176
+ manifestUrl = src.drm.playready.playlistUrl;
1177
1177
  } else {
1178
- manifestUrl = src.drm?.widevine?.playlist_url || "";
1178
+ manifestUrl = src.drm?.widevine?.playlistUrl || "";
1179
1179
  }
1180
1180
  player.configure({
1181
1181
  drm: {
1182
1182
  servers: {
1183
- "com.widevine.alpha": src.drm.widevine?.license_url,
1184
- "com.microsoft.playready": src.drm.playready?.license_url,
1185
- "com.apple.fps": src.drm.fairplay?.license_url
1183
+ "com.widevine.alpha": src.drm.widevine?.licenseUrl,
1184
+ "com.microsoft.playready": src.drm.playready?.licenseUrl,
1185
+ "com.apple.fps": src.drm.fairplay?.licenseUrl
1186
1186
  },
1187
1187
  ...cert && {
1188
1188
  advanced: {
@@ -1197,7 +1197,7 @@ var useShakePlayer = ({
1197
1197
  if (netEngine) {
1198
1198
  netEngine.registerRequestFilter((type, request) => {
1199
1199
  if (type === shaka.net.NetworkingEngine.RequestType.LICENSE) {
1200
- request.headers["x-dt-custom-data"] = src.drm.token;
1200
+ request.headers["x-dt-auth-token"] = src.drm.token;
1201
1201
  }
1202
1202
  });
1203
1203
  netEngine.registerResponseFilter((type, response) => {
@@ -3500,8 +3500,6 @@ var Player = forwardRef(
3500
3500
  ref: containerRef,
3501
3501
  className: containerClasses,
3502
3502
  style: containerStyle,
3503
- "data-shaka-player-container": true,
3504
- "data-shaka-player-cast-receiver-id": chromecastConfig?.receiverApplicationId,
3505
3503
  children: [
3506
3504
  /* @__PURE__ */ jsx8(
3507
3505
  "video",
@@ -4039,7 +4037,8 @@ var Video = ({
4039
4037
  const video = providedVideoData || data;
4040
4038
  const { t } = useMessages_default(locale);
4041
4039
  const activePlaylist = findHLSPlaylist(video);
4042
- const hlsUrl = activePlaylist?.url;
4040
+ const activePlaylistUrl = activePlaylist?.url ?? activePlaylist?.drm?.widevine?.playlistUrl ?? activePlaylist?.drm?.playready?.playlistUrl ?? activePlaylist?.drm?.fairplay?.playlistUrl;
4041
+ const activePlaylistHasUrl = !!activePlaylistUrl;
4043
4042
  useEffect7(() => {
4044
4043
  if (events?.onVideoData && video) {
4045
4044
  events.onVideoData(video);
@@ -4048,7 +4047,7 @@ var Video = ({
4048
4047
  if (isLoading || !providedVideoData && !video) {
4049
4048
  return /* @__PURE__ */ jsx9("div", { className: twMerge3("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ jsx9("div", { className: "relative w-full h-full bg-[#151515]", children: /* @__PURE__ */ jsx9(Loading, {}) }) });
4050
4049
  }
4051
- if (!isLoading && video && !hlsUrl && events?.onEmptyPlaylists) {
4050
+ if (!isLoading && video && !activePlaylistHasUrl && events?.onEmptyPlaylists) {
4052
4051
  events.onEmptyPlaylists();
4053
4052
  }
4054
4053
  if (error || video?.error) {
@@ -4070,7 +4069,7 @@ var Video = ({
4070
4069
  children
4071
4070
  ] }) });
4072
4071
  }
4073
- if (!hlsUrl) {
4072
+ if (!activePlaylist || !activePlaylistHasUrl) {
4074
4073
  return /* @__PURE__ */ jsx9("div", { className: twMerge3("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ jsxs7("div", { className: "relative w-full h-full bg-[#151515]", children: [
4075
4074
  /* @__PURE__ */ jsx9(Title, { title: video?.name || "" }),
4076
4075
  children