Simple Video Playback Control
Innovaccer's platform frequently utilizes educational and training videos to onboard new users or explain complex features. To enhance the user experience, we need a robust yet simple component to manage video playback. This problem focuses on building a foundational video player control component that displays essential information and allows basic interaction, simulating a real video's state and progress.
Your task is to create a React component named VideoPlayer that displays video information and provides basic playback controls. You will simulate video playback without an actual <video> HTML element.
currentTime advances.setInterval timers are properly cleared when the component unmounts to prevent memory leaks.VideoPlayer component correctly displays the provided video title and total duration.currentTime relative to the totalDuration, filling from left to right.duration).setInterval).Constraints
VideoPlayer component. The duration will be in seconds.<video> element. Simulate playback entirely using React state and setInterval.useState and useEffect to manage playback state (playing/paused, current time) and ensure proper component lifecycle handling (cleanup).Loading editor...