player button error
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user