Breakroom is now Sinewave Campus. Book a meeting

SEmbeddedVideo

客户端组件
在此类中OnStateChange
  1. 函数
  2. OnStateChange
  3. Play
  4. Stop
  5. Pause
  6. Resume
  7. SynchorizeUrl
  8. ClearRenderTexture
  9. 属性
  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
成员 20
函数OnStateChange–
函数PlayIf URL is set, plays the video
函数StopStops the playback
函数PausePauses currently played video
函数ResumeIf the video is currently paused, it will resume playback
函数SynchorizeUrlSynchorize current video URL
函数ClearRenderTextureClears the Render Texture
属性StateThe state player is currently in.
属性URLCurrent URL set for this Player.
属性AudioSourceCurrent AudioSource
属性OutputTexture–
属性TextureTexture which the player uses to display the video.
属性TimeCurrent player time.
属性PositionCurrent Video Frame Position
属性UniqueName–
属性VideoLengthGet the length of the video
属性LoopWhether video is set to loop or not
属性FrameCountReturns the frame count of the video
属性IsPlayingReturns whether the video is playing or not
属性GameObject–

函数​

OnStateChange​

void OnStateChange(Closure e)

参数

名称类型默认值
eClosure–

返回值

void

示例

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

返回值

void

示例

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

Stop​

void Stop()

Stops the playback

返回值

void

示例

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

Pause​

void Pause()

Pauses currently played video

返回值

void

示例

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

Resume​

void Resume()

If the video is currently paused, it will resume playback

返回值

void

示例

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

SynchorizeUrl​

void SynchorizeUrl()

Synchorize current video URL

返回值

void

示例

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

ClearRenderTexture​

void ClearRenderTexture()

Clears the Render Texture

返回值

void

示例

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

属性​

State只读​

SEmbeddedVideoState State {get; }

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

示例

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

URL​

string URL {get; set; }

Current URL set for this Player.

示例

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

AudioSource​

SAudioSource AudioSource {get; set; }

Current AudioSource

示例

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

OutputTexture只读​

SResource OutputTexture {get; }

示例

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

Texture只读​

SResource Texture {get; }

Texture which the player uses to display the video.

示例

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.

示例

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

Position只读​

long Position {get; }

Current Video Frame Position

示例

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

UniqueName只读​

string UniqueName {get; }

示例

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

VideoLength只读​

double VideoLength {get; }

Get the length of the video

示例

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

Loop​

bool Loop {get; set; }

Whether video is set to loop or not

示例

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

FrameCount只读​

int FrameCount {get; }

Returns the frame count of the video

示例

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

IsPlaying只读​

bool IsPlaying {get; }

Returns whether the video is playing or not

示例

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

GameObject只读​

SGameObject GameObject {get; }

示例

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