Breakroom is now Sinewave Campus. Book a meeting

SEmbeddedVideo

ClientComponents
On this classOnStateChange
  1. Functions
  2. OnStateChange
  3. Play
  4. Stop
  5. Pause
  6. Resume
  7. SynchorizeUrl
  8. ClearRenderTexture
  9. Properties
  10. State
  11. URL
  12. AudioSource
  13. OutputTexture
  14. Texture
  15. Time
  16. Position
  17. UniqueName
  18. VideoLength
  19. Loop
  20. FrameCount
  21. IsPlaying
  22. GameObject
Members 20
FunctionOnStateChange–
FunctionPlayIf URL is set, plays the video
FunctionStopStops the playback
FunctionPausePauses currently played video
FunctionResumeIf the video is currently paused, it will resume playback
FunctionSynchorizeUrlSynchorize current video URL
FunctionClearRenderTextureClears the Render Texture
PropertyStateThe state player is currently in.
PropertyURLCurrent URL set for this Player.
PropertyAudioSourceCurrent AudioSource
PropertyOutputTexture–
PropertyTextureTexture which the player uses to display the video.
PropertyTimeCurrent player time.
PropertyPositionCurrent Video Frame Position
PropertyUniqueName–
PropertyVideoLengthGet the length of the video
PropertyLoopWhether video is set to loop or not
PropertyFrameCountReturns the frame count of the video
PropertyIsPlayingReturns whether the video is playing or not
PropertyGameObject–

Functions​

OnStateChange​

void OnStateChange(Closure e)

Parameters

NameTypeDefault
eClosure–

Returns

void

Example

Lua
function stateChangeFunction(EmbeddedVideo, oldState, newState)
--what happens on state change
end

Space.Host.ExecutingObject.EmbeddedVideo.OnStageChange(stateChangeFunction)
Lua
--get embedded video component on your video player
video = Space.Scene.Find("VidepPlayer").EmbeddedVideo
function GetClosure()
return function (a,b,c)
log(a.URL..b..c)
end
end
video.OnStateChange(GetClosure())
video.Pause()

Play​

void Play()

If URL is set, plays the video

Returns

void

Example

Lua
Space.Host.ExecutingObject.EmbeddedVideo.Play()

Stop​

void Stop()

Stops the playback

Returns

void

Example

Lua
Space.Host.ExecutingObject.EmbeddedVideo.Stop()

Pause​

void Pause()

Pauses currently played video

Returns

void

Example

Lua
Space.Host.ExecutingObject.EmbeddedVideo.Pause()

Resume​

void Resume()

If the video is currently paused, it will resume playback

Returns

void

Example

Lua
Space.Host.ExecutingObject.EmbeddedVideo.Resume()

SynchorizeUrl​

void SynchorizeUrl()

Synchorize current video URL

Returns

void

Example

Lua
Space.Host.ExecutingObject.EmbeddedVideo.SynchorizeUrl()

ClearRenderTexture​

void ClearRenderTexture()

Clears the Render Texture

Returns

void

Example

Lua
Space.Host.ExecutingObject.EmbeddedVideo.ClearRenderTexture()

Properties​

StateRead only​

SEmbeddedVideoState State {get; }

The state player is currently in. You can track state changes through StateChangeEvent.

Example

Lua
CurrentVideoState = Space.Host.ExecutingObject.EmbeddedVideo.State

URL​

string URL {get; set; }

Current URL set for this Player.

Example

Lua
CurrentURL = Space.Host.ExecutingObject.EmbeddedVideo.URL

AudioSource​

SAudioSource AudioSource {get; set; }

Current AudioSource

Example

Lua
CurrentAudioSource = Space.Host.ExecutingObject.EmbeddedVideo.AudioSource

OutputTextureRead only​

SResource OutputTexture {get; }

Example

Lua
OutputTexture = Space.Host.ExecutingObject.EmbeddedVideo.OutputTexture

TextureRead only​

SResource Texture {get; }

Texture which the player uses to display the video.

Example

Lua
Texture = Space.Host.ExecutingObject.EmbeddedVideo.Texture

Time​

double Time {get; set; }

Current player time. Can be set to move the 'playhead' to the specific position.

Example

Lua
Time = Space.Host.ExecutingObject.EmbeddedVideo.Time

PositionRead only​

long Position {get; }

Current Video Frame Position

Example

Lua
Position = Space.Host.ExecutingObject.EmbeddedVideo.Position

UniqueNameRead only​

string UniqueName {get; }

Example

Lua
UniqueName = Space.Host.ExecutingObject.EmbeddedVideo.UniqueName

VideoLengthRead only​

double VideoLength {get; }

Get the length of the video

Example

Lua
VideoLength = Space.Host.ExecutingObject.EmbeddedVideo.VideoLength

Loop​

bool Loop {get; set; }

Whether video is set to loop or not

Example

Lua
Space.Host.ExecutingObject.EmbeddedVideo.Loop = true

FrameCountRead only​

int FrameCount {get; }

Returns the frame count of the video

Example

Lua
FrameCount = Space.Host.ExecutingObject.EmbeddedVideo.FrameCount

IsPlayingRead only​

bool IsPlaying {get; }

Returns whether the video is playing or not

Example

Lua
IsPlaying = Space.Host.ExecutingObject.EmbeddedVideo.IsPlaying

GameObjectRead only​

SGameObject GameObject {get; }

Example

Lua
theGameObject = Space.Host.ExecutingObject.EmbeddedVideo.GameObject