How to handle video black screen issues in Express?
Problem Description
Common video black screen situations include the following three cases:
- Local preview video is black, playing video is normal.
- Local preview video is normal, playing video is black.
- Both local preview and playing video are black.
Problem Cause
There are many reasons for black screen. Common reasons include:
- Network issues: If the local network connection is poor or interrupted, you will not be able to see other users' videos. If one party's network has problems during a call, others will not be able to see this user's video.
- Rendering issues: Incorrect rendering view settings or abnormal lifecycle can also cause black screen.
- Additionally, if the user actively closes the video, black screen will also occur, including but not limited to no permission, active disabling, switching to background, etc.
Solution
If there is a video black screen issue, you can refer to the following troubleshooting steps.
Problem Troubleshooting
During troubleshooting, you can use the device error callback onDeviceError to help determine the problem.
Local preview video is black, playing video is normal
This situation is generally caused by camera failure or being occupied, causing local video capture problems. Please refer to the following steps to troubleshoot:
- Check the publishing quality parameters from the onPublisherQualityUpdate callback to see if the capture frame rate and rendering frame rate are normal.
- If the capture frame rate is zero, check whether the user has disabled local video. For example, calling enableCamera, or setting incorrect capture/encoding resolution.
- If the above configuration is normal, it may be a camera hardware problem. Open the system's built-in video recording program to see if you can record. If not, you need to replace the camera.
- If the camera is not a problem, you need to confirm whether camera permissions are enabled. Both Android and iOS systems have permission management. Please check in system settings.
- To enable Android permissions, please refer to Video Call - Integration in "Setting Permissions", add project permissions, and obtain device permissions.
- To enable iOS permissions, please refer to Video Call - Integration in "Setting Permissions", add media device permissions.
- Check whether other applications are occupying the camera. Close other applications and open your own application for testing. On Windows platform, check whether there is a virtual camera occupying the physical camera.
- If the capture frame rate is not zero and the rendering frame rate is zero, please refer to the third case "Both local preview and playing video are black" for troubleshooting steps.
- If it is custom video capture, you need to confirm whether the custom video capture data is correct. Please pay attention to the unit of the timestamp.
Local preview video is normal, playing video is black
This situation may be caused by remote capture/publishing issues or local downlink network problems. Please refer to the following steps to troubleshoot:
- Check whether the user has disabled playing remote video, i.e., called mutePlayStreamVideo.
- If remote video playing is not disabled, check the playing quality parameters from the onPlayerQualityUpdate callback to see if the network frame rate, decoding frame rate, and rendering frame rate are normal.
- If the network frame rate is zero, it is recommended to switch networks to see if the problem still exists to rule out network issues. At the same time, check the remote video camera status from the onRemoteCameraStateUpdate callback.
- If the remote video camera status is normal, check whether the remote user can see their own image on their device. If not, it is the remote user's video problem. Please refer to the first case "Local video is black, remote video is normal" for troubleshooting steps.
- If the network frame rate is not zero and the rendering frame rate is zero, please refer to the third case "Both local preview and playing video are black" for troubleshooting steps.
Both local preview and playing video are black
This situation may be caused by rendering problems or video not being enabled. Please refer to the following steps to troubleshoot:
- Check whether local camera is disabled and remote video playing is disabled.
- If it is custom video rendering, you need to troubleshoot the rendering module.
- Check whether you are using a pure audio SDK instead of a video SDK.
- Check whether the local preview and playing rendering views are set correctly. For example, whether the view's width and height are both non-zero, whether the view's lifecycle is normal, and whether the view is covered by other black views.
Monitor Quality Using Analytics Dashboard
You can use the Analytics Dashboard in the ZEGOCLOUD Console to track the quality of audio and video calls.
Contact ZEGOCLOUD Technical Support
If the problem persists, please contact ZEGOCLOUD Technical Support and provide the following information to help quickly locate the problem.
| Information | Details |
|---|---|
| Required Information | User information related to the black screen: user ID (userID) and stream ID (streamID). |
| Optional Information | The specific time period when the black screen occurs. |
| SDK log file. For details, please refer to How to set and get SDK logs and stack information in Express. |
