private void OnReady() { uint textureId = MovieIOSModule.VideoPlayer_GetTextureId(this.index); uint width, height; MovieIOSModule.VideoPlayer_GetVideoSize(this.index, out width, out height); this.texture = Texture2D.CreateExternalTexture((int)width, (int)height, TextureFormat.BGRA32, false, false, (System.IntPtr)textureId); }
public void Update() { if (this.failed == true) { return; } if (this.ready == false) { this.failed = MovieIOSModule.VideoPlayer_IsPlayerFailed(this.index); if (this.failed == true) { return; } this.ready = MovieIOSModule.VideoPlayer_IsPlayerReady(this.index); if (this.ready == true) { this.OnReady(); } } else { bool complete; MovieIOSModule.VideoPlayer_Update(this.index, out complete); if (complete == true) { if (this.onComplete != null) { this.onComplete.Invoke(); this.onComplete = null; } } } }
protected override void OnDeinit() { base.OnDeinit(); MovieIOSModule.VideoPlayer_Finalize(); }
protected override void OnInit() { base.OnInit(); MovieIOSModule.VideoPlayer_Initialize(2); }
public void Play(bool loop, System.Action onComplete) { this.onComplete = onComplete; MovieIOSModule.VideoPlayer_Play(this.index, loop); }
public void Pause() { MovieIOSModule.VideoPlayer_Pause(this.index); }
public void Dispose() { MovieIOSModule.VideoPlayer_RemovePlayer(this.index); }
public Item(string path) { this.index = MovieIOSModule.VideoPlayer_AddPlayer(path); this.failed = false; this.ready = false; }