fix: audio, recording format error

This commit is contained in:
jialin
2024-12-11 18:39:36 +08:00
parent f64e696f7a
commit fef5d0e688
10 changed files with 131 additions and 69 deletions
+12
View File
@@ -175,6 +175,18 @@ const AudioPlayer: React.FC<AudioPlayerProps> = forwardRef((props, ref) => {
console.log('onload', e);
};
const onDownload = useCallback(() => {
const url = props.url || '';
const filename = props.name;
const link = document.createElement('a');
link.href = url;
link.download = filename;
document.body.appendChild(link);
link.click();
link.remove();
}, [props.url, props.name]);
useEffect(() => {
if (audioRef.current) {
initPlayerConfig();