player button error

This commit is contained in:
yonghyon
2024-07-11 12:18:23 +09:00
parent 9a0facb49d
commit e5fdd10308

View File

@@ -106,9 +106,20 @@ export default function TReactPlayer({
},
proportionPlayed: {
get: function () {
return videoNode.getCurrentTime() / videoNode.getDuration();
const duration = videoNode.getDuration();
return duration ? videoNode.getCurrentTime() / duration : 0;
},
},
playbackRate: {
get: function () {
return videoNode?.playerInfo?.playbackRate;
},
set: function (playbackRate) {
if (videoNode && videoNode.setPlaybackRate) {
videoNode.setPlaybackRate(playbackRate);
}
},
}
});
}
}