diff --git a/en-US/markdown/Video/web_sdk_mobile_known_issues.md b/en-US/markdown/Video/web_sdk_mobile_known_issues.md new file mode 100644 index 00000000000..3473f2acfd9 --- /dev/null +++ b/en-US/markdown/Video/web_sdk_mobile_known_issues.md @@ -0,0 +1,333 @@ +# Known Issues and Workarounds on Mobile Devices + +This page lists the known issues and limitations of using the Web SDK on mobile devices: +- Known issues: Caused by bugs on specific versions of iOS or specific browsers on Android. For some known issues, Agora provides workarounds. +- Known limitations: Unsupported APIs or features due to issues on iOS or Android. + +
Note that this page is continuously updated as Android and iOS evolve.
+ +## Known issues + +### iOS + +
+iOS 15.1.x: The browser crashes when sending the H.264 video stream +

+ +**Impact**: All browsers and apps that use WkWebView on iOS 15.1.x, such as Safari and Chrome. +

+

+ +**Details**: If you set `codec` as `'h264'` when calling `createClient`, the browsers on iOS 15.1.x crash after you send the video stream. +

+

+ +**Reason**: This issue happens due to the regression of the WebKit video encoder on iOS 15.1.x. For details, see [WebKit Bug 231505](https://bugs.webkit.org/show_bug.cgi?id=231505). +

+

+ +**Workaround**: Use the VP8 codec for video encoding. + +```javascript +createClient({codec:'vp8', mode}) +``` +

+
+ +
+iOS 15.x: Low audio volume +

+ +**Impact**: All browsers and apps that use WkWebView on iOS 15.x, such as Safari and Chrome.

+

+ +**Details**: On iOS 15.x, after the local user subscribes to the `RemoteAudioTrack` and plays it, sometimes the audio is routed to the earpiece instead of the speaker, and the volume that the local user hear may be very low.

+

+ +**Reason**: This issue happens due to the regression of the WebKit audio module on iOS 15.x. For details, see [ WebKit Bug 230902](https://bugs.webkit.org/show_bug.cgi?id=230902). +

+

+ +**Workaround**: On iOS 15.x, use `WebAudio` to play the audio, and use `GainNode` to increase the audio volume level. Use the following workaround: +1. Upgrade to the Web SDK 4.9.0 or later versions. +2. Set the SDK private parameter `REMOTE_AUDIO_TRACK_USES_WEB_AUDIO` as `true`. The SDK uses `WebAudio` to play the remote audio stream. Sample code: + ```javascript + function isIOS15(ua){ + // Use UA to judge whether the iOS version is 15 + } + + if(isIOS15(navigator.userAgent)){ + AgoraRTC.setParameter("REMOTE_AUDIO_TRACK_USES_WEB_AUDIO", true); + } + ``` +

+
+ +
+iOS 15.x: The video playback goes black +

+ +**Impact**: All browsers and apps that use WkWebView on iOS 15.x, such as Safari and Chrome. +

+

+ +**Details**: On iOS 15.x, if you play the video in DOM node and add some CSS properties (such as `transform` and `animation`) to the` video` element or its parent element, or if you change the CSS properties to redraw the video rendering area, sometimes the video goes black. +

+

+ +**Reason**: This issue happens due to the regression of the WebKit video renderer on iOS 15.x. For details, see [WebKit Bug 230902](https://bugs.webkit.org/show_bug.cgi?id=230902). +

+

+ +**Workaround**: Upgrade to the Web SDK v4.7.3 or later and minimize changes to the CSS properties of the `video` element and its parent elements. +

+
+ + +
+iOS 15.x: If a user wears a Bluetooth headset, the audio may be significantly distorted +

+ +**Impact**: All browsers and apps that use WkWebView on iOS 15.x, such as Safari and Chrome. +

+

+ +**Reason**: This issue happens due to the regression of the WebKit audio playback module on iOS 15.x. For details, see [WebKit Bug 231422](https://bugs.webkit.org/show_bug.cgi?id=231422). +

+

+ +**Workaround**: Agora recommends that you add a prompt to remind users of possible audio distortion issues when they use a Bluetooth headset. +

+
+ +
+iOS 15.x: Backgrounding the browser or app causes the audio streaming to be cut off. +

+ +**Impact**: All browsers and apps that use WkWebView on iOS 15.x, such as Safari and Chrome. +

+

+ +**Reason**: This happens primarily due to this WebKit [bug](https://bugs.webkit.org/show_bug.cgi?id=231105). After the browser switches to the background, the `AudioContext` of `WebAudio` stops processing audio. +

+

+ +**Workaround**: Follow these steps to avoid this issue: +1. Upgrade to the Web SDK v4.7.3 or later versions. +2. When calling `createMicrophoneAudioTrack`, set `bypassWebAudio` as `true`. The Web SDK directly publishes the local audio stream without processing it through `WebAudio`. + + ```javascript + const localAudioTrack = await AgoraRTC.createMicrophoneAudioTrack({bypassWebAudio: true}); + ``` + + > Note that this workaround has a side effect. After applying this workaround, the audio mixing function (`MixingAudioTrack`) in the SDK fails. + >

+ >
+ +
+iOS 15.x: Audio and video playback might not resume automatically after being interrupted by a system phone call, another real-time interaction app, Siri, or an alarm. +

+ +**Impact**: All browsers and apps that use WkWebView on iOS 15.x, such as Safari and Chrome. +

+

+ +**Reason**: Such interruptions can cause the state of the `video` and `audio` elements to be `paused`. After the interruption finishes, the state cannot be automatically switched back to `playing`, and even calling `HTMLMediaElement.play` cannot resume the media playback. See the WebKit bug [232599](https://bugs.webkit.org/show_bug.cgi?id=232599) and [226698](https://bugs.webkit.org/show_bug.cgi?id=226698) for more details. +

+

+ +**Workaround**: Upgrade to the Web SDK v4.7.3 or later versions. The SDK attempts to resume media playback after the interruption. Agora recommends that you add a prompt that instructs users to refresh the page. +

+
+ +
+Other known issues +

+ +- The volume of a remote user can change randomly on iOS 13 and 14. +- Switching between the front and rear cameras can momentarily rotate the video. +- The audio routing can change randomly. Sometimes, the audio is routed to the speakerphone when a headset is connected or to the earpiece when no headset is connected. +- If you call `getUserMedia` twice to get two tracks of the same media type, the first track goes muted or black. +- After a user switches to another app that uses the microphone or camera (such as Siri or Skype) and then switches back, the audio sampling or video capture fails. +

+
+ +### Android + +
+Android 12: Video distortion on Chrome when hardware acceleration is enabled + +

+ +**Impact**: The Chrome browser or Chromium kernel browser 97 or earlier on certain devices with Android 12, such as Pixel 3 and Pixel 4. +

+

+ +**Details**: If the Chrome browser on Android 12 enables the WebRTC `H264` or `VP8` hardware acceleration by default, video distortion can occur. +

+

+ +**Reason**: This issue happens due to the regression of the Chromium WebRTC video encoder. For details, see [Chromium issue 1237677](https://bugs.chromium.org/p/chromium/issues/detail?id=1237677). +

+

+ +**Workaround**: Chrome 97 fixed this issue. You can instruct users to upgrade to Chrome 97 or later versions. +

+
+ +
+The bitrate when sending video on Android Chrome fails to reach the preset value. +

+ +**Scope**: Certain Android devices, such as Xiaomi and OnePlus. +

+

+ +**Reason**: This is a hardware encoder issue. The bitrate fails to reach the preset value at a specific video encoding frame rate. +

+

+ +**Workaround**: In most cases, the bitrate is relatively lower when the frame rate is set as 15 fps. If you set the frame rate as 30 fps, the bitrate increases. So Agora recommends trying to set the frame rate as 30 fps when encountering a bitrate issue. However, setting the frame rate as fps may cause performance issues. +

+
+ +
+The autoplay of inaudible media is blocked on WeChat +

+ +**Impact**: The WeChat browser using Chromium 89 kernel +

+

+ +**Details**: The autoplay of inaudible media is blocked. Even after the user interacts with the webpage to resume the video playback, the autoplay block is still not removed. +

+

+ +**Reason**: This issue happens because the WeChat browser implements a custom autoplay policy. +

+

+ +**Workaround**: Follow these steps to avoid this issue: +1. Upgrade to the Web SDK v4.6.0 or later versions. +2. Listen to the `AgoraRTC.onAutoplayFailed` event. Instruct the user to click on the page to resume playback: + + ```javascript + AgoraRTC.onAutoplayFailed = ()=>{ + document.alert('Please click the page to resume playback'); + } + ``` +

+
+ +
+If a local user wears a Bluetooth headset, after they start to send the audio, the remote audio is lost +

+ +**Scope**: Certain Xiaomi and OnePlus devices +

+

+ +**Details**: If a local user wears a Bluetooth headset, when the Bluetooth headset starts capturing the audio, there is a possibility that the remote audio is lost. +

+

+ +**Reason**: It may be due to the audio issue on Chromium regarding the profile switch of the Bluetooth. +

+

+ +**Workaround**: Agora recommends that you add a prompt to remind users of possible audio-loss issues when they use a Bluetooth headset. +

+
+ +
+Issues specific to certain Android devices +

+ +- On devices equipped with **MediaTek chips**, the Web SDK cannot encode and send video streams in H.264. +- On devices equipped with Huawei **HiSilicon Kirin** chips, if you use Chrome versions earlier than 88, the Web SDK cannot encode and send video streams in H.264. +- When receiving video streams on Chrome on **OnePlus 6**, if the screen turns off, the video can freeze. +- **Harmony OS** does not support sending the video stream of 180p. +

+
+ +
+Other known issues +

+ +- On some Android devices, the device labels might not be available. +- On some Android devices, tracks can end if the audio and video streams are interrupted by system phone calls or other audio or video calling apps. To resume the call, the Web SDK needs to re-capture the audio and video. +- On Android Chrome, the Web SDK cannot send high-quality and low-quality streams in H.264. +- On Android Chrome earlier than 90, the volume obtained by `getVolumeLevel` is 0, but the user can hear the audio. +- On Android system Webview versions from 55 to 75, the `decodeFrameRate` property stays 0. +

+
+ +## Known limitations + +### iOS + +
+The createScreenVideoTrack method is not supported +

+ +Reason: iOS Safari and WkWebView do not support the `mediaDevices.getDisplayMedia` method. +

+
+ +
+The setBeautyEffect method is not supported +

+ +Reason: WebGL is not well supported on iOS Safari and WkWebView, and the image enhancement algorithm can reduce the system performance below acceptable levels. +

+
+ +
+The IBufferSourceAudioTrack.seekAudioBuffer method is not supported +

+ +Reason: `WebAudio` on iOS does not support this method. +

+
+ +
+Cannot send H.264 video streams with a resolution of 1080p or higher +

+ +Reason: The Web SDK uses the H.264 Baseline Profile for negotiation, so encoding and sending a video stream with a resolution of 1080p or higher is not supported on iOS. +

+
+ +
+When sending a low-quality stream on iOS Safari, you cannot set LowStreamParameter.bitrate, and the resolution of the low-quality stream must be proportional to the resolution of the high-quality stream. +

+ +Reason: iOS Safari and WkWebView do not support setting the frame rate with the `RTCRTPSender.setParameters` method. After compressing the resolution with the `scaleResolutionDownBy` property, the resolution of the low-quality stream stays proportional to the resolution of the high-quality stream. +

+
+ +
+The encodeDelay property is not supported +

+ +Reason: The `encodeDelay` property cannot be calculated through the `getStats` method of WebRTC on iOS. +

+
+ +### Android + +
+The createScreenVideoTrack method is not supported +

+ +Reason: The `mediaDevices.getDisplayMedia` method is not implemented on mobile browsers and WkWebView. +

+
+ +
+The setBeautyEffect method is not supported +

+ +Reason: The image enhancement algorithm can reduce the system performance of mobile devices below acceptable levels. +

+
\ No newline at end of file diff --git a/markdown/Video/web_sdk_mobile_known_issues.md b/markdown/Video/web_sdk_mobile_known_issues.md new file mode 100644 index 00000000000..aae17f92b03 --- /dev/null +++ b/markdown/Video/web_sdk_mobile_known_issues.md @@ -0,0 +1,333 @@ +# 移动端已知问题和规避方案 + +本页列出在移动端使用 Web SDK 的已知问题和限制: +- 已知问题:由 iOS 平台特定版本的 Bug 或 Android 平台特定浏览器/机型的 Bug 所造成的问题。针对已知问题,Agora 提供规避方案。 +- 已知限制:由于 iOS/Android 平台的问题,Web SDK 不支持的 API 或功能。 + +
随着 Android 和 iOS 版本的迭代,本页内容会根据实际情况定期更新。
+ +## 已知问题 + +### iOS + +
+iOS 15.1.x: 使用 H.264 编码发送视频流导致页面奔溃 +

+ +**影响范围**:iOS 15.1.x 上的所有浏览器和内嵌 WkWebView 的应用(如微信浏览器和 Chrome 浏览器)。 +

+

+ +**问题描述**:iOS 15.1.x 上如果你调用 `createClient` 时将 `codec` 设为 `'h264'`,发送视频流后,页面会崩溃。 +

+

+ +**问题原因**:该问题是由 iOS 15.1.x 上 WebKit 视频编码功能回退导致,详见 [WebKit Bug 231505](https://bugs.webkit.org/show_bug.cgi?id=231505)。 +

+

+ +**规避方案**:使用 VP8 进行视频编码。 + +```javascript +createClient({codec:'vp8', mode}) +``` +

+
+ +
+iOS 15.x: 本地用户听到远端音频流的音量极低 +

+ +**影响范围**:iOS 15.x 上的所有浏览器及内嵌 WkWebView 的应用(如微信浏览器和 Chrome 浏览器)。

+

+ +**问题描述**:iOS 15.x 上订阅并播放远端音频轨道 `RemoteAudioTrack` 后,播放音量有概率极低,且音频从听筒中而不是扬声器中播放出来。

+

+ +**问题原因**:该问题是由 iOS 15.x 上 WebKit 音频功能回退导致,详见 [WebKit Bug 230902](https://bugs.webkit.org/show_bug.cgi?id=230902)。 +

+

+ +**规避方案**:iOS 15.x 上使用 `WebAudio` 进行音频播放并使用 `GainNode` 调整音量后,可以提高播放音量。Agora 建议你按照以下步骤规避该问题: +1. 升级至 Web SDK 4.9.0 或以上版本。 +2. 设置 SDK 私有参数 `REMOTE_AUDIO_TRACK_USES_WEB_AUDIO` 为 `true`。SDK 内部会使用 `WebAudio` 播放远端音频流。示例代码如下: + ```javascript + function isIOS15(ua){ + // 通过 UA 判断 iOS 版本是否为 15 + } + + if(isIOS15(navigator.userAgent)){ + AgoraRTC.setParameter("REMOTE_AUDIO_TRACK_USES_WEB_AUDIO", true); + } + ``` +

+
+ +
+iOS 15.x: 播放视频有概率出现黑屏 +

+ +**影响范围**:iOS 15.x 上的所有浏览器及内嵌 WkWebView 的应用(如微信浏览器和 Chrome 浏览器)。 +

+

+ +**问题描述**:iOS 15.x 上在 DOM 中播放视频且在 `video` 元素或其父元素添加某些 CSS 属性(如 `transform`、`animation`)后,或者改变 CSS 属性重绘视频渲染区域后,有概率视频播放出现黑屏。 +

+

+ +**问题原因**:该问题是由 iOS 15.x 上 WebKit 视频渲染功能回退导致,详见 [WebKit Bug 230902](https://bugs.webkit.org/show_bug.cgi?id=230902)。 +

+

+ +**规避方案**:升级至 Web SDK 4.7.3 或以上版本,并且尽量减少更改 `video` 元素及其父元素的 CSS 属性。 +

+
+ + +
+iOS 15.x: 用户佩戴蓝牙耳机后,播放音频有概率明显失真 +

+ +**影响范围**:iOS 15.x 上的所有浏览器及内嵌 WkWebView 的应用(如微信浏览器和 Chrome 浏览器)。 +

+

+ +**问题原因**:该问题是由 iOS 15.x 上 WebKit 音频播放功能回退导致,详见 [WebKit Bug 231422](https://bugs.webkit.org/show_bug.cgi?id=231422)。 +

+

+ +**规避方案**:Agora 建议你在业务层面添加提示,告知用户使用蓝牙耳机可能出现音频失真问题。 +

+
+ +
+iOS 15.x: 浏览器或应用切换到后台后,音频流发送中断 +

+ +**影响范围**:iOS 15.x 上的所有浏览器及内嵌 WkWebView 的应用(如微信浏览器和 Chrome 浏览器)。 +

+

+ +**问题原因**:由于 WebKit 的 [bug](https://bugs.webkit.org/show_bug.cgi?id=231105),浏览器切换至后台后,`WebAudio` 的 `AudioContext` 会停止音频处理。 +

+

+ +**规避方案**:参考以下步骤规避此问题: +1. 升级至 Web SDK 4.7.3 或之后版本。 +2. 调用 `createMicrophoneAudioTrack` 创建音频轨道时,将`bypassWebAudio` 参数设为 `true`,本地音频流会不经由 `WebAudio` 处理直接发布。 + + ```javascript + const localAudioTrack = await AgoraRTC.createMicrophoneAudioTrack({bypassWebAudio: true}); + ``` + + > 注意:此方案会导致混音功能(`MixingAudioTrack`)失效。 +

+
+ +
+iOS 15.x: 被其它语音或视频通话应用、Siri 呼叫、闹钟等打断后,音视频播放有概率无法自动恢复 +

+ +**影响范围**:iOS 15.x 上的所有浏览器及内嵌 WkWebView 的应用(如微信浏览器和 Chrome 浏览器)。 +

+

+ +**问题原因**:音视频播放被打断后,DOM `video` 元素和 `audio` 元素的状态变为 `paused`。打断结束后,状态无法自动切回 `playing`,且调用`HTMLMediaElement.play` 方法也无法恢复媒体的播放。详见 [WebKit bug 232599](https://bugs.webkit.org/show_bug.cgi?id=232599) 和[WebKit bug 226698](https://bugs.webkit.org/show_bug.cgi?id=226698)。 +

+

+ +**规避方案**:升级至 Web SDK 4.7.3 或以上版本。SDK 会尝试在打断事件后恢复媒体播放。Agora 建议你在业务层面增加提示,引导用户刷新页面。 +

+
+ +
+其他历史已知问题 +

+ +- iOS 13 和 14 上可能出现远端用户音量随机变化的问题。 +- 切换前置、后置摄像头后采集画面可能会瞬间旋转。 +- 语音路由随机切换,即可能出现插着耳机但是仍然从扬声器出声,或者没有耳机却从听筒出声的情况。 +- 连续两次调用 `getUserMedia` 获取相同媒体类型的轨道,第一次获取的媒体轨道会静音或黑屏。 +- 使用过其他使用音视频输入设备的 app 后(例如 Siri 或者 Skype 通话),无法采集本地音频或视频。 +

+
+ +### Android + +
+Android 12: Chrome 上使用 WebRTC 视频硬件编码可能会导致花屏 + +

+ +**影响范围**:部分安装了 Android 12 的设备,如 Pixel 3 和 Pixel 4,且使用 Chrome 浏览器或 Chromium 内核浏览器 97 或以下版本。 +

+

+ +**问题描述**:在 Android 12 上使用 Chrome 浏览器或 Chromium 内核浏览器 97 或以下版本,如果默认开启 WebRTC `H264` 或 `VP8` 视频硬件编码,可能会导致花屏。 +

+

+ +**问题原因**:该问题是由 Chromium WebRTC 模块视频编码回退导致,详见 [Chromium issue 1237677](https://bugs.chromium.org/p/chromium/issues/detail?id=1237677)。 +

+

+ +**规避方案**:Chrome 97 已修复该问题,建议用户升级至 Chrome 97 或以上版本。 +

+
+ +
+Android Chrome 上视频发送码率无法达到 Web SDK 的预设值 +

+ +**影响范围**:部分 Android 设备,如部分小米及 One Plus 机型。 +

+

+ +**问题原因**:可能是因为硬件编码导致特定视频编码帧率下码率无法达到预设值。 +

+

+ +**规避方案**:大部分情况下,视频编码帧率为 15 fps 时,码率会过低,而帧率为 30 fps 时码率则相对较高。因此 Agora 建议遇到码率问题时,尝试将帧率设为 30 fps。请注意,将帧率设为 30 fps 可能会带来性能问题。 +

+
+ +
+微信浏览器中视频无法自动播放 +

+ +**影响范围**:使用 Chromium 89 内核的微信浏览器。 +

+

+ +**问题描述**:微信浏览器中视频无法自动播放。并且当用户通过手势(点击、触摸)恢复播放后,下一次视频仍然无法自动播放。 +

+

+ +**问题原因**:可能是微信浏览器对自动播放的行为处理有异常,与其他浏览器的行为不一致。 +

+

+ +**规避方案**:参考以下步骤规避此问题: +1. 升级至 Web SDK 4.6.0 或以上版本。 +2. 监听 `AgoraRTC.onAutoplayFailed` 事件。在此事件中,引导用户点击页面,恢复播放: + + ```javascript + AgoraRTC.onAutoplayFailed = ()=>{ + document.alert('请点击页面后恢复播放'); + } + ``` +

+
+ +
+本地用户佩戴蓝牙耳机,开始发送音频流后就无法听到远端音频 +

+ +**影响范围**:部分小米及 One Plus 机型 +

+

+ +**问题描述**:如果本地用户佩戴蓝牙耳机,在通话过程中通过蓝牙耳机采集本地音频且发送音频流后,有概率会无法收听到远端用户的声音。 +

+

+ +**问题原因**:可能是由于 Chromium 在蓝牙设备的 profile 切换后会产生音频异常。 +

+

+ +**规避方案**:Agora 建议你在业务层面添加提示,告知用户使用蓝牙耳机可能出现无声问题。 +

+
+ +
+某些 Android 机型特有的问题 +

+ +- 在搭载**联发科芯片**的设备上无法使用 H.264 编码在 Chrome 浏览器中发送视频流。 +- 在搭载**华为海思麒麟芯片**的设备上,Android Chrome 88 以下版本上,无法使用 H.264 编码发送视频流。 +- 在 **OnePlus 6**上使用 Chrome 浏览器接收远端视频流期间熄灭屏幕,可能会导致视频流冻结。 +- **鸿蒙系统**不支持发 180p 的视频流。 +

+
+ +
+其他历史已知问题 +

+ +- 在部分 Android 设备上可能无法获取到媒体设备的 device label。 +- 在部分 Android 设备上音视频流被系统电话呼叫或其他语音和视频通话应用打断,可能会导致 track-ended,需要重新采集音视频。 +- Android Chrome 上无法使用 H.264 编码发送大小流。 +- Android Chrome 90 以下版本中 `getVolumeLevel` 获取到的音量为 0,但是能听到声音。 +- Android 系统 WebView 55 至 75 版本中 `decodeFrameRate` 为 0。 +

+
+ +## 已知限制 + +### iOS + +
+不支持调用 createScreenVideoTrack 进行屏幕共享 +

+ +原因:iOS Safari 及 WkWebView 不支持 `mediaDevices.getDisplayMedia` 接口。 +

+
+ +
+不支持调用 setBeautyEffect 开启美颜 +

+ +原因:iOS Safari 及 WkWebView 对 WebGL 支持不佳,且 iOS 设备在进行美颜算法处理时性能消耗过大。 +

+
+ +
+不支持 IBufferSourceAudioTrack.seekAudioBuffer 方法 +

+ +原因:iOS 上 `WebAudio` 不支持实现该方法。 +

+
+ +
+无法使用 H.264 编码发送 1080p 及以上分辨率的视频流 +

+ +原因:Web SDK 使用 H.264 Baseline Profile 进行协商,因此 iOS 上不支持编码发送 1080p 及以上分辨率的视频流。 +

+
+ +
+发送小流时,不支持设置 LowStreamParameter.bitrate,且小流分辨率需要与大流分辨率成比例 +

+ +原因:iOS Safari 及 WkWebView 中 `RTCRTPSender.setParameters` 方法无法指定帧率,通过 `scaleResolutionDownBy` 属性进行分辨率压缩后,小流分辨率与大流成固定比率。 +

+
+ +
+不支持获取 encodeDelay +

+ +原因:iOS 上无法通过 WebRTC 的 `getStats` 接口计算出 `encodeDelay`。 +

+
+ +### Android + +
+不支持调用 createScreenVideoTrack 进行屏幕共享 +

+ +原因:移动端浏览器及 WkWebView 未实现 `mediaDevices.getDisplayMedia` 接口。 +

+
+ +
+不支持调用 setBeautyEffect 开启美颜 +

+ +原因:移动端设备在进行美颜算法处理时性能消耗过大。 +

+
\ No newline at end of file