tweak media player control

This commit is contained in:
an-lee
2024-02-20 06:17:52 +08:00
parent daef3a4fa1
commit bb06c9e191

View File

@@ -468,6 +468,7 @@ export const MediaPlayer = (props: {
if (!initialized) return;
wavesurfer.seekTo(seek?.seekTo / wavesurfer.getDuration());
wavesurfer.setScrollTime(seek?.seekTo);
}, [seek, wavesurfer, initialized]);
// Handle media provider
@@ -515,7 +516,7 @@ export const MediaPlayer = (props: {
const duration =
currentSegment.offsets.to / 1000.0 - currentSegment.offsets.from / 1000.0;
const fitZoomRatio = (containerWidth / duration / minPxPerSecBase) * 0.95;
const fitZoomRatio = (containerWidth / duration / minPxPerSecBase);
return fitZoomRatio;
};