Skip to content

Commit

Permalink
fix: only for autoplyed
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmch committed Oct 16, 2023
1 parent d6ce3d5 commit af840cd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/ReactPlayer/ReactPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ export const ReactPlayerBlock = React.forwardRef<ReactPlayerBlockHandler, ReactP

const onFocusIn = useCallback(() => setHovered(true), []);
const onFocusOut = useCallback(() => setHovered(false), []);
const isPipEnabled = !isMobile || !props.autoplay;

return (
<div
Expand Down Expand Up @@ -395,9 +394,9 @@ export const ReactPlayerBlock = React.forwardRef<ReactPlayerBlockHandler, ReactP
config={{
file: {
attributes: {
pip: isPipEnabled ? undefined : 'false',
playsinline: isPipEnabled ? undefined : '',
disablepictureinpicture: isPipEnabled ? undefined : '',
pip: props.autoplay ? 'false' : undefined,
playsinline: props.autoplay ? '' : undefined,
disablepictureinpicture: props.autoplay ? '' : undefined,
},
},
}}
Expand Down

0 comments on commit af840cd

Please sign in to comment.