Skip to main content
No Result Found

Upload video files and simulate the camera

Important: This feature is currently a Private Beta service and available only under Desktop and Mobile Pro, and Enterprise Pro plans. For more details, check out our pricing page.

BrowserStack Automate enables you to upload video files to BrowserStack devices to verify various use cases, such as testing web apps and websites that require access to camera and video output, scanning QR code to your web app, testing the video recording feature, etc.

In this guide, you will learn:

Supported OS and browsers

Supported Platform Supported Versions Supported Browsers
Android 9 and above Chrome 101 and above
iOS 12 and above Safari 10 and above
Windows 7 and above Chrome 101 and above
Edge 101 and above
macOS Any Chrome 101 and above
Edge 101 and above
Note:
  • Camera Video Injection feature is currently not supported on Oppo, Vivo, Huawei, Sony, and Samsung Galaxy M32 devices.
  • You can upload video files in the .mp4 format only, with maximum file size of 50 MB.

Upload your video files

Prior to starting the test execution, upload the video files using media REST APIs.

curl -u "username:accesskey" -X POST "https://api-cloud.browserstack.com/automate/upload-media" -F "file=@/path/to/app/file/test.mp4"

The REST API returns a response media_url for each successful file upload.

{
    "media_url" : "media://<hashedid>"
}
Note: This feature is currently a Private Beta service and available only under Desktop and Mobile Pro, and Enterprise Pro plans. For more details, check out our pricing page.

Inject the video file using the Automate capability

If you are using BrowserStack SDK, you can set the following capabilities in the browserstack.yml file:

Capability Description
cameraInjection Set this capability to "true" if you want to use your video files to emulate camera in the test.
cameraInjectionUrl Add this capability with media_url of the video files to emulate camera in the test.
browserstack.yml
Copy icon Copy
cameraInjection: true
cameraInjectionUrl: media://575927ad18ae787c065e680dc3ee864725cd809e

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle