예제 #1
0
        public void PlayVideoWithStartUrlAndPos(CustomController.VideoCtrl videoCtrl, FairyGUI.FillType fillType, UniRx.IObservable <Tuple <string, float> > videoPathAndStartPos, bool isFullView = false, bool autoVisible = true)
        {
            var g   = gObject;
            var sub = videoPathAndStartPos.Subscribe((t) =>
            {
                if (videoCtrl.IsInited && videoCtrl.LastUrl == t.Item1)
                {
                    Debug.Log("$$ change second");
                    videoCtrl.SetSeconds(t.Item2);
                }
                if (videoCtrl.IsInited && videoCtrl.LastUrl != t.Item1)
                {
                    Debug.Log("$$ change url old:" + videoCtrl.LastUrl + " new:" + t.Item1);
                    videoCtrl.Rewind(true);
                    videoCtrl.PlayVideoWithStartPos(t.Item1, t.Item2, autoVisible);
                }
                else if (!videoCtrl.IsInited)
                {
                    Debug.Log("$$ init player");
                    videoCtrl.Init(g, fillType, isFullView);
                    videoCtrl.PlayVideoWithStartPos(t.Item1, t.Item2, autoVisible);
                }
            });

            uiBase.AddDisposable(sub);
        }
예제 #2
0
        //TODO 设置进度 秒数
        public void Seconds(CustomController.VideoCtrl videoCtrl, UniRx.IObservable <float> seconds)
        {
            var g   = gObject;
            var sub = seconds.Subscribe((s) =>
            {
                videoCtrl.SetSeconds(s);
            });

            uiBase.AddDisposable(sub);
        }