Skip to main content

Media Injection

The Media Injection feature allows users to feed any image or video directly into a browser's camera stream during an Astrofarm session. This is particularly useful for testing camera-dependent workflows — such as document scanning, barcode reading, or facial recognition — without needing a physical camera, props, or specific lighting conditions.

Use Cases

Many applications rely on the device camera to capture real-world inputs like ID documents, barcodes, or faces. Testing these flows traditionally requires physical setups like holding documents in front of a webcam or finishing up with KYC , testing the image detection in the application, making tests inconsistent and hard to reproduce.

With Media Injection, users can upload a controlled image or video directly into the browser's camera stream from within the console, enabling reliable and repeatable testing of any camera-based feature without leaving their desk.

Steps to Use Media Injection

One-Time Setup

To use Media Injection, you need to enable the required Chrome flag on your device. This is a one-time setup and will not be needed again once completed.

  1. Open Chrome on your device and go to the flag link in your Astrofarm session panel.
  2. Copy the link “chrome://flags/#enable-command-line-on-non-rooted-devices” and paste in the chrome browser.

alt text

  1. Set the flag to Enabled and click Relaunch. Chrome application on the device will restart and it is expected.

Injecting Media

  1. Once flag is enabled on a device with a Chromium-based browser.
  2. In the AstroFarm Dashboard, locate the Media Injection section and toggle it on.
  3. Upload your media using one of the following methods:
    • Browse from Computer — Drag and drop a file or click Browse to select one from your local machine.
    • Media Store — Select a previously uploaded asset from the Media Store, accessible from the left navigation panel of the Astrofarm console.
  4. Click Inject.
  5. In your web app, trigger the camera flow as usual. Your uploaded media will appear as the live camera feed.

Supported Formats & Browsers

Image — .jpg, .jpeg, .png — Max size: 10 MB

Video — .mp4, .mov — Max size: 50 MB

Y4M Video — .y4m — Max size: 300 MB

Browsers: Google Chrome, Microsoft Edge, Brave, Opera (Chromium-based, Android)