parent
064d333620
commit
54ad57ea95
1 changed files with 6 additions and 2 deletions
|
@ -442,11 +442,14 @@ export const Audio: React.FC<{
|
|||
if (typeof startMuted !== 'undefined') {
|
||||
audioRef.current.muted = startMuted;
|
||||
}
|
||||
}, [setDuration, startTime, startVolume, startMuted]);
|
||||
|
||||
const handleCanPlayThrough = useCallback(() => {
|
||||
if (startPlaying) {
|
||||
void audioRef.current.play();
|
||||
resumeAudio();
|
||||
void audioRef.current?.play();
|
||||
}
|
||||
}, [setDuration, startTime, startVolume, startMuted, startPlaying]);
|
||||
}, [startPlaying, resumeAudio]);
|
||||
|
||||
const seekBy = (time: number) => {
|
||||
if (!audioRef.current) {
|
||||
|
@ -591,6 +594,7 @@ export const Audio: React.FC<{
|
|||
onPause={handlePause}
|
||||
onProgress={handleProgress}
|
||||
onLoadedData={handleLoadedData}
|
||||
onCanPlayThrough={handleCanPlayThrough}
|
||||
onTimeUpdate={handleTimeUpdate}
|
||||
onVolumeChange={handleVolumeChange}
|
||||
crossOrigin='anonymous'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue