Closed yanikm closed 3 weeks ago
change your playing props into your state
<ReactPlayer url={videoUmzug} width={400} height={400} controls={true} playing={false}>
into
<ReactPlayer url={videoUmzug} width={400} height={400} controls={true} playing={isPlaying}>
the player state will be synced with your isPlaying state
Current Behavior
When the modal is closed the player continues to play the video.
Expected Behavior
Since i set the playing property to false, i expect the player to stop playing, but i continue to hear the sound.
Steps to Reproduce
Next.js 14
Environment
Code
`"use client";
import React, {useState} from 'react'; import {Button, Modal} from "antd"; import ReactPlayer from "react-player"; const video = "someURL.mp4";
const Page = () => { const [isModalOpen, setIsModalOpen] = useState(false); const [isPlaying, setIsPlaying] = useState(false);
};
export default Page; `