Native player controls ignoring 'playing' prop
See original GitHub issueI want to use the native controls, but also pause the player with the playing
prop. I have a few timestamps within my video and i want to jump to them and pause the player.
const playerRef = useRef<ReactPlayer>()
const [playing, setPlaying] = useState(false)
useEffect(() => {
setPlaying(false)
playerRef.current.seekTo(playhead, 'seconds')
}, [playhead]) // playhead is set on click on a timestamp
<ReactPlayer
ref={playerRef}
playing={playing}
url={url}
controls={true}
/>
Current Behavior
if the player is started from the native controls, it ignores the playing
prop.
if i control the player only with the playing
prop, everything is working
Expected Behavior
regardless of the type of controls i use, the video should play and pause according the playing
prop.
Environment
- Browser: Version 78.0.3904.87
- Operating system: Fedora 31
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Native player controls ignoring 'playing' prop #737 - GitHub
Native player controls ignoring 'playing' prop #737 ... I want to use the native controls, but also pause the player with the playing...
Read more >React-Native-Video controls working in iOS but not android ...
This component works perfectly in iOS, but it doesn't work on Android. The controls don't update when pressed (play doesn't turn into pause)...
Read more >react-native-video - npm
Set the ignoreSilentSwitch prop to "ignore". Platforms: Android ExoPlayer, Android MediaPlayer, iOS. playWhenInactive. Determine whether the ...
Read more >Video.js Options Reference
When this option is false (the default), responsive breakpoints will be ignored. Note this is about the responsiveness of the controls within the...
Read more >YouTube Player API Reference for iframe Embeds
The IFrame player API lets you embed a YouTube video player on your website and control the player using JavaScript. Using the API's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
as i think the additional callbacks are more a workaround, read a bit through the code
in https://github.com/CookPete/react-player/blob/master/src/Player.js#L55 are checks for the
prevProps.playing
and if it toggled - but the native controls, does not change the props. Can we just remove theprevProps.playing
checks?if the new props want the player to pause, why not just pause?
Alright, so thanks a lot for the discussion 😃
As we have a solution and will not change anything, I close this issue.
Best regards, Christian