@mottosports/motto-video-player 1.0.1-rc.20 → 1.0.1-rc.21
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 +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -112,6 +112,10 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
|
|
|
112
112
|
* The source URL of the video (DASH, HLS, or regular MP4)
|
|
113
113
|
*/
|
|
114
114
|
src: string;
|
|
115
|
+
/**
|
|
116
|
+
* The name of the player (used for Mux analytics. For example, 'Web' or 'Mobile App')
|
|
117
|
+
*/
|
|
118
|
+
playerName?: string;
|
|
115
119
|
/**
|
|
116
120
|
* Whether the video should autoplay
|
|
117
121
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -112,6 +112,10 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
|
|
|
112
112
|
* The source URL of the video (DASH, HLS, or regular MP4)
|
|
113
113
|
*/
|
|
114
114
|
src: string;
|
|
115
|
+
/**
|
|
116
|
+
* The name of the player (used for Mux analytics. For example, 'Web' or 'Mobile App')
|
|
117
|
+
*/
|
|
118
|
+
playerName?: string;
|
|
115
119
|
/**
|
|
116
120
|
* Whether the video should autoplay
|
|
117
121
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1334,7 +1334,12 @@ var useSkipControls = (videoRef, onSkipBack, onSkipForward) => {
|
|
|
1334
1334
|
var import_react4 = require("react");
|
|
1335
1335
|
var import_mux_data_shakaplayer = __toESM(require("@mux/mux-data-shakaplayer"));
|
|
1336
1336
|
var import_shaka_player2 = __toESM(require("shaka-player/dist/shaka-player.ui"));
|
|
1337
|
-
|
|
1337
|
+
|
|
1338
|
+
// package.json
|
|
1339
|
+
var version = "1.0.1-rc.21";
|
|
1340
|
+
|
|
1341
|
+
// src/hooks/useMuxAnalytics.ts
|
|
1342
|
+
var useMuxAnalytics = (playerRef, muxConfig, onMuxReady, onMuxDataUpdate, playerName) => {
|
|
1338
1343
|
const shakaPlayerMuxRef = (0, import_react4.useRef)(null);
|
|
1339
1344
|
const initializeMux = (0, import_react4.useCallback)(() => {
|
|
1340
1345
|
if (!muxConfig || !playerRef.current) return;
|
|
@@ -1349,8 +1354,8 @@ var useMuxAnalytics = (playerRef, muxConfig, onMuxReady, onMuxDataUpdate) => {
|
|
|
1349
1354
|
...muxConfig.errorTranslator && { errorTranslator: muxConfig.errorTranslator },
|
|
1350
1355
|
data: {
|
|
1351
1356
|
env_key: muxConfig.envKey,
|
|
1352
|
-
player_name:
|
|
1353
|
-
player_version:
|
|
1357
|
+
player_name: playerName,
|
|
1358
|
+
player_version: version,
|
|
1354
1359
|
player_init_time: playerInitTime,
|
|
1355
1360
|
...muxConfig.metadata
|
|
1356
1361
|
}
|
|
@@ -3227,6 +3232,7 @@ var Player = (0, import_react12.forwardRef)(
|
|
|
3227
3232
|
iconSizes,
|
|
3228
3233
|
events,
|
|
3229
3234
|
containerClassName,
|
|
3235
|
+
playerName,
|
|
3230
3236
|
...videoProps
|
|
3231
3237
|
}, ref) => {
|
|
3232
3238
|
const videoRef = (0, import_react12.useRef)(null);
|
|
@@ -3262,7 +3268,7 @@ var Player = (0, import_react12.forwardRef)(
|
|
|
3262
3268
|
updateMuxData,
|
|
3263
3269
|
handleMuxError,
|
|
3264
3270
|
destroyMux
|
|
3265
|
-
} = useMuxAnalytics(playerRef, muxConfig, events?.onMuxReady, events?.onMuxDataUpdate);
|
|
3271
|
+
} = useMuxAnalytics(playerRef, muxConfig, events?.onMuxReady, events?.onMuxDataUpdate, playerName);
|
|
3266
3272
|
const { setupEventListeners, cleanupEventListeners } = useEventHandlers(videoRef, {
|
|
3267
3273
|
onPlay: events?.onPlay,
|
|
3268
3274
|
onPause: events?.onPause,
|