Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions FQA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## 对讲(talk)

在浏览器中使用麦克风是需要允许的,所以需要用户允许。 [获取麦克风权限](https://developer.mozilla.org/zh-CN/docs/Web/API/WebRTC_API/Build_a_phone_with_peerjs/Connect_peers/Get_microphone_permission)

在 iframe 中使用需要配置 `allow="microphone"`


## [iframe](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Reference/Elements/iframe)

在iframe中,需要设置[同源策略](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Reference/Headers/Permissions-Policy#iframe)。

- [iframe 当全屏请求失败时](https://developer.mozilla.org/zh-CN/docs/Web/API/Fullscreen_API/Guide#%E5%BD%93%E5%85%A8%E5%B1%8F%E8%AF%B7%E6%B1%82%E5%A4%B1%E8%B4%A5%E6%97%B6)

`allowfullscreen` 设置为 true 时,可以通过调用 `<iframe>` 的 `requestFullscreen()` 方法激活全屏模式。

```html
<!-- 允许 iframe 激活全屏 -->
<iframe src="..." allowfullscreen="tuue"></iframe>
```

- [iframe 麦克风使用](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Reference/Elements/iframe#allow)

设置 `allow="microphone;"` 时,可以通过调用 `<iframe>` 的 `navigator.mediaDevices.getUserMedia({ audio: true })` 获取用户麦克风权限。

```html
<!-- 允许 iframe 访问麦克风 -->
<iframe src="..." allow="microphone;"></iframe>
```

2 changes: 1 addition & 1 deletion demos/with-uniapp-vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@dcloudio/uni-mp-weixin": "3.0.0-4030620241128001",
"@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
"ezuikit-js": "8.1.12-beta.2",
"ezuikit-js": "8.1.13-beta.1",
"vue": "^3.4.21",
"vue-i18n": "^9.1.9"
},
Expand Down
Loading
Loading