Пример #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;
 }