SEmbeddedVideo
On this classOnStateChange
| Function | OnStateChange | – |
| Function | Play | If URL is set, plays the video |
| Function | Stop | Stops the playback |
| Function | Pause | Pauses currently played video |
| Function | Resume | If the video is currently paused, it will resume playback |
| Function | SynchorizeUrl | Synchorize current video URL |
| Function | ClearRenderTexture | Clears the Render Texture |
| Property | State | The state player is currently in. |
| Property | URL | Current URL set for this Player. |
| Property | AudioSource | Current AudioSource |
| Property | OutputTexture | – |
| Property | Texture | Texture which the player uses to display the video. |
| Property | Time | Current player time. |
| Property | Position | Current Video Frame Position |
| Property | UniqueName | – |
| Property | VideoLength | Get the length of the video |
| Property | Loop | Whether video is set to loop or not |
| Property | FrameCount | Returns the frame count of the video |
| Property | IsPlaying | Returns whether the video is playing or not |
| Property | GameObject | – |
Functions
OnStateChange
Parameters
| Name | Type | Default |
|---|---|---|
| e | Closure | – |
Returns
void
Example
function stateChangeFunction(EmbeddedVideo, oldState, newState)
--what happens on state change
end
Space.Host.ExecutingObject.EmbeddedVideo.OnStageChange(stateChangeFunction)
--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
If URL is set, plays the video
Returns
void
Example
Space.Host.ExecutingObject.EmbeddedVideo.Play()
Stop
Stops the playback
Returns
void
Example
Space.Host.ExecutingObject.EmbeddedVideo.Stop()
Pause
Pauses currently played video
Returns
void
Example
Space.Host.ExecutingObject.EmbeddedVideo.Pause()
Resume
If the video is currently paused, it will resume playback
Returns
void
Example
Space.Host.ExecutingObject.EmbeddedVideo.Resume()
SynchorizeUrl
Synchorize current video URL
Returns
void
Example
Space.Host.ExecutingObject.EmbeddedVideo.SynchorizeUrl()
ClearRenderTexture
Clears the Render Texture
Returns
void
Example
Space.Host.ExecutingObject.EmbeddedVideo.ClearRenderTexture()
Properties
StateRead only
The state player is currently in. You can track state changes through StateChangeEvent.
Example
CurrentVideoState = Space.Host.ExecutingObject.EmbeddedVideo.State
URL
Current URL set for this Player.
Example
CurrentURL = Space.Host.ExecutingObject.EmbeddedVideo.URL
AudioSource
Current AudioSource
Example
CurrentAudioSource = Space.Host.ExecutingObject.EmbeddedVideo.AudioSource
OutputTextureRead only
Example
OutputTexture = Space.Host.ExecutingObject.EmbeddedVideo.OutputTexture
TextureRead only
Texture which the player uses to display the video.
Example
Texture = Space.Host.ExecutingObject.EmbeddedVideo.Texture
Time
Current player time. Can be set to move the 'playhead' to the specific position.
Example
Time = Space.Host.ExecutingObject.EmbeddedVideo.Time
PositionRead only
Current Video Frame Position
Example
Position = Space.Host.ExecutingObject.EmbeddedVideo.Position
UniqueNameRead only
Example
UniqueName = Space.Host.ExecutingObject.EmbeddedVideo.UniqueName
VideoLengthRead only
Get the length of the video
Example
VideoLength = Space.Host.ExecutingObject.EmbeddedVideo.VideoLength
Loop
Whether video is set to loop or not
Example
Space.Host.ExecutingObject.EmbeddedVideo.Loop = true
FrameCountRead only
Returns the frame count of the video
Example
FrameCount = Space.Host.ExecutingObject.EmbeddedVideo.FrameCount
IsPlayingRead only
Returns whether the video is playing or not
Example
IsPlaying = Space.Host.ExecutingObject.EmbeddedVideo.IsPlaying
GameObjectRead only
Example
theGameObject = Space.Host.ExecutingObject.EmbeddedVideo.GameObject



