@snap/camera-kit
Version:
Camera Kit Web
36 lines (20 loc) • 1.12 kB
Markdown
[CameraKit Web SDK - v0.22.0](../README.md) / [Exports](../modules.md) / CreateSessionOptions
# Interface: CreateSessionOptions
Options available when creating a [CameraKitSession](../classes/CameraKitSession.md).
## Table of contents
### Properties
- [liveRenderTarget](CreateSessionOptions.md#liverendertarget)
- [renderWhileTabHidden](CreateSessionOptions.md#renderwhiletabhidden)
## Properties
### liveRenderTarget
• `Optional` **liveRenderTarget**: `HTMLCanvasElement`
Optionally provide an existing canvas element, on which the Live RenderTarget will be rendered.
If this is not provided, CameraKit will create a new canvas element which can be added to the DOM.
___
### renderWhileTabHidden
• `Optional` **renderWhileTabHidden**: `boolean`
Browsers optimize tabs when they are hidden - for example, by pausing the execution of requestAnimationFrame
callbacks.
If you need the CameraKitSession to continue rendering even when the tab is in the background, set this to true.
There is a small performance penalty, and it's a good practice to only render in the background if absolutely
necessary.