Skip to main content

Layers

Background and Foreground / Overlay​

You can display any data content inside your video using the Eyeson layer service. There are two ways to add an image:

  1. Generate and send the image file directly, or
  2. provide a public URL to the image.

Each image is placed on one of two layers:

  • Background (z-index=-1): has no transparency, so JPEG images work fine here.
  • Foreground / overlay (z-index=1): use a PNG or WebP image with an alpha channel (transparency), or an SVG file, so the video stays visible behind the transparent areas. Don't use JPEG files, as they do not support transparency.

Match the image size to the room resolution listed below. Overlay images larger than this resolution are rejected.

Room ModeResolution (pixels)Description
Default1280x960960p Standard
Widescreen1280x720HD Widescreen
tip

When using layers, you may want to disable SFU mode in the default room configuration, as it will transport individual streams for single and two participants without showing layer media.

Eyeson Layers Diagram

Add Content to Layer​

Supported image types are: PNG, WebP, SVG, and JPEG. Background layer has no transparency, foreground layer / overlay can be transparent.

The positioning of images smaller than the call resolution of either 1280x960 pixels (960p in default) or 1280x720 pixels (HD in widescreen mode) follows the following rule:

  • Background: The image will be centered and scaled to fit if too large.
  • Foreground / Overlay: The image will be positioned in the left upper corner and not be scaled.

Overlay images larger than the resolution will throw an Error 400 BAD REQUEST.

info

Transparent parts of an image in the background layer are rendered white.

POST /rooms/`ACCESS_KEY`/layers
RESPONSES 201 CREATED, 400 BAD REQUEST, 404 NOT FOUND, 410 GONE
RECOMMENDED file or url, z-index

file​

Type: File [binary] (optional)
File upload.

Example Req/Res: Overlay with local File
export ACCESS_KEY=...
curl -X POST \
-F "file=@path/to/local/file.png" \
-F "z-index=-1" \
"https://api.eyeson.team/rooms/$ACCESS_KEY/layers"
Response
No Response

Example​

url​

Type: URL (optional)
Public file URL.

Example Req/Res: Background Image with File URL
export ACCESS_KEY=...
curl -X POST \
-d "url=https://docs.eyeson.com/img/examples/overlay_example.png" \
-d "z-index=1" \
"https://api.eyeson.team/rooms/$ACCESS_KEY/layers"
Response
No Response

Examples​

z-index​

Type: STRING (optional)
Default: 1
Assigns images to a specific layer.

ValueDescription
1Image is placed in the foreground
-1Image is placed in the background
info

If you don't append a z-index parameter to your request, it is assumed to be 1.

id​

Type: STRING (optional)
Layer id for relation control in observer "podium_update" event.

Delete Layer Content​

DELETE /rooms/`ACCESS_KEY`/layers/`LAYER_INDEX` # clear layer, layer_index: -1 or 1
RESPONSES 200 OK, 404 NOT FOUND, 410 GONE
Example Req/Res: Delete Background Layer Content
export ACCESS_KEY=...
curl -X DELETE "https://api.eyeson.team/rooms/$ACCESS_KEY/layers/-1"
Response
No Response