Class VideoPlayerSpaceComponent

Inheritance Relationships

Base Types

Class Documentation

class VideoPlayerSpaceComponent : public csp::multiplayer::ComponentBase, public csp::multiplayer::IEnableableComponent, public csp::multiplayer::ITransformComponent, public csp::multiplayer::IVisibleComponent

Enables the playback of video content within the space.

You can use it to stream videos from a URL or play videos stored as assets in CSP, allowing users to watch videos directly within the virtual environment.

Public Functions

VideoPlayerSpaceComponent(SpaceEntity *Parent)

Constructs the video player component, and associates it with the specified Parent space entity.

Parameters

Parent – The Space entity that owns this component.

const csp::common::String &GetName() const

Gets the name of this video player.

Returns

The name of this video player.

void SetName(const csp::common::String &Value)

Sets the name of this video player.

Parameters

Value – The name of this video player.

const csp::common::String &GetVideoAssetId() const

Gets the ID of the video asset associated with this video player.

Returns

The ID of the video asset assicuated with this video player.

void SetVideoAssetId(const csp::common::String &Value)

Sets the ID of the video asset associated with this video player.

Parameters

Value – The ID of the video asset assicuated with this video player.

const csp::common::String &GetVideoAssetURL() const

Gets the URL of the video asset associated with this video player.

Returns

The URL of the video asset associated with this video player.

void SetVideoAssetURL(const csp::common::String &Value)

Sets the URL of the video asset associated with this video player.

Parameters

Value – The URL of the video asset associated with this video player.

const csp::common::String &GetAssetCollectionId() const

Gets the ID of the asset collection associated with this component.

Note

To retrieve this component’s video asset, both the Asset ID and the Asset Collection ID are required.

Returns

The ID of the asset collection associated with this component.

void SetAssetCollectionId(const csp::common::String &Value)

Sets the ID of the asset collection associated with this component.

Note

To retrieve this component’s video asset, both the Asset ID and the Asset Collection ID are required.

Parameters

Value – The ID of the asset collection associated with this component.

bool GetIsStateShared() const

Checks if the playback state of this video player needs to be shared with other users through replication.

Returns

True if the playback state of the video needs to be shared among all users, false otherwise.

void SetIsStateShared(bool Value)

Establishes if the playback state of this video player needs to be shared with other users through replication.

Parameters

Value – True if the playback state of the video needs to be shared among all users, false otherwise.

bool GetIsAutoPlay() const

Checks if the video plays automatically on load.

Returns

True if the video auto-plays on load, false otherwise.

void SetIsAutoPlay(bool Value)

Establishes if the video plays automatically on load.

Parameters

Value – True if the video auto-plays on load, false otherwise.

bool GetIsLoopPlayback() const

Checks if the video loops (i.e.

starts over on end).

Returns

True if the video loops, false otherwise.

void SetIsLoopPlayback(bool Value)

Establishes if the video loops (i.e.

starts over on end).

Parameters

Value – True if the video loops, false otherwise.

bool GetIsAutoResize() const

Checks if the video auto-resizes if its frame has different dimensions.

Returns

True if the video will resize automatically, false otherwise.

void SetIsAutoResize(bool Value)

Establishes if the video auto-resizes if its frame has different dimensions.

Parameters

Value – True if the video will resize automatically, false otherwise.

float GetAttenuationRadius() const

Gets the radius from this component origin within which the audio of this video can be heard by the user.

Note

Only when the user position is within this radius the audio of the video should be heard.

Returns

The radius within which the audio of the video can be heard by the user.

void SetAttenuationRadius(float Value)

Sets the radius from this component origin within which the audio of this video can be heard by the user.

Note

Only when the user position is within this radius the audio of the video should be heard.

Parameters

Value – The radius within which the audio of the video can be heard by the user.

VideoPlayerPlaybackState GetPlaybackState() const

Retrieves the playback state of the video of this component.

Returns

The playback state of the video.

void SetPlaybackState(VideoPlayerPlaybackState Value)

Sets the playback state of the video of this component.

Parameters

Value – The playback state of the video.

float GetCurrentPlayheadPosition() const

Gets the current playhead position of the played video.

Returns

The current playhead position of the played video.

void SetCurrentPlayheadPosition(float Value)

Sets the current playhead position of the played video.

Parameters

Value – The current playhead position of the played video.

float GetTimeSincePlay() const

Gets the time in Unix timestamp format that identifies the moment when the video started to play.

Returns

The time in Unix timestamp format when the video started to play.

void SetTimeSincePlay(float Value)

Sets the time in Unix timestamp format that identifies the moment when the video started to play.

Parameters

Value – The time in Unix timestamp format when the video started to play.

VideoPlayerSourceType GetVideoPlayerSourceType() const

Gets the type of source the video of this component uses.

Returns

The type of video source used by this component.

void SetVideoPlayerSourceType(VideoPlayerSourceType Value)

Sets the type of source the video of this component uses.

Parameters

Value – The type of video source used by this component.

uint16_t GetMeshComponentId() const

Gets the Id of the mesh component that the video should be rendered to.

void SetMeshComponentId(uint16_t Id)

Sets the Id of the mesh component that the video should be rendered to.