Be the first user to complete this post

  • 0
Add to List

Automated testing of webcam / video feeds in webRTC application

Testing webRTC based application, consistently automated fashion is a challenging problem. Mainly due to the real time nature of the application including the media streams related features like the audio, video and screensharing. There are useful flags in which browser vendors provide to make life easier. Here, we will look at the flags related to webcam sharing.

Physical webcam

webRTC-1

Fake webcam

webRTC-3
To test the web camera streams without using an actual camera, chrome provides few useful flags. The easiest one is the following : use-fake-device-for-media-stream

Fake webcam preview

fake_device_0
I call the green packman with counter

Limitations

  • Allows only a single fake webcam stream. Hence, can not test mutiple webcam streams using this approach.

Automate the local y4m video files via automation

You can use the following chrome flags to feed the local video file in the video feed.
[use-file-for-fake-video-capture](http://peter.sh/experiments/chromium-command-line-switches/#use-file-for-fake-video-capture)
You can use this flag to verify the content of the webcam feed. For example, sender can share a video showing the barcode and on the receiver can verify the content of the barcode using library such as zxing.

Further reading




Also Read:

  1. Testing promise sequence using mocha, chai, chai-as-promised, sinon
  2. Chromium flag to by pass popup to grant desktop sharing in WebRTC app
  3. Run a single test in jasmine
  4. Chromium flag to by pass the popup to grant media permissions in webRTC