forked from xiangyuecn/Recorder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android WebView中按住录音存在权限请求打断touch事件的问题的解决方案
- Loading branch information
1 parent
f7c5058
commit 8b91ce7
Showing
3 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,6 +212,8 @@ IOS其他浏览器|| | |
|
||
*2019-07-22* 对[#34](https://github.com/xiangyuecn/Recorder/issues/34)反馈研究后发现,问题一:macOS、IOS的Safari对连续调用录音(中途未调用close)是有问题的,但只要调用close后再重复录音就没有问题。问题二:IOS上如果录音之前先播放了任何Audio,录音过程将会变得很诡异,但如果先录音,就不存在此问题。chrome、firefox正常的很。目测这两个问题是非我等屌丝能够解决的,于是报告给苹果家程序员看看,因此发了个[帖子](https://forums.developer.apple.com/message/373108),顺手在`Feedback Assistant`提交了`bug report`,但好几天过去了没有任何回应(顺带给微软一个好评)。 | ||
|
||
*2019-09-05* 已知 [#46](https://github.com/xiangyuecn/Recorder/issues/46) `Android WebView`内调用getUserMedia方法发起授权请求时会打断touch事件,表现为触发了`touchcancel`事件,`touchend`事件始终不会触发,在做按住录音功能时应留意此问题。虽然`open`后一直不调用`close`可以规避此问题,但不建议这样做,每次录音后调用`close`兼容性更好,也更加友好;可以在每次`按住录音按钮`被按之前都重新进行一次`open`调用;或者Android Hybrid App中用RecordApp开启Native原生录音来避免此问题,因为App可以做到请求到权限后,后续录音不会再去进行权限请求。 | ||
|
||
|
||
|
||
|
||
|
@@ -247,7 +249,7 @@ set={ | |
**注意:set内是数字的明确传数字**,不要传字符串之类的导致不可预测的异常,其他有配置的地方也是一样(感谢`[email protected]`19-01-10发的反馈邮件)。 | ||
|
||
### 【方法】rec.open(success,fail) | ||
请求打开录音资源,如果浏览器不支持录音或用户拒绝麦克风权限将会调用`fail`,打开后需要调用`close`。 | ||
请求打开录音资源,如果浏览器不支持录音或用户拒绝麦克风权限将会调用`fail`;打开后需要调用`close`来关闭,因为浏览器或设备的系统可能会显示正在录音。 | ||
|
||
注意:此方法回调是可能是同步的(异常、或者已持有资源时)也可能是异步的(浏览器弹出权限请求时);一般使用时打开,用完立即关闭;可重复调用,可用来测试是否能录音。 | ||
|
||
|
@@ -261,7 +263,7 @@ set={ | |
|
||
|
||
### 【方法】rec.close(success) | ||
关闭释放录音资源,释放完成后会调用`success()`回调 | ||
关闭释放录音资源,浏览器或设备的系统将停止正在录音的提示,释放完成后会调用`success()`回调 | ||
|
||
### 【方法】rec.start() | ||
开始录音,需先调用`open`;如果不支持、错误,不会有任何提示,因为stop时自然能得到错误。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters