@mux/mux-audio-react
Advanced tools
Comparing version 0.11.0 to 0.11.1-canary.0
@@ -1,2 +0,2 @@ | ||
"use strict";"use client";var S=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var H=(t,r)=>{for(var o in r)p(t,o,{get:r[o],enumerable:!0})},M=(t,r,o,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of A(r))!w.call(t,s)&&s!==o&&p(t,s,{get:()=>r[s],enumerable:!(u=v(r,s))||u.enumerable});return t};var O=(t,r,o)=>(o=t!=null?S(L(t)):{},M(r||!t||!t.__esModule?p(o,"default",{value:t,enumerable:!0}):o,t)),I=t=>M(p({},"__esModule",{value:!0}),t);var W={};H(W,{default:()=>U});module.exports=I(W);var d=require("react"),P=(...t)=>{let r=(0,d.useRef)(null);return(0,d.useEffect)(()=>{t.forEach(o=>{o&&(typeof o=="function"?o(r.current):o.current=r.current)})},[t]),r};var a=O(require("react")),e=O(require("prop-types")),n=require("@mux/playback-core");var V=()=>{try{return"0.11.0"}catch{}return"UNKNOWN"},h=V(),g=()=>h;var N=g(),D="mux-audio-react",m=a.default.forwardRef((t,r)=>{var R;let{playbackId:o,src:u,children:s,autoPlay:f,preload:y,tokens:_,playbackToken:K,...E}=t,k=Object.fromEntries(Object.entries(E).filter(([i])=>!Object.keys(m.propTypes).includes(i))),[x]=(0,a.useState)((0,n.generatePlayerInitTime)()),[b,C]=(0,a.useState)((R=(0,n.toMuxVideoURL)(t))!=null?R:u),c=(0,a.useRef)(void 0),j=(0,a.useRef)(null),T=P(j,r);return(0,a.useEffect)(()=>{var i;C((i=(0,n.toMuxVideoURL)(t))!=null?i:u)},[u,o]),(0,a.useEffect)(()=>{let i={...t,src:b,playerInitTime:x,playerSoftwareName:D,playerSoftwareVersion:N,autoplay:f},l=T.current;return l&&(c.current=(0,n.initialize)(i,l,c.current)),()=>{(0,n.teardown)(l,c.current),l=void 0,c.current=void 0}},[b]),(0,a.useEffect)(()=>{var i;(i=c.current)==null||i.setAutoplay(f)},[f]),(0,a.useEffect)(()=>{var i;(i=c.current)==null||i.setPreload(y)},[y]),a.default.createElement("audio",{ref:T,...k},s)});m.propTypes={_hlsConfig:e.default.any,beaconCollectionDomain:e.default.string,customDomain:e.default.string,debug:e.default.bool,disableCookies:e.default.bool,disableTracking:e.default.bool,envKey:e.default.string,errorTranslator:e.default.any,liveEdgeStart:e.default.number,maxResolution:e.default.oneOf(["720p","1080p","1440p","2160p"]),metadata:e.default.any,minResolution:e.default.oneOf(["480p","540p","720p","1080p","1440p","2160p"]),playbackId:e.default.string,playbackToken:e.default.string,playerInitTime:e.default.number,preferCmcd:e.default.oneOf(Object.values(n.CmcdTypes)),programStartTime:e.default.number,programEndTime:e.default.number,assetStartTime:e.default.number,assetEndTime:e.default.number,preferPlayback:e.default.oneOf(Object.values(n.PlaybackTypes)),renditionOrder:e.default.oneOf(["desc"]),startTime:e.default.number,streamType:e.default.oneOf(Object.values(n.StreamTypes)),targetLiveWindow:e.default.number,tokens:e.default.object,type:e.default.oneOf(n.allMediaTypes)};var U=m; | ||
"use strict";"use client";var L=Object.create;var l=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var h=(t,n)=>{for(var o in n)l(t,o,{get:n[o],enumerable:!0})},O=(t,n,o,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of I(n))!V.call(t,s)&&s!==o&&l(t,s,{get:()=>n[s],enumerable:!(u=w(n,s))||u.enumerable});return t};var P=(t,n,o)=>(o=t!=null?L(H(t)):{},O(n||!t||!t.__esModule?l(o,"default",{value:t,enumerable:!0}):o,t)),N=t=>O(l({},"__esModule",{value:!0}),t);var _={};h(_,{default:()=>W,generatePlayerInitTime:()=>r.generatePlayerInitTime,playerSoftwareName:()=>k,playerSoftwareVersion:()=>E});module.exports=N(_);var d=require("react"),g=(...t)=>{let n=(0,d.useRef)(null);return(0,d.useEffect)(()=>{t.forEach(o=>{o&&(typeof o=="function"?o(n.current):o.current=n.current)})},[t]),n};var a=P(require("react")),e=P(require("prop-types")),r=require("@mux/playback-core");var D=()=>{try{return"0.11.0"}catch{}return"UNKNOWN"},U=D(),x=()=>U;var E=x(),k="mux-audio-react";var m=a.default.forwardRef((t,n)=>{var R,M;let{playbackId:o,src:u,children:s,autoPlay:f,preload:y,tokens:K,playbackToken:z,...C}=t,j=Object.fromEntries(Object.entries(C).filter(([i])=>!Object.keys(m.propTypes).includes(i))),[S]=(0,a.useState)((R=t.playerInitTime)!=null?R:(0,r.generatePlayerInitTime)()),[b,v]=(0,a.useState)((M=(0,r.toMuxVideoURL)(t))!=null?M:u),c=(0,a.useRef)(void 0),A=(0,a.useRef)(null),T=g(A,n);return(0,a.useEffect)(()=>{var i;v((i=(0,r.toMuxVideoURL)(t))!=null?i:u)},[u,o]),(0,a.useEffect)(()=>{let i={playerInitTime:S,...t,src:b,playerSoftwareName:k,playerSoftwareVersion:E,autoplay:f},p=T.current;return p&&(c.current=(0,r.initialize)(i,p,c.current)),()=>{(0,r.teardown)(p,c.current),p=void 0,c.current=void 0}},[b]),(0,a.useEffect)(()=>{var i;(i=c.current)==null||i.setAutoplay(f)},[f]),(0,a.useEffect)(()=>{var i;(i=c.current)==null||i.setPreload(y)},[y]),a.default.createElement("audio",{ref:T,...j},s)});m.propTypes={_hlsConfig:e.default.any,beaconCollectionDomain:e.default.string,customDomain:e.default.string,debug:e.default.bool,disableCookies:e.default.bool,disableTracking:e.default.bool,envKey:e.default.string,errorTranslator:e.default.any,liveEdgeStart:e.default.number,maxResolution:e.default.oneOf(["720p","1080p","1440p","2160p"]),metadata:e.default.any,minResolution:e.default.oneOf(["480p","540p","720p","1080p","1440p","2160p"]),playbackId:e.default.string,playbackToken:e.default.string,playerInitTime:e.default.number,preferCmcd:e.default.oneOf(Object.values(r.CmcdTypes)),programStartTime:e.default.number,programEndTime:e.default.number,assetStartTime:e.default.number,assetEndTime:e.default.number,preferPlayback:e.default.oneOf(Object.values(r.PlaybackTypes)),renditionOrder:e.default.oneOf(["desc"]),startTime:e.default.number,streamType:e.default.oneOf(Object.values(r.StreamTypes)),targetLiveWindow:e.default.number,tokens:e.default.object,type:e.default.oneOf(r.allMediaTypes)};var W=m; | ||
//# sourceMappingURL=index.cjs.js.map |
import React from 'react'; | ||
import { MuxMediaProps } from '@mux/playback-core'; | ||
import { MuxMediaProps, generatePlayerInitTime } from '@mux/playback-core'; | ||
export type Props = Pick<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, Exclude<keyof React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, 'autoPlay'>> & MuxMediaProps; | ||
export declare const playerSoftwareVersion: string; | ||
export declare const playerSoftwareName = "mux-audio-react"; | ||
export { generatePlayerInitTime }; | ||
declare const MuxAudio: React.ForwardRefExoticComponent<Pick<Partial<Props>, Exclude<keyof Partial<Props>, "ref">> & React.RefAttributes<HTMLAudioElement | undefined>>; | ||
export default MuxAudio; |
import React from 'react'; | ||
import { MuxMediaProps } from '@mux/playback-core'; | ||
import { MuxMediaProps, generatePlayerInitTime } from '@mux/playback-core'; | ||
export type Props = Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, 'autoPlay'> & MuxMediaProps; | ||
export declare const playerSoftwareVersion: string; | ||
export declare const playerSoftwareName = "mux-audio-react"; | ||
export { generatePlayerInitTime }; | ||
declare const MuxAudio: React.ForwardRefExoticComponent<Omit<Partial<Props>, "ref"> & React.RefAttributes<HTMLAudioElement | undefined>>; | ||
export default MuxAudio; |
{ | ||
"name": "@mux/mux-audio-react", | ||
"version": "0.11.0", | ||
"version": "0.11.1-canary.0", | ||
"description": "A custom mux audio element for React that Just Works™", | ||
@@ -29,5 +29,5 @@ "keywords": [ | ||
"require": "./dist/index.cjs.js", | ||
"default": "./dist/index.cjs.js", | ||
"types@<4.3.5": "./dist/types-ts3.4/index.d.ts", | ||
"types": "./dist/types/index.d.ts" | ||
"types": "./dist/types/index.d.ts", | ||
"default": "./dist/index.cjs.js" | ||
} | ||
@@ -54,5 +54,3 @@ }, | ||
"postbuild:types": "downlevel-dts ./dist/types ./dist/types-ts3.4", | ||
"build": "npm-run-all --parallel 'build:cjs --minify' 'build:esm --minify'", | ||
"create-release-notes": "create-release-notes ./CHANGELOG.md", | ||
"publish-release": "../../scripts/publish.sh" | ||
"build": "npm-run-all --parallel 'build:cjs --minify' 'build:esm --minify'" | ||
}, | ||
@@ -90,4 +88,3 @@ "peerDependencies": { | ||
"typescript": "^5.5.4" | ||
}, | ||
"gitHead": "e1d17f4ce383e95489fc778d3c5bda3b89a27b5b" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67
47045
13