mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
updating audio asset stop icon
This commit is contained in:
parent
f3c1bbf54f
commit
b08438440e
@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
||||
import { Button } from 'antd';
|
||||
import ReactPlayer from 'react-player'
|
||||
import ReactResizeDetector from 'react-resize-detector';
|
||||
import { PlayCircleOutlined, PauseCircleOutlined, SoundOutlined } from '@ant-design/icons';
|
||||
import { PlayCircleOutlined, MinusCircleOutlined, SoundOutlined } from '@ant-design/icons';
|
||||
import { AudioAssetWrapper } from './AudioAsset.styled';
|
||||
|
||||
export function AudioAsset({ label, audioUrl }) {
|
||||
@ -14,11 +14,14 @@ export function AudioAsset({ label, audioUrl }) {
|
||||
|
||||
useEffect(() => {
|
||||
setActive(false);
|
||||
setPlaying(true);
|
||||
setPlaying(false);
|
||||
}, [label, audioUrl]);
|
||||
|
||||
const onReady = () => {
|
||||
setReady(true);
|
||||
if (!ready) {
|
||||
setReady(true);
|
||||
setPlaying(true);
|
||||
}
|
||||
}
|
||||
|
||||
const Control = () => {
|
||||
@ -28,7 +31,7 @@ export function AudioAsset({ label, audioUrl }) {
|
||||
if (playing) {
|
||||
return (
|
||||
<div onClick={() => setPlaying(false)}>
|
||||
<PauseCircleOutlined style={{ fontSize: 48, color: '#eeeeee', cursor: 'pointer' }} />
|
||||
<MinusCircleOutlined style={{ fontSize: 48, color: '#eeeeee', cursor: 'pointer' }} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user