示例#1
0
            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);
            }
示例#2
0
            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;
                        }
                    }
                }
            }
示例#3
0
        protected override void OnDeinit()
        {
            base.OnDeinit();

            MovieIOSModule.VideoPlayer_Finalize();
        }
示例#4
0
        protected override void OnInit()
        {
            base.OnInit();

            MovieIOSModule.VideoPlayer_Initialize(2);
        }
示例#5
0
 public void Play(bool loop, System.Action onComplete)
 {
     this.onComplete = onComplete;
     MovieIOSModule.VideoPlayer_Play(this.index, loop);
 }
示例#6
0
 public void Pause()
 {
     MovieIOSModule.VideoPlayer_Pause(this.index);
 }
示例#7
0
 public void Dispose()
 {
     MovieIOSModule.VideoPlayer_RemovePlayer(this.index);
 }
示例#8
0
 public Item(string path)
 {
     this.index  = MovieIOSModule.VideoPlayer_AddPlayer(path);
     this.failed = false;
     this.ready  = false;
 }