diff --git a/example/src/App.tsx b/example/src/App.tsx index 9d9bd49..3924c12 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -46,7 +46,7 @@ const LabeledSwitch = (props: LabeledSwitchProps) => ( const App: () => React.ReactNode = () => { const [mute, setMute] = React.useState(false); const [hideControls, setHideControls] = React.useState(false); - const [chromeless, setChromeless] = React.useState(true); + const [chromeless, setChromeless] = React.useState(false); const [autoPlay, setAutoPlay] = React.useState(false); const [loop, setLoop] = React.useState(false); const [isPlaying, setIsPlaying] = React.useState(false); diff --git a/src/index.tsx b/src/index.tsx index 24ed1fc..6040517 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -159,10 +159,8 @@ const ApiVideoPlayer = forwardRef( if (isNaN(volume)) throw new Error('Invalid volume'); injectJavaScript(`player.volume(${volume});`); }, - setChromeless: (chromeless: boolean) => { - console.log('toto'); - injectJavaScript(`player.setChromeless(${chromeless});`); - }, + setChromeless: (chromeless: boolean) => + injectJavaScript(`apiVideoPlayer.setChromeless(${chromeless});`), })); useEffect(() => { @@ -175,7 +173,7 @@ const ApiVideoPlayer = forwardRef( useEffect(() => { if (props.chromeless !== undefined) { - injectJavaScript(`player.setChromeless(${props.chromeless});`); + injectJavaScript(`apiVideoPlayer.setChromeless(${props.chromeless});`); } }, [props.chromeless]);