Skip to content

Commit

Permalink
feat: add tips for no devices
Browse files Browse the repository at this point in the history
  • Loading branch information
bbb169 committed Oct 22, 2023
1 parent 9c43947 commit 9639a0c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/playRoom/component/audioButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { Button, Tooltip } from 'antd';
import { Button, message, Tooltip } from 'antd';
import { AudioMutedOutlined, AudioOutlined } from '@ant-design/icons';
import { useContext, useEffect, useState } from 'react';
import { getFloatCss } from '../../styles/playRoom.js';
Expand Down Expand Up @@ -32,9 +32,12 @@ export default function AudioButton () {
icon={!startRecord ? <AudioMutedOutlined /> : <AudioOutlined />}
type='primary'
danger={startRecord}
disabled={isEmpty(socket)}
shape='circle'
onClick={() => {
if (isEmpty(socket) || Boolean(!navigator.mediaDevices)) {
message.info('当前环境下不可使用');
return;
}
setStartRecord(pre => !pre);
}}
data-intro="点击进行全房喊麦~"
Expand Down

0 comments on commit 9639a0c

Please sign in to comment.