@mux/mux-player-react 0.1.0-canary.9-cbb4bc0 → 1.0.0-beta.0

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/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Mux, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -103,6 +103,100 @@ Enable the [Google Cast](https://developers.google.com/cast) button in the contr
103
103
  <script defer src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>
104
104
  ```
105
105
 
106
+ ### Hiding controls
107
+
108
+ By default, Mux Player will show all the controls associated with the current player size and stream type.
109
+
110
+ To hide certain controls, use CSS variables like this:
111
+ `--play-button` will control the display of the play button. Set it to `none` to hide it completely.
112
+
113
+ ```css
114
+ mux-player {
115
+ --play-button: none;
116
+ }
117
+ ```
118
+
119
+ CSS vars can also be passed inline
120
+
121
+ ```jsx
122
+ <MuxPlayer style={{ '--play-button': 'none' }}></MuxPlayer>
123
+ ```
124
+
125
+ #### Controls sections
126
+
127
+ It's possible to target specific sections of the player by prefixing the CSS vars.
128
+ The following sections are available:
129
+
130
+ - `top` the top control bar that shows on the small player size
131
+ - `center` the center controls that show the seek forward/backward button and play button
132
+ - `bottom` the bottom control bar
133
+
134
+ ```jsx
135
+ <MuxPlayer style={{ '--center-controls': 'none', '--top-captions-button': 'none' }}></MuxPlayer>
136
+ ```
137
+
138
+ #### Available CSS variables
139
+
140
+ The below CSS selector shows all available CSS vars for hiding, each one can be prefixed with a section.
141
+
142
+ ```css
143
+ mux-player {
144
+ /* Hide all controls at once */
145
+ --controls: none;
146
+
147
+ /* Target all sections by excluding the section prefix */
148
+ --play-button: none;
149
+ --seek-live-button: none;
150
+ --seek-backward-button: none;
151
+ --seek-forward-button: none;
152
+ --mute-button: none;
153
+ --captions-button: none;
154
+ --airplay-button: none;
155
+ --pip-button: none;
156
+ --fullscreen-button: none;
157
+ --cast-button: none;
158
+ --playback-rate-button: none;
159
+ --volume-range: none;
160
+ --time-range: none;
161
+ --time-display: none;
162
+ --duration-display: none;
163
+
164
+ /* Target a specific section by prefixing the CSS var with (top|center|bottom) */
165
+ --center-controls: none;
166
+ --bottom-play-button: none;
167
+ }
168
+ ```
169
+
170
+ ### CSS Parts
171
+
172
+ Mux Player uses a [shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM)
173
+ to encapsulate its styles and behaviors.
174
+ As a result, it's not possible to target its internals with the usual CSS selectors.
175
+ Instead, some components expose **parts** that can be targeted with the [CSS part selector](https://developer.mozilla.org/en-US/docs/Web/CSS/::part)
176
+ , or `::part()`.
177
+
178
+ ```html
179
+ <!-- Global style in HTML or added using preferred React styles convention/library -->
180
+ <style>
181
+ mux-player::part(center play button) {
182
+ display: none;
183
+ }
184
+ </style>
185
+ ```
186
+
187
+ ```jsx
188
+ <MuxPlayer playback-id="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"></MuxPlayer>
189
+ ```
190
+
191
+ Supported **parts**:
192
+ `seek-live`, `layer`, `media-layer`, `poster-layer`, `vertical-layer`, `centered-layer`, `gesture-layer`,
193
+ `top`, `center`, `bottom`, `play`, `button`, `seek-backward`, `seek-forward`, `mute`,
194
+ `captions`, `airplay`, `pip`, `cast`, `fullscreen`, `playbackrate`, `volume`, `range`, `time`, `display`
195
+
196
+ CSS parts allow you to style each part individually with a selector like `::part(center play button)`
197
+ or target multiple elements if the part is assigned to multiple elements internally, usage `::part(button)`.
198
+ Every CSS property can be declared in the selector, this makes it a very powerfull API.
199
+
106
200
  ### Tokens
107
201
 
108
202
  Using JSON Web Tokens allows you to secure your media content from public playback, and Mux Video provides a way to do [set this up for your assets](https://docs.mux.com/guides/video/secure-video-playback). To apply these tokens in `<MuxPlayer/>`, you can use the `tokens` property. `<MuxPlayer/>` will automatically generate appropriate URLs for each asset for any provided tokens. The possible tokens are `playback` (for the video asset/`playback-id`), `thumbnail` (for the poster image), and `storyboard` (for the seek preview thumbnail images).
@@ -145,54 +239,40 @@ Example:
145
239
 
146
240
  ### Props
147
241
 
148
- | Prop | Type | Description | Default |
149
- | ----------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- |
150
- | `playbackId` | `string` | The playback ID for your Mux Asset or Mux Live Stream. This will also be used for automatically assigning a [poster image](https://docs.mux.com/guides/video/get-images-from-a-video) and (thumbnail previews)[https://docs.mux.com/guides/video/create-timeline-hover-previews]. For more, check out the [Mux Docs](https://docs.mux.com/guides/video/play-your-videos#1-get-your-playback-id). | N/A |
151
- | `envKey` | `string` | Your Mux Data environment key. Note that this is different than your API Key. Get your env key from the "Mux Data" part of your [Mux Environments Dashboard](https://dashboard.mux.com/environments). If undefined, the environment will be inferred based on your Mux Video asset. | `undefined` |
152
- | `streamType` | `"on-demand" \| "live" \| "ll-live"` | The type of stream associated with your Mux Asset. Used to determine what UI/controls to show and what optimizations to make for playback. | `"on-demand"` |
153
- | `audio` | `boolean` | Indicate that you want an "audio only" UI/chrome. This may be used for audio-only assets or audio+video assets. | `false` |
154
- | `metadata` | `object`\* | An object for configuring any metadata you'd like to send to Mux Data. For more, see the [Metadata section](#metadata), below. | N/A |
155
- | `tokens` | `object`\* | An object for configuring any tokens for your assets if you're using [Signed URLs](https://docs.mux.com/guides/video/secure-video-playback). For more, see the [Tokens section](#tokens), below. | N/A |
156
- | `debug` | `boolean` | Enables debug mode for the underlying playback engine (currently hls.js) and mux-embed, providing additional information in the console. | `false` |
157
- | `startTime` | `number` (seconds) | Specify where in the media's timeline you want playback to start. | `0` |
158
- | `thumbnailTime` | `number` (seconds) | Offset for the poster image you want to show before loading media. If no `thumbnailTime` is specified, `startTime` will be used by default. NOTE: This feature currently cannot be used with `tokens.thumbnail`. | `0` |
159
- | `preferMse` | `boolean` | Use the underlying playback engine (currently hls.js), even if native playback is supported (e.g. in Safari). For more, see the section on [`preferMse`](#preferMse) | `false` |
160
- | `defaultHiddenCaptions` | `boolean` | Hide captions by default instead of showing them on initial load (when available) | `false` |
161
- | `forwardSeekOffset` | `number` (seconds) | Offset applied to the forward seek button | `10` |
162
- | `backwardSeekOffset` | `number` (seconds) | Offset applied to the backward seek button | `10` |
163
- | `primaryColor` | (Any valid CSS color style) | The primary color used by the player | N/A |
164
- | `secondaryColor` | (Any valid CSS color style) | The secondary color used by the player | N/A |
165
- | `tertiaryColor` | (Any valid CSS color style) | The tertiary color used by the player | N/A |
166
- | `currentTime` | `number` (seconds) | Sets the current time of the media | N/A |
167
- | `volume` | `number` (0-1) | Sets the volume of the player from 0 to 1. | Varies |
168
- | `muted` | `boolean` | Toggles the muted state of the player. | Varies |
169
- | `paused` | `boolean` | Toggles the paused state of the player | N/A |
170
- | `autoPlay` | `boolean` | Toggles whether or not media should auto-play when initially loaded | N/A |
171
- | `playbackRate` | `number` | Applies a multiplier to the media's playback rate, either speeding it up or slowing it down. | `1` |
172
- | `loop` | `boolean` | Automatically loop playback of your media when it finishes. | `false` |
173
- | `playsInline` | `boolean` | Set to assert that media should be played inline. Useful for mobile playback cases. | `false` |
174
- | `crossOrigin` | `string` | Establishes various CORS policies. For more details, see [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-crossorigin) | N/A |
175
- | `poster` | `string` (URL) | Assigns a poster image URL. Will use the automatically generated poster based on your playback-id by default. | Derived |
242
+ | Prop | Type | Description | Default |
243
+ | -------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- |
244
+ | `playbackId` | `string` | The playback ID for your Mux Asset or Mux Live Stream. This will also be used for automatically assigning a [poster image](https://docs.mux.com/guides/video/get-images-from-a-video) and (thumbnail previews)[https://docs.mux.com/guides/video/create-timeline-hover-previews]. For more, check out the [Mux Docs](https://docs.mux.com/guides/video/play-your-videos#1-get-your-playback-id). | N/A |
245
+ | `envKey` | `string` | Your Mux Data environment key. Note that this is different than your API Key. Get your env key from the "Mux Data" part of your [Mux Environments Dashboard](https://dashboard.mux.com/environments). If undefined, the environment will be inferred based on your Mux Video asset. | `undefined` |
246
+ | `streamType` | `"on-demand" \| "live" \| "ll-live" \|"live:dvr" \| "ll-live:dvr"` | The type of stream associated with your Mux Asset. Used to determine what UI/controls to show and what optimizations to make for playback. | `"on-demand"` |
247
+ | `audio` | `boolean` | Indicate that you want an "audio only" UI/chrome. This may be used for audio-only assets or audio+video assets. | `false` |
248
+ | `metadata` | `object`\* | An object for configuring any metadata you'd like to send to Mux Data. For more, see the [Metadata section](#metadata), below. | N/A |
249
+ | `tokens` | `object`\* | An object for configuring any tokens for your assets if you're using [Signed URLs](https://docs.mux.com/guides/video/secure-video-playback). For more, see the [Tokens section](#tokens), below. | N/A |
250
+ | `debug` | `boolean` | Enables debug mode for the underlying playback engine (currently hls.js) and mux-embed, providing additional information in the console. | `false` |
251
+ | `startTime` | `number` (seconds) | Specify where in the media's timeline you want playback to start. | `0` |
252
+ | `thumbnailTime` | `number` (seconds) | Offset for the poster image you want to show before loading media. If no `thumbnailTime` is specified, `startTime` will be used by default. NOTE: This feature currently cannot be used with `tokens.thumbnail`. | `0` |
253
+ | `preferMse` | `boolean` | Use the underlying playback engine (currently hls.js), even if native playback is supported (e.g. in Safari). For more, see the section on [`preferMse`](#preferMse) | `false` |
254
+ | `defaultHiddenCaptions` | `boolean` | Hide captions by default instead of showing them on initial load (when available) | `false` |
255
+ | `defaultShowRemainingTime` | `boolean` | Show remaining playback time (instead of current playback time) by default | `false` |
256
+ | `forwardSeekOffset` | `number` (seconds) | Offset applied to the forward seek button | `10` |
257
+ | `backwardSeekOffset` | `number` (seconds) | Offset applied to the backward seek button | `10` |
258
+ | `primaryColor` | (Any valid CSS color style) | The primary color used by the player | N/A |
259
+ | `secondaryColor` | (Any valid CSS color style) | The secondary color used by the player | N/A |
260
+ | `currentTime` | `number` (seconds) | Sets the current time of the media | N/A |
261
+ | `volume` | `number` (0-1) | Sets the volume of the player from 0 to 1. | Varies |
262
+ | `muted` | `boolean` | Toggles the muted state of the player. | Varies |
263
+ | `paused` | `boolean` | Toggles the paused state of the player | N/A |
264
+ | `autoPlay` | `boolean` | Toggles whether or not media should auto-play when initially loaded | N/A |
265
+ | `playbackRate` | `number` | Applies a multiplier to the media's playback rate, either speeding it up or slowing it down. | `1` |
266
+ | `playbackRates` | `number[]` | The array of numbers that will be used by the playback rate button while toggling through rates. | `1` |
267
+ | `loop` | `boolean` | Automatically loop playback of your media when it finishes. | `false` |
268
+ | `nohotkeys` | `boolean` | Toggles keyboard shortcut (hot keys) support when focus in inside the player. | `false` |
269
+ | `playsInline` | `boolean` | Set to assert that media should be played inline. Useful for mobile playback cases. | `false` |
270
+ | `crossOrigin` | `string` | Establishes various CORS policies. For more details, see [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-crossorigin) | N/A |
271
+ | `title` | `string` | Show the title for your content. | `""` |
272
+ | `poster` | `string` (URL) | Assigns a poster image URL. Will use the automatically generated poster based on your playback-id by default. | Derived |
273
+ | `beaconCollectionDomain` | `string` (Domain name) | Assigns a custom domain to be used for Mux Data collection. | N/A |
274
+ | `customDomain` | `string` (Domain name) | Assigns a custom domain to be used for Mux Video. Will use the standard `mux.com` domain with your playback-id for poster, video, and thumbnail URLs by default. | N/A |
176
275
 
177
276
  ### Callbacks
178
277
 
179
- `<MuxPlayer/>` has a number of callbacks associated with events for media loading, playback, and the player itself.
180
-
181
- | Prop | Description |
182
- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
183
- | `onLoadStart` | Invoked when the media starts loading |
184
- | `onLoadedMetadata` | Invoked when the media's metadata has loaded |
185
- | `onProgress` | Description |
186
- | `onDurationChange` | Invoked when the media's duration changes, generally either because live media is coming to an end or a new playback-id has been set |
187
- | `onVolumeChange` | Invoked when the player's volume changes |
188
- | `onRateChange` | Invoked when the player's playbackRate changes |
189
- | `onResize` | Invoked when the player resizes |
190
- | `onWaiting` | Invoked when playback is waiting to load more media to play (rebuffering). |
191
- | `onPlay` | Invoked when playback begins |
192
- | `onPlaying` | Invoked when playback is ready after e.g. a pause or temporary rebuffering |
193
- | `onPause` | Invoked when playback is paused |
194
- | `onTimeUpdate` | Invoked when the media's currentTime changes, either from playback or seeking |
195
- | `onSeeking` | Invoked when an attempt to seek forward or backward in the media begins |
196
- | `onSeeked` | Invoked when an attempt to seek forward or backward in the media finishes |
197
- | `onEnded` | Invoked when media playback reaches the end of the media |
198
- | `onError` | Invoked when an error occurs in playback or in the player |
278
+ `<MuxPlayer/>` has a number of callbacks associated with events for media loading, playback, and the player itself. For example, a callback for 'loadstart` event is`onLoadStart`. See [mux-player's document](https://github.com/muxinc/elements/blob/main/packages/mux-player/README.md#events) for detail of events.
@@ -0,0 +1,2 @@
1
+ "use strict";var J=Object.create;var p=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},m=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of $(t))!X.call(e,a)&&a!==n&&p(e,a,{get:()=>t[a],enumerable:!(o=Y(t,a))||o.enumerable});return e};var ee=(e,t,n)=>(n=e!=null?J(Q(e)):{},m(t||!e||!e.__esModule?p(n,"default",{value:e,enumerable:!0}):n,e)),te=e=>m(p({},"__esModule",{value:!0}),e);var Pe={};B(Pe,{MediaError:()=>v.MediaError,default:()=>ge});module.exports=te(Pe);var s=ee(require("react")),v=require("@mux/mux-player");var E={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay"},ne=e=>e==null,re=(e,t)=>ne(t)?!1:e in t,ae=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),oe=(e,t)=>{if(!(typeof t=="boolean"&&!t)){if(re(e,E))return E[e];if(typeof t!=null)return/[A-Z]/.test(e)?ae(e):e}};var ie=(e,t)=>typeof e=="boolean"?"":e,f=(e={})=>Object.entries(e).reduce((t,[n,o])=>{let a=oe(n,o);if(!a)return t;let i=ie(o,n);return t[a]=i,t},{});var x=require("react");var d=require("react"),M=(...e)=>{let t=(0,d.useRef)(null);return(0,d.useEffect)(()=>{e.forEach(n=>{!n||(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t};var g=require("react"),se=Object.prototype.hasOwnProperty,le=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.some((a,i)=>t[i]===a);let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let a=0;a<n.length;a++)if(!se.call(t,n[a])||!Object.is(e[n[a]],t[n[a]]))return!1;return!0},c=(e,t,n)=>!le(t,e[n]),ue=(e,t,n)=>{e[n]=t},ye=(e,t,n,o=ue,a=c)=>(0,g.useEffect)(()=>{let i=n==null?void 0:n.current;!i||!a(i,t,e)||o(i,t,e)},[n==null?void 0:n.current,t]),u=ye;var pe=()=>{try{return"1.0.0-beta.0"}catch{}return"UNKNOWN"},de=pe(),P=()=>de;var ce=s.default.forwardRef(({children:e,...t},n)=>s.default.createElement("mux-player",f({...t,ref:n}),e)),r=(e,t,n)=>(0,s.useEffect)(()=>{let o=t==null?void 0:t.current;if(!(!o||!n))return o.addEventListener(e,n),()=>{o.removeEventListener(e,n)}},[t==null?void 0:t.current,n]),me=(e,t)=>{let{onAbort:n,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:b,onLoadedData:T,onLoadedMetadata:R,onProgress:h,onDurationChange:k,onVolumeChange:L,onRateChange:C,onResize:O,onWaiting:S,onPlay:w,onPlaying:G,onTimeUpdate:V,onPause:A,onSeeking:N,onSeeked:I,onStalled:K,onSuspend:D,onEnded:U,onError:H,metadata:j,tokens:z,paused:F,playbackId:W,playbackRates:Z,..._}=t;return u("playbackRates",Z,e),u("metadata",j,e),u("tokens",z,e),u("playbackId",W,e),u("paused",F,e,(l,y)=>{y!=null&&(y?l.pause():l.play())},(l,y,q)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:c(l,y,q)),r("abort",e,n),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,b),r("loadeddata",e,T),r("loadedmetadata",e,R),r("progress",e,h),r("durationchange",e,k),r("volumechange",e,L),r("ratechange",e,C),r("resize",e,O),r("waiting",e,S),r("play",e,w),r("playing",e,G),r("timeupdate",e,V),r("pause",e,A),r("seeking",e,N),r("seeked",e,I),r("stalled",e,K),r("suspend",e,D),r("ended",e,U),r("error",e,H),[_]},Ee=P(),fe="mux-player-react",Me=s.default.forwardRef((e,t)=>{let n=(0,x.useRef)(null),o=M(n,t),[a]=me(n,e);return s.default.createElement(ce,{ref:o,playerSoftwareName:fe,playerSoftwareVersion:Ee,...a})}),ge=Me;
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
4
+ "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { StreamTypes } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferMse: boolean;\n streamType: ValueOf<StreamTypes> | 'vod';\n startTime: number;\n children: never[];\n};\n\ninterface MuxPlayerElementEventMap extends HTMLVideoElementEventMap {}\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n tertiaryColor?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n};\n\ntype KeyTypes = string | number | symbol;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T = unknown>(k: KeyTypes, o: T): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
+ "mappings": "4jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,yCAAAE,KAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAiC,qBAGjCC,EAA2B,2BCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,UACZ,EAIaC,GAASC,GAAsCA,GAAK,KAGpDC,GAAU,CAAcC,EAAaC,IAC5CJ,GAAMI,CAAC,EAAU,GACdD,KAAKC,EAGRC,GAAeC,GAAmBA,EAAO,QAAQ,SAAWC,GAAU,IAAIA,EAAM,YAAY,GAAG,EAExFC,GAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,GAAQO,EAAUV,CAAsB,EAAG,OAAOA,EAAuBU,GAC7E,GAAI,OAAOC,GAAa,KACxB,MAAI,QAAQ,KAAKD,CAAQ,EAAUJ,GAAYI,CAAQ,EAChDA,EACT,EAGO,IAAME,GAAoB,CAACC,EAAgBC,IAC5C,OAAOD,GAAc,UAAkB,GACpCA,EAGIE,EAAgB,CAACC,EAAQ,CAAC,IAC9B,OAAO,QAAQA,CAAK,EAAE,OAAgC,CAACC,EAAkB,CAACH,EAAUD,CAAS,IAAM,CACxG,IAAMK,EAAWC,GAAiBL,EAAUD,CAAS,EAGrD,GAAI,CAACK,EACH,OAAOD,EAGT,IAAMG,EAAYR,GAAkBC,EAAWC,CAAQ,EACvD,OAAAG,EAAiBC,GAAYE,EACtBH,CACT,EAAG,CAAC,CAAC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EAAiB,EACzCC,GAAqB,mBAErBC,GAAY,EAAAhD,QAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAM8C,KAAiB,UAAyB,IAAI,EAC9CC,EAAYC,EAAgBF,EAAgB9C,CAAG,EAC/C,CAACmC,CAAc,EAAI7B,GAAUwC,EAAgB/C,CAAK,EAExD,OACE,EAAAF,QAAA,cAACD,GAAA,CAEC,IAAKmD,EACL,mBAAoBH,GACpB,sBAAuBF,GACtB,GAAGP,EACN,CAEJ,CAAC,EAEMc,GAAQJ",
6
+ "names": ["src_exports", "__export", "src_default", "__toCommonJS", "import_react", "import_mux_player", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "import_react", "import_react", "useCombinedRefs", "refs", "targetRef", "ref", "import_react", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "metadata", "tokens", "paused", "playbackId", "playbackRates", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "playerRef", "useCombinedRefs", "src_default"]
7
+ }
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import y,{useEffect as ne}from"react";import{MediaError as Me}from"@mux/mux-player";var d={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay"},z=e=>e==null,F=(e,t)=>z(t)?!1:e in t,W=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Z=(e,t)=>{if(!(typeof t=="boolean"&&!t)){if(F(e,d))return d[e];if(typeof t!=null)return/[A-Z]/.test(e)?W(e):e}};var _=(e,t)=>typeof e=="boolean"?"":e,c=(e={})=>Object.entries(e).reduce((t,[n,o])=>{let a=Z(n,o);if(!a)return t;let i=_(o,n);return t[a]=i,t},{});import{useRef as re}from"react";import{useEffect as q,useRef as J}from"react";var m=(...e)=>{let t=J(null);return q(()=>{e.forEach(n=>{!n||(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t};import{useEffect as Y}from"react";var $=Object.prototype.hasOwnProperty,Q=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.some((a,i)=>t[i]===a);let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let a=0;a<n.length;a++)if(!$.call(t,n[a])||!Object.is(e[n[a]],t[n[a]]))return!1;return!0},p=(e,t,n)=>!Q(t,e[n]),X=(e,t,n)=>{e[n]=t},B=(e,t,n,o=X,a=p)=>Y(()=>{let i=n==null?void 0:n.current;!i||!a(i,t,e)||o(i,t,e)},[n==null?void 0:n.current,t]),l=B;var ee=()=>{try{return"1.0.0-beta.0"}catch{}return"UNKNOWN"},te=ee(),E=()=>te;var ae=y.forwardRef(({children:e,...t},n)=>y.createElement("mux-player",c({...t,ref:n}),e)),r=(e,t,n)=>ne(()=>{let o=t==null?void 0:t.current;if(!(!o||!n))return o.addEventListener(e,n),()=>{o.removeEventListener(e,n)}},[t==null?void 0:t.current,n]),oe=(e,t)=>{let{onAbort:n,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:f,onLoadedData:M,onLoadedMetadata:g,onProgress:P,onDurationChange:v,onVolumeChange:x,onRateChange:b,onResize:T,onWaiting:R,onPlay:h,onPlaying:k,onTimeUpdate:L,onPause:C,onSeeking:O,onSeeked:S,onStalled:w,onSuspend:G,onEnded:V,onError:A,metadata:N,tokens:I,paused:K,playbackId:D,playbackRates:U,...H}=t;return l("playbackRates",U,e),l("metadata",N,e),l("tokens",I,e),l("playbackId",D,e),l("paused",K,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,j)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:p(s,u,j)),r("abort",e,n),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,f),r("loadeddata",e,M),r("loadedmetadata",e,g),r("progress",e,P),r("durationchange",e,v),r("volumechange",e,x),r("ratechange",e,b),r("resize",e,T),r("waiting",e,R),r("play",e,h),r("playing",e,k),r("timeupdate",e,L),r("pause",e,C),r("seeking",e,O),r("seeked",e,S),r("stalled",e,w),r("suspend",e,G),r("ended",e,V),r("error",e,A),[H]},ie=E(),se="mux-player-react",le=y.forwardRef((e,t)=>{let n=re(null),o=m(n,t),[a]=oe(n,e);return y.createElement(ae,{ref:o,playerSoftwareName:se,playerSoftwareVersion:ie,...a})}),Te=le;export{Me as MediaError,Te as default};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
4
+ "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { StreamTypes } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferMse: boolean;\n streamType: ValueOf<StreamTypes> | 'vod';\n startTime: number;\n children: never[];\n};\n\ninterface MuxPlayerElementEventMap extends HTMLVideoElementEventMap {}\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n tertiaryColor?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n};\n\ntype KeyTypes = string | number | symbol;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T = unknown>(k: KeyTypes, o: T): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
+ "mappings": "AAAA,OAAOA,GAAS,aAAAC,OAAiB,QAGjC,OAAS,cAAAC,OAAkB,kBCC3B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MediaError", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "useRef", "useEffect", "useRef", "useCombinedRefs", "refs", "targetRef", "ref", "useEffect", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "useEffect", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "metadata", "tokens", "paused", "playbackId", "playbackRates", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
7
+ }
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../src/env.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/autoplay.d.ts","../../playback-core/dist/types/errors.d.ts","../../playback-core/dist/types/index.d.ts","../../mux-video/dist/types/CustomVideoElement.d.ts","../../mux-video/dist/types/index.d.ts","../../mux-player/dist/types/video-api.d.ts","../../mux-player/dist/types/index.d.ts","../src/common/utils.ts","../src/useCombinedRefs.ts","../src/useObjectPropEffect.ts","../src/index.tsx","../../../types/mux-embed.d.ts","../../../types/mux.d.ts"],"fileInfos":[{"version":"3ac1b83264055b28c0165688fda6dfcc39001e9e7828f649299101c23ad0a0c3","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84",{"version":"72704b10d97777e15f1a581b73f88273037ef752d2e50b72287bd0a90af64fe6","affectsGlobalScope":true},{"version":"dbb73d4d99be496175cb432c74c2615f78c76f4272f1d83cba11ee0ed6dbddf0","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f","a6b7e3c103b4424b9c9d6dce7f059c16bbf037844b9f418775b86506d3d141d4",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"ea0aa24a32c073b8639aa1f3130ba0add0f0f2f76b314d9ba988a5cb91d7e3c4","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"0bcebfaf66be25c793d0281a8dce761bc078d203f02c573e6ee3b844a5ad7fbc","affectsGlobalScope":true},"ece0cccc693a3364f05f68d7feb4d472e05b9f2eaea80f19fc10b17a0a6aa14d","e19277f843527448cadd35fd674e358d0d2a7f261e9631026ecc82feb85ecec8","8b1a6692156440f6585937b6b8de1c2692e7cac5c43aeb8893bfbd293f719552","eb22b463efe9cdd4c0852f62cf92ca3dfa59b136d82e28b7473b67105d19c780","6b8ca5a4e0a75f6c8e48c0fc2ff204502f780db438b3d56d07d5c8b5da2da9c2",{"version":"35a3049e63a6c25a98834a50fad77e7879dfed1eedd1fa77924006ef93e6fecb","affectsGlobalScope":true},"87fda1eede614362200d25b30c9e443a2688aa7f499226acee2a35ee68d46038","420c672f7a8fc20240d8c111e779c8ee2f58be959360193558f0d5037b1c4120","01aacd272dab2b1d9a461f9768ba4cb50252ac44e800725fe461a8adaeca6e3b","0a1108b169c08a6588b5f5f6d745a1e1ed5dbc1414034c557c14222d401fcfdc","721526438283d40d50c6356064d346f1c57693f7e9930a3854c20c73bf4380a5","210ac677697bf41207770b8d31d1c4208befaa85b881b38825c66d385bad9874","c5a4764697efe3b6b4eaf19b3dc1880cf3df665d30ec93e212233c29a2fa7207",{"version":"ee8e401f800f3d48020eda76c4fd27afd5bab992195252939329ae56dc9d1889","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":2,"module":5,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[37,38,39,40],[36,41,45,49,50,51,52],[41],[42,45,47,48],[47],[46],[42,45,46],[42],[42,43,44,54]],"referencedMap":[[41,1],[53,2],[51,3],[52,3],[49,4],[48,5],[46,6],[47,7],[43,8],[45,9],[55,8]],"exportedModulesMap":[[41,1],[53,2],[51,3],[52,3],[49,4],[48,5],[46,6],[47,7],[43,8],[45,9],[55,8]],"semanticDiagnosticsPerFile":[39,37,41,40,38,42,7,8,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,35,32,33,34,1,10,9,50,36,53,51,52,49,48,46,47,43,44,45,54,55]},"version":"4.6.4"}
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../src/env.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/autoplay.d.ts","../../playback-core/dist/types/errors.d.ts","../../playback-core/dist/types/tracks.d.ts","../../playback-core/dist/types/index.d.ts","../../mux-video/dist/types/CustomVideoElement.d.ts","../../mux-video/dist/types/index.d.ts","../../../shared/polyfills/index.d.ts","../../mux-player/dist/types/video-api.d.ts","../../mux-player/dist/types/helpers.d.ts","../../mux-player/dist/types/index.d.ts","../src/common/utils.ts","../src/useCombinedRefs.ts","../src/useObjectPropEffect.ts","../src/index.tsx","../../../types/media-chrome.d.ts","../../../types/mux-embed.d.ts","../../../types/mux.d.ts"],"fileInfos":[{"version":"3ac1b83264055b28c0165688fda6dfcc39001e9e7828f649299101c23ad0a0c3","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84",{"version":"72704b10d97777e15f1a581b73f88273037ef752d2e50b72287bd0a90af64fe6","affectsGlobalScope":true},{"version":"dbb73d4d99be496175cb432c74c2615f78c76f4272f1d83cba11ee0ed6dbddf0","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f","a6b7e3c103b4424b9c9d6dce7f059c16bbf037844b9f418775b86506d3d141d4",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"ea0aa24a32c073b8639aa1f3130ba0add0f0f2f76b314d9ba988a5cb91d7e3c4","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"0bcebfaf66be25c793d0281a8dce761bc078d203f02c573e6ee3b844a5ad7fbc","affectsGlobalScope":true},"3359566cd3e1d64199b5cc028817490162edcf5aa7954f35133a462a507cdb48","e19277f843527448cadd35fd674e358d0d2a7f261e9631026ecc82feb85ecec8","8b1a6692156440f6585937b6b8de1c2692e7cac5c43aeb8893bfbd293f719552","16d89c2619e5c73fe784212aa78a4c3f6581d54e5bb566a942dfd4598c974370","51781f2d796522117c57972bfabe36de652182f7bec8b73e026df3659de0481e","6b8ca5a4e0a75f6c8e48c0fc2ff204502f780db438b3d56d07d5c8b5da2da9c2",{"version":"8cf7500e72fa63edc7db30eb645d00857945b6bbcc7c63d70d3dc847f69cf017","affectsGlobalScope":true},"9c0eebd3a0506c79c428ca5c9c7abd895645879bca18ca793d9d367518dbff31","6f7c9a7c0e4167eaa2e27d4da24b3073afd8d47b8c11c1ef54f6e89979818ec2","1a99ea6d1fc721282c66eadb850c355591a225b4bdfbec2f922f7bf8de6410b0","cf05dc684f66290eb34c4905cbbd29dfd81181222a3cc96844137384f9a35c1c","01aacd272dab2b1d9a461f9768ba4cb50252ac44e800725fe461a8adaeca6e3b","f21932f853b3dbd3949e14c7d31d2dcfba3418c5de50878884a54cf0ba14e904","721526438283d40d50c6356064d346f1c57693f7e9930a3854c20c73bf4380a5","a59b91e2ef2e992fa4f5b0af18be6a78f93a6fb7d22282e92cd6c69984a2f8a3","3cf4c7825a6c0ef1965e8906b85844aafdcdda9d95c8b4bcfcb3a20811cfd0b1","c5a4764697efe3b6b4eaf19b3dc1880cf3df665d30ec93e212233c29a2fa7207",{"version":"ee8e401f800f3d48020eda76c4fd27afd5bab992195252939329ae56dc9d1889","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":2,"module":5,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[37,38,39,40],[36,41,46,52,53,54,55],[41],[52],[46,48,50,51,57],[48,49],[47],[46,47],[42],[42,43,44,45,58]],"referencedMap":[[41,1],[56,2],[54,3],[55,3],[51,4],[52,5],[50,6],[47,7],[48,8],[43,9],[46,10],[45,9],[59,9]],"exportedModulesMap":[[41,1],[56,2],[54,3],[55,3],[51,4],[52,5],[50,6],[47,7],[48,8],[43,9],[46,10],[45,9],[59,9]],"semanticDiagnosticsPerFile":[39,37,41,40,38,42,7,8,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,35,32,33,34,1,10,9,53,36,56,54,55,51,52,50,47,48,43,44,46,45,49,57,58,59]},"version":"4.6.4"}
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
2
  import type { CSSProperties } from 'react';
3
3
  import type { StreamTypes } from '@mux/playback-core';
4
- import '@mux/mux-player';
4
+ import { MediaError } from '@mux/mux-player';
5
5
  import type MuxPlayerElement from '@mux/mux-player';
6
6
  import type { Tokens } from '@mux/mux-player';
7
+ export { MediaError };
7
8
  declare type ValueOf<T> = T[keyof T];
9
+ interface GenericEventListener<T extends Event = CustomEvent> {
10
+ (evt: T): void;
11
+ }
8
12
  export declare type MuxPlayerRefAttributes = MuxPlayerElement;
9
13
  declare type VideoApiAttributes = {
10
14
  currentTime: number;
@@ -36,7 +40,12 @@ declare type MuxMediaPropTypes = {
36
40
  startTime: number;
37
41
  children: never[];
38
42
  };
43
+ interface MuxPlayerElementEventMap extends HTMLVideoElementEventMap {
44
+ }
39
45
  export declare type MuxPlayerProps = {
46
+ className?: string;
47
+ hotkeys?: string;
48
+ nohotkeys?: boolean;
40
49
  defaultHiddenCaptions?: boolean;
41
50
  playerSoftwareVersion?: string;
42
51
  playerSoftwareName?: string;
@@ -48,25 +57,34 @@ export declare type MuxPlayerProps = {
48
57
  primaryColor?: string;
49
58
  secondaryColor?: string;
50
59
  tertiaryColor?: string;
60
+ playbackRates?: number[];
61
+ defaultShowRemainingTime?: boolean;
51
62
  thumbnailTime?: number;
63
+ title?: string;
52
64
  tokens?: Tokens;
53
- onLoadStart?: EventListener;
54
- onLoadedMetadata?: EventListener;
55
- onProgress?: EventListener;
56
- onDurationChange?: EventListener;
57
- onVolumeChange?: EventListener;
58
- onRateChange?: EventListener;
59
- onResize?: EventListener;
60
- onWaiting?: EventListener;
61
- onPlay?: EventListener;
62
- onPlaying?: EventListener;
63
- onTimeUpdate?: EventListener;
64
- onPause?: EventListener;
65
- onSeeking?: EventListener;
66
- onSeeked?: EventListener;
67
- onEnded?: EventListener;
68
- onError?: EventListener;
69
- onPlayerReady?: EventListener;
65
+ onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;
66
+ onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;
67
+ onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;
68
+ onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;
69
+ onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;
70
+ onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;
71
+ onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;
72
+ onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;
73
+ onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;
74
+ onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;
75
+ onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;
76
+ onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;
77
+ onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;
78
+ onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;
79
+ onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;
80
+ onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;
81
+ onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;
82
+ onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;
83
+ onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;
84
+ onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;
85
+ onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;
86
+ onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;
87
+ onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;
70
88
  } & Partial<MuxMediaPropTypes> & Partial<VideoApiAttributes>;
71
89
  declare const MuxPlayer: React.ForwardRefExoticComponent<Omit<MuxPlayerProps, "playerSoftwareVersion" | "playerSoftwareName"> & React.RefAttributes<MuxPlayerElement>>;
72
90
  export default MuxPlayer;
@@ -7,4 +7,5 @@ interface useCombinedRefs {
7
7
  <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;
8
8
  }
9
9
  export declare const useCombinedRefs: useCombinedRefs;
10
- export default useCombinedRefs;
10
+ declare const defaultUseCombinedRefs: useCombinedRefs;
11
+ export default defaultUseCombinedRefs;