Fix video player flickering when changing watched state
This commit is contained in:
parent
1c643bef8e
commit
4a67da12f7
|
|
@ -98,14 +98,12 @@ const EmbeddableVideoPlayer = ({ videoId }: EmbeddableVideoPlayerProps) => {
|
|||
<>
|
||||
<div ref={inlinePlayerRef} className="player-wrapper">
|
||||
<div className="video-player">
|
||||
{!loading && (
|
||||
<VideoPlayer
|
||||
video={videoResponse}
|
||||
sponsorBlock={sponsorblock}
|
||||
embed={true}
|
||||
autoplay={true}
|
||||
/>
|
||||
)}
|
||||
<VideoPlayer
|
||||
video={videoResponse}
|
||||
sponsorBlock={sponsorblock}
|
||||
embed={true}
|
||||
autoplay={true}
|
||||
/>
|
||||
|
||||
<div className="player-title boxed-content">
|
||||
<img
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ const VideoPlayer = ({
|
|||
<div id="player" className={embed ? '' : 'player-wrapper'}>
|
||||
<div className={embed ? '' : 'video-main'}>
|
||||
<video
|
||||
key={`${getApiUrl()}${videoUrl}`}
|
||||
poster={`${getApiUrl()}${videoThumbUrl}`}
|
||||
onVolumeChange={(videoTag: VideoTag) => {
|
||||
localStorage.setItem('playerVolume', videoTag.currentTarget.volume.toString());
|
||||
|
|
|
|||
|
|
@ -214,16 +214,14 @@ const Video = () => {
|
|||
<title>{`TA | ${video.title}`}</title>
|
||||
<ScrollToTopOnNavigate />
|
||||
|
||||
{!loading && (
|
||||
<VideoPlayer
|
||||
video={videoResponse}
|
||||
sponsorBlock={sponsorBlock}
|
||||
autoplay={playlistAutoplay}
|
||||
onVideoEnd={() => {
|
||||
setVideoEnded(true);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<VideoPlayer
|
||||
video={videoResponse}
|
||||
sponsorBlock={sponsorBlock}
|
||||
autoplay={playlistAutoplay}
|
||||
onVideoEnd={() => {
|
||||
setVideoEnded(true);
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className="boxed-content">
|
||||
<div className="title-bar">
|
||||
|
|
|
|||
Loading…
Reference in New Issue