SEmbeddedVideo
| 函数 | OnStateChange | – |
| 函数 | Play | If URL is set, plays the video |
| 函数 | Stop | Stops the playback |
| 函数 | Pause | Pauses currently played video |
| 函数 | Resume | If the video is currently paused, it will resume playback |
| 函数 | SynchorizeUrl | Synchorize current video URL |
| 函数 | ClearRenderTexture | Clears the Render Texture |
| 属性 | State | The state player is currently in. |
| 属性 | URL | Current URL set for this Player. |
| 属性 | AudioSource | Current AudioSource |
| 属性 | OutputTexture | – |
| 属性 | Texture | Texture which the player uses to display the video. |
| 属性 | Time | Current player time. |
| 属性 | Position | Current Video Frame Position |
| 属性 | UniqueName | – |
| 属性 | VideoLength | Get the length of the video |
| 属性 | Loop | Whether video is set to loop or not |
| 属性 | FrameCount | Returns the frame count of the video |
| 属性 | IsPlaying | Returns whether the video is playing or not |
| 属性 | GameObject | – |
函数
OnStateChange
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| e | Closure | – |
返回值
void
示例
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
返回值
void
示例
Space.Host.ExecutingObject.EmbeddedVideo.Play()
Stop
Stops the playback
返回值
void
示例
Space.Host.ExecutingObject.EmbeddedVideo.Stop()
Pause
Pauses currently played video
返回值
void
示例
Space.Host.ExecutingObject.EmbeddedVideo.Pause()
Resume
If the video is currently paused, it will resume playback
返回值
void
示例
Space.Host.ExecutingObject.EmbeddedVideo.Resume()
SynchorizeUrl
Synchorize current video URL
返回值
void
示例
Space.Host.ExecutingObject.EmbeddedVideo.SynchorizeUrl()
ClearRenderTexture
Clears the Render Texture
返回值
void
示例
Space.Host.ExecutingObject.EmbeddedVideo.ClearRenderTexture()
属性
State只读
The state player is currently in. You can track state changes through StateChangeEvent.
示例
CurrentVideoState = Space.Host.ExecutingObject.EmbeddedVideo.State
URL
Current URL set for this Player.
示例
CurrentURL = Space.Host.ExecutingObject.EmbeddedVideo.URL
AudioSource
Current AudioSource
示例
CurrentAudioSource = Space.Host.ExecutingObject.EmbeddedVideo.AudioSource
OutputTexture只读
示例
OutputTexture = Space.Host.ExecutingObject.EmbeddedVideo.OutputTexture
Texture只读
Texture which the player uses to display the video.
示例
Texture = Space.Host.ExecutingObject.EmbeddedVideo.Texture
Time
Current player time. Can be set to move the 'playhead' to the specific position.
示例
Time = Space.Host.ExecutingObject.EmbeddedVideo.Time
Position只读
Current Video Frame Position
示例
Position = Space.Host.ExecutingObject.EmbeddedVideo.Position
UniqueName只读
示例
UniqueName = Space.Host.ExecutingObject.EmbeddedVideo.UniqueName
VideoLength只读
Get the length of the video
示例
VideoLength = Space.Host.ExecutingObject.EmbeddedVideo.VideoLength
Loop
Whether video is set to loop or not
示例
Space.Host.ExecutingObject.EmbeddedVideo.Loop = true
FrameCount只读
Returns the frame count of the video
示例
FrameCount = Space.Host.ExecutingObject.EmbeddedVideo.FrameCount
IsPlaying只读
Returns whether the video is playing or not
示例
IsPlaying = Space.Host.ExecutingObject.EmbeddedVideo.IsPlaying
GameObject只读
示例
theGameObject = Space.Host.ExecutingObject.EmbeddedVideo.GameObject



