fix none type volume and speed reading

This commit is contained in:
Simon
2024-12-23 11:46:38 +07:00
parent fbd7c19a93
commit f8a0577451

View File

@@ -178,9 +178,9 @@ const VideoPlayer = ({
localStorage.setItem('playerSpeed', videoTag.currentTarget.playbackRate.toString()); localStorage.setItem('playerSpeed', videoTag.currentTarget.playbackRate.toString());
}} }}
onLoadStart={(videoTag: VideoTag) => { onLoadStart={(videoTag: VideoTag) => {
videoTag.currentTarget.volume = Number(localStorage.getItem('playerVolume')) ?? 1; videoTag.currentTarget.volume = Number(localStorage.getItem('playerVolume') ?? 1)
videoTag.currentTarget.playbackRate = videoTag.currentTarget.playbackRate =
Number(localStorage.getItem('playerSpeed')) ?? 1; Number(localStorage.getItem('playerSpeed') ?? 1);
}} }}
onTimeUpdate={handleTimeUpdate( onTimeUpdate={handleTimeUpdate(
videoId, videoId,
@@ -247,7 +247,7 @@ const VideoPlayer = ({
</h4> </h4>
)} )}
{Object.values(skippedSegments).map(({ from, to }) => { {/* {Object.values(skippedSegments).map(({ from, to }) => {
return ( return (
<> <>
{from !== 0 && to !== 0 && ( {from !== 0 && to !== 0 && (
@@ -257,7 +257,7 @@ const VideoPlayer = ({
)} )}
</> </>
); );
})} })} */}
</> </>
)} )}
</div> </div>