Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios每次都要重新授权 有遇到吗 #218

Open
kongdemin opened this issue Apr 19, 2024 · 4 comments
Open

ios每次都要重新授权 有遇到吗 #218

kongdemin opened this issue Apr 19, 2024 · 4 comments

Comments

@kongdemin
Copy link

No description provided.

@xiangyuecn
Copy link
Owner

ios Safari里面是这样的,打开录音后 过一会再打开又会弹权限框

@badspider7
Copy link

我也遇到过,有什么解决办法嘛

@tangtangyue
Copy link

有什么解决办法么

@xiangyuecn
Copy link
Owner

ios的浏览器跟webview都是这样的,如果是app,可以给webview适配一下静默授权,iOS 15+支持;浏览器没办法

Recorder/README.md

Lines 356 to 363 in fe968d1

## 【附】iOS App - WebView中录音示例
在iOS App WebView中使用本库来录音,需要在App源码 `Info.plist` 中声明使用麦克风 `NSMicrophoneUsageDescription`,无需其他处理,WebView会自己处理好录音权限;注意:iOS App需要在项目Background Modes中勾选Audio才能在后台保持录音,不然App切到后台后立马会停止录音。
iOS 14.3+以上版本才支持WebView中进行H5录音;iOS 15+提供了静默授权支持,参考[WKUIDelegate](https://developer.apple.com/documentation/webkit/wkuidelegate)中的 `Requesting Permissions` -> `requestMediaCapturePermissionFor`,默认未实现,会导致WebView每次打开后第一次录音时、或长时间无操作再打开录音时均会弹出录音权限对话框。
iOS 11.0-14.2:纯粹的H5录音在iOS WebView中是不支持的,需要有Native层的支持,具体参考RecordApp中的[app-support-sample/demo_ios](https://github.com/xiangyuecn/Recorder/tree/master/app-support-sample/demo_ios),含iOS App源码。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants