mirror of
https://github.com/mastodon/mastodon.git
synced 2025-07-15 16:58:14 +00:00
parent
064d333620
commit
54ad57ea95
|
@ -442,11 +442,14 @@ export const Audio: React.FC<{
|
||||||
if (typeof startMuted !== 'undefined') {
|
if (typeof startMuted !== 'undefined') {
|
||||||
audioRef.current.muted = startMuted;
|
audioRef.current.muted = startMuted;
|
||||||
}
|
}
|
||||||
|
}, [setDuration, startTime, startVolume, startMuted]);
|
||||||
|
|
||||||
|
const handleCanPlayThrough = useCallback(() => {
|
||||||
if (startPlaying) {
|
if (startPlaying) {
|
||||||
void audioRef.current.play();
|
resumeAudio();
|
||||||
|
void audioRef.current?.play();
|
||||||
}
|
}
|
||||||
}, [setDuration, startTime, startVolume, startMuted, startPlaying]);
|
}, [startPlaying, resumeAudio]);
|
||||||
|
|
||||||
const seekBy = (time: number) => {
|
const seekBy = (time: number) => {
|
||||||
if (!audioRef.current) {
|
if (!audioRef.current) {
|
||||||
|
@ -591,6 +594,7 @@ export const Audio: React.FC<{
|
||||||
onPause={handlePause}
|
onPause={handlePause}
|
||||||
onProgress={handleProgress}
|
onProgress={handleProgress}
|
||||||
onLoadedData={handleLoadedData}
|
onLoadedData={handleLoadedData}
|
||||||
|
onCanPlayThrough={handleCanPlayThrough}
|
||||||
onTimeUpdate={handleTimeUpdate}
|
onTimeUpdate={handleTimeUpdate}
|
||||||
onVolumeChange={handleVolumeChange}
|
onVolumeChange={handleVolumeChange}
|
||||||
crossOrigin='anonymous'
|
crossOrigin='anonymous'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user