LayoutManager class

Manage Layout objects that are used to render different Components in the client app.

Signature:

export declare class LayoutManager extends ExternalObject 

Extends: ExternalObject

Remarks

Use Runtime.getLayoutManager() to get an instance of this class.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the LayoutManager class.

Methods

MethodModifiersDescription
createLayout(layout, configs, components, transitions)Create a layout to arrange camera and video components on the screen
createLayout(layout, mediaSources)Create a layout with components that display the given media sources.

LayoutManager.createLayout() method

Warning: This API is now obsolete.

Creating layouts using component configurations is deprecated. Use media sources instead.

Create a layout to arrange camera and video components on the screen

Signature:

createLayout(layout: string | LayoutCustomConfig, configs: ReadonlyObjectMap<ComponentConfig>, components?: ReadonlyObjectMap<Component>, transitions?: ReadonlyObjectMap<Transition>): Promise<Layout>;

Parameters

ParameterTypeDescription
layoutstring | LayoutCustomConfigThe identifier of one of ooohs predefined layouts or a custom layout object, used to control the screen positioning of the components
configsReadonlyObjectMap<ComponentConfig>Key matching the layout element id, Value defining the type of component to show in that layout element and it's options
componentsReadonlyObjectMap<Component>(Optional) Existing components to be placed in the layout element id matched by key. If this is supplied then the config value for the same key will be ignored
transitionsReadonlyObjectMap<Transition>(Optional) Allow existing components to move from their old position to new position over time. Only the time and function properties of the Transition object are applied.

Returns:

Promise<Layout>

The layout once it's able to be made visible

Remarks

When creating a camera, or loading a video, this call can take more than half a second to run, try to perform this operation behind the scenes

LayoutManager.createLayout() method

Create a layout with components that display the given media sources.

Signature:

createLayout(layout: LayoutCustomConfig, mediaSources: ReadonlyObjectMap<O3hMediaSource>): Promise<Layout>;

Parameters

ParameterTypeDescription
layoutLayoutCustomConfigA layout object used to control the screen positioning of the components
mediaSourcesReadonlyObjectMap<O3hMediaSource>Key matching the layout element id, Value defining the media source to be displayed in the component.

Returns:

Promise<Layout>

The layout once it's able to be made visible

Remarks

When a layout is created using media sources, its components (returned from Layout.getComponent()) are not instances of CameraComponent or VideoComponent. Instead you should control the camera or video player using the underlying media source.

It is allowed to use the same media source instance for multiple components (in the same layout or in different layouts).