Shri
Shri

Reputation: 41

Emulator shows black screen during a video call

I am testing a simple webrtc application and for that I do a video call using a browser. I have setup an emulator running Android R (10.0+) emulating Pixel 3 with 4 GB of ram and 6 GB of hard drive space. I made a call using the application between the emulator and the desktop, using chrome on both devices, and I got a black screen for participant's video on both screens. I used the parameter document.getElementsByTagName('video').readyState and document.getElementsByTagName('video').networkState and I got a value of 0 or no data for readystate and, a value of 2 or loading for the networkState. I tried the same setup with a different emulator (Pixel with Android Q) and checked the same parameter, and I had no issues. I was able to see the video from both participants. Can anyone help me out?

Upvotes: 1

Views: 813

Answers (1)

user7810992
user7810992

Reputation:

Edit: Actually I just figured this out. If you go in and remove "OMX.google" from https://chromium.googlesource.com/external/webrtc/+/HEAD/sdk/android/src/java/org/webrtc/MediaCodecUtils.java#33 and make a custom build of webtc that should allow playback in API 28 and below emulators. Am working on getting it for 29 and above soon.

The Android emulator will show a blank screen with h264 video, since webrtc for Android does not enable h264 hardware encoding/decoding by default. You will need to use a physical device or build webrtc to use h264 software encoding/decoding. AFAIK this is the best guide to do that. You will need to translate it from Chinese. Keep in mind that this quirk also causes the video to show as blank on devices without the appropriate hardware (generally a Qualcomm or Exynos chipset)

Upvotes: 0

Related Questions