Skip to content

Commit

Permalink
Fix chromeless
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-lando committed Jul 17, 2024
1 parent 5cb3927 commit 23af234
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const LabeledSwitch = (props: LabeledSwitchProps) => (
const App: () => React.ReactNode = () => {
const [mute, setMute] = React.useState<boolean>(false);
const [hideControls, setHideControls] = React.useState<boolean>(false);
const [chromeless, setChromeless] = React.useState<boolean>(true);
const [chromeless, setChromeless] = React.useState<boolean>(false);
const [autoPlay, setAutoPlay] = React.useState<boolean>(false);
const [loop, setLoop] = React.useState<boolean>(false);
const [isPlaying, setIsPlaying] = React.useState<boolean>(false);
Expand Down
8 changes: 3 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -175,7 +173,7 @@ const ApiVideoPlayer = forwardRef(

useEffect(() => {
if (props.chromeless !== undefined) {
injectJavaScript(`player.setChromeless(${props.chromeless});`);
injectJavaScript(`apiVideoPlayer.setChromeless(${props.chromeless});`);
}
}, [props.chromeless]);

Expand Down

0 comments on commit 23af234

Please sign in to comment.