|
@@ -116,19 +116,32 @@ async function handleJoin() {
|
|
|
if (error.getCode() === 0x4043) {
|
|
|
// 自动播放受限导致播放失败,此时引导用户点击页面。
|
|
|
// 在点击事件的回调函数中,执行 stream.resume();
|
|
|
- Dialog.confirm({
|
|
|
- showCloseIcon: false,
|
|
|
- okText: '确定',
|
|
|
- content:
|
|
|
- "<span style='font-size: 16px; line-height: 1.5;'>在用户与网页产生交互(例如点击、触摸页面等)之前,网页将被禁止播放带有声音的媒体。点击恢复播放<span/>",
|
|
|
- title: '隐私条款:',
|
|
|
- single: true,
|
|
|
- func: (state) => {
|
|
|
- if (state == 'ok') {
|
|
|
- localStream.resume();
|
|
|
- }
|
|
|
+ const rtcStore = useRtcStore();
|
|
|
+ const { t } = useI18n();
|
|
|
+ rtcStore.showBaseDialog(
|
|
|
+ {
|
|
|
+ title: t('base.tips'),
|
|
|
+ desc: t('base.audioPermission'),
|
|
|
+ okTxt: t('base.confirm'),
|
|
|
+ closeTxt: t('base.cancel'),
|
|
|
},
|
|
|
- });
|
|
|
+ () => {
|
|
|
+ localStream.resume();
|
|
|
+ },
|
|
|
+ );
|
|
|
+ // Dialog.confirm({
|
|
|
+ // showCloseIcon: false,
|
|
|
+ // okText: '确定',
|
|
|
+ // content:
|
|
|
+ // "<span style='font-size: 16px; line-height: 1.5;'>在用户与网页产生交互(例如点击、触摸页面等)之前,网页将被禁止播放带有声音的媒体。点击恢复播放<span/>",
|
|
|
+ // title: '隐私条款:',
|
|
|
+ // single: true,
|
|
|
+ // func: (state) => {
|
|
|
+ // if (state == 'ok') {
|
|
|
+ // localStream.resume();
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // });
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -350,11 +363,11 @@ async function handleStreamSubscribed(event) {
|
|
|
tag: 'rtc:audio',
|
|
|
});
|
|
|
} catch (error) {
|
|
|
- remoteStream.resume();
|
|
|
+ // remoteStream.resume();
|
|
|
rtcStore.showBaseDialog(
|
|
|
{
|
|
|
title: t('base.tips'),
|
|
|
- desc: '继续访问该页面需要获取您摄像头及麦克风的权限。',
|
|
|
+ desc: t('base.audioPermission'),
|
|
|
okTxt: t('base.confirm'),
|
|
|
closeTxt: t('base.cancel'),
|
|
|
},
|