@mottosports/motto-video-player 1.0.1-rc.49 → 1.0.1-rc.50
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 +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +29 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -51
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -270,9 +270,6 @@ styleInject(`/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
@layer utilities {
|
|
273
|
-
.pointer-events-auto {
|
|
274
|
-
pointer-events: auto;
|
|
275
|
-
}
|
|
276
273
|
.pointer-events-none {
|
|
277
274
|
pointer-events: none;
|
|
278
275
|
}
|
|
@@ -305,9 +302,6 @@ styleInject(`/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */
|
|
|
305
302
|
.inset-0 {
|
|
306
303
|
inset: calc(var(--spacing) * 0);
|
|
307
304
|
}
|
|
308
|
-
.top-0 {
|
|
309
|
-
top: calc(var(--spacing) * 0);
|
|
310
|
-
}
|
|
311
305
|
.top-4 {
|
|
312
306
|
top: calc(var(--spacing) * 4);
|
|
313
307
|
}
|
|
@@ -1121,8 +1115,7 @@ html[dir=rtl] .shaka-overflow-menu .shaka-overflow-button .material-svg-icon:fir
|
|
|
1121
1115
|
`);
|
|
1122
1116
|
|
|
1123
1117
|
// src/Player.tsx
|
|
1124
|
-
import { forwardRef, useEffect as useEffect5, useRef as useRef8, useImperativeHandle } from "react";
|
|
1125
|
-
import shaka3 from "shaka-player/dist/shaka-player.ui";
|
|
1118
|
+
import { forwardRef, useEffect as useEffect5, useRef as useRef8, useImperativeHandle, useCallback as useCallback8 } from "react";
|
|
1126
1119
|
|
|
1127
1120
|
// src/hooks/useShakaPlayer.ts
|
|
1128
1121
|
import { useRef, useCallback, useState } from "react";
|
|
@@ -1176,7 +1169,7 @@ var supportsWidevinePersistentLicenses = () => {
|
|
|
1176
1169
|
import initShakaPlayerMux from "@mux/mux-data-shakaplayer";
|
|
1177
1170
|
|
|
1178
1171
|
// package.json
|
|
1179
|
-
var version = "1.0.1-rc.
|
|
1172
|
+
var version = "1.0.1-rc.50";
|
|
1180
1173
|
|
|
1181
1174
|
// src/utils/licenseCache.ts
|
|
1182
1175
|
var PERSISTENT_LICENSE_PREFIX = "motto_lic_";
|
|
@@ -2717,9 +2710,6 @@ styleInject(`/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */
|
|
|
2717
2710
|
}
|
|
2718
2711
|
}
|
|
2719
2712
|
@layer utilities {
|
|
2720
|
-
.pointer-events-auto {
|
|
2721
|
-
pointer-events: auto;
|
|
2722
|
-
}
|
|
2723
2713
|
.pointer-events-none {
|
|
2724
2714
|
pointer-events: none;
|
|
2725
2715
|
}
|
|
@@ -2752,9 +2742,6 @@ styleInject(`/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */
|
|
|
2752
2742
|
.inset-0 {
|
|
2753
2743
|
inset: calc(var(--spacing) * 0);
|
|
2754
2744
|
}
|
|
2755
|
-
.top-0 {
|
|
2756
|
-
top: calc(var(--spacing) * 0);
|
|
2757
|
-
}
|
|
2758
2745
|
.top-4 {
|
|
2759
2746
|
top: calc(var(--spacing) * 4);
|
|
2760
2747
|
}
|
|
@@ -3595,7 +3582,6 @@ var Player = forwardRef(
|
|
|
3595
3582
|
}, ref) => {
|
|
3596
3583
|
const videoRef = useRef8(null);
|
|
3597
3584
|
const containerRef = useRef8(null);
|
|
3598
|
-
const adContainerRef = useRef8(null);
|
|
3599
3585
|
useImperativeHandle(ref, () => videoRef.current, []);
|
|
3600
3586
|
const { playerRef, initializePlayer, destroyPlayer, isRetrying } = useShakaPlayer({
|
|
3601
3587
|
src,
|
|
@@ -3662,34 +3648,32 @@ var Player = forwardRef(
|
|
|
3662
3648
|
showPulseAnimation: true,
|
|
3663
3649
|
liveThresholdSeconds: 15
|
|
3664
3650
|
});
|
|
3665
|
-
const initializeAds = () => {
|
|
3666
|
-
if (!imaConfig || !playerRef.current || !videoRef.current)
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
if (adContainer) {
|
|
3681
|
-
adManager.initClientSide(adContainer, videoRef.current, imaConfig.adsRenderingSettings);
|
|
3682
|
-
const adsRequest = {
|
|
3683
|
-
adTagUrl: imaConfig.adTagUrl,
|
|
3684
|
-
linearAdSlotWidth: imaConfig.linearAdSlotWidth || width || 640,
|
|
3685
|
-
linearAdSlotHeight: imaConfig.linearAdSlotHeight || height || 360,
|
|
3686
|
-
nonLinearAdSlotWidth: imaConfig.nonLinearAdSlotWidth || width || 640,
|
|
3687
|
-
nonLinearAdSlotHeight: imaConfig.nonLinearAdSlotHeight || 150
|
|
3688
|
-
};
|
|
3689
|
-
adManager.requestClientSideAds(adsRequest);
|
|
3651
|
+
const initializeAds = useCallback8(() => {
|
|
3652
|
+
if (!imaConfig?.adTagUrl || !playerRef.current || !videoRef.current || !uiRef.current) {
|
|
3653
|
+
return;
|
|
3654
|
+
}
|
|
3655
|
+
console.log("Initializing ads...");
|
|
3656
|
+
try {
|
|
3657
|
+
const player = playerRef.current;
|
|
3658
|
+
const video = videoRef.current;
|
|
3659
|
+
const ui = uiRef.current;
|
|
3660
|
+
const controls2 = ui.getControls();
|
|
3661
|
+
const container = controls2.getClientSideAdContainer();
|
|
3662
|
+
const adManager = player.getAdManager();
|
|
3663
|
+
if (!adManager) {
|
|
3664
|
+
console.error("Ad manager not available");
|
|
3665
|
+
return;
|
|
3690
3666
|
}
|
|
3667
|
+
adManager.initClientSide(container, video);
|
|
3668
|
+
const google = window.google;
|
|
3669
|
+
const adsRequest = new google.ima.AdsRequest();
|
|
3670
|
+
adsRequest.adTagUrl = imaConfig.adTagUrl;
|
|
3671
|
+
adManager.requestClientSideAds(adsRequest);
|
|
3672
|
+
console.log("Ads requested with tag:", imaConfig.adTagUrl);
|
|
3673
|
+
} catch (error) {
|
|
3674
|
+
console.error("Error initializing ads:", error);
|
|
3691
3675
|
}
|
|
3692
|
-
};
|
|
3676
|
+
}, [imaConfig]);
|
|
3693
3677
|
useEffect5(() => {
|
|
3694
3678
|
const video = videoRef.current;
|
|
3695
3679
|
if (!video) return;
|
|
@@ -3700,7 +3684,9 @@ var Player = forwardRef(
|
|
|
3700
3684
|
const cleanupQuality = setupQualityTracking();
|
|
3701
3685
|
configureQuality();
|
|
3702
3686
|
await initializeUI();
|
|
3703
|
-
|
|
3687
|
+
if (imaConfig) {
|
|
3688
|
+
initializeAds();
|
|
3689
|
+
}
|
|
3704
3690
|
} catch (error) {
|
|
3705
3691
|
console.error("Error during player initialization:", error);
|
|
3706
3692
|
handleMuxError(error);
|
|
@@ -3790,14 +3776,7 @@ var Player = forwardRef(
|
|
|
3790
3776
|
...filteredVideoProps
|
|
3791
3777
|
}
|
|
3792
3778
|
),
|
|
3793
|
-
/* @__PURE__ */ jsx8(LiveBadge, { isVisible: isLiveBadgeVisible })
|
|
3794
|
-
imaConfig && /* @__PURE__ */ jsx8(
|
|
3795
|
-
"div",
|
|
3796
|
-
{
|
|
3797
|
-
ref: adContainerRef,
|
|
3798
|
-
className: "absolute top-0 left-0 w-full h-full pointer-events-auto"
|
|
3799
|
-
}
|
|
3800
|
-
)
|
|
3779
|
+
/* @__PURE__ */ jsx8(LiveBadge, { isVisible: isLiveBadgeVisible })
|
|
3801
3780
|
]
|
|
3802
3781
|
}
|
|
3803
3782
|
);
|