コード例 #1
0
ファイル: VideoViewTest.cs プロジェクト: wonrst/TizenFX
        public void NUIVideoViewTest()
        {
            videoView                        = new VideoView();
            videoView.ResourceUrl            = resourcePath;
            videoView.Looping                = true;
            videoView.Size                   = new Size(300, 300);
            videoView.PositionUsesPivotPoint = true;
            videoView.ParentOrigin           = ParentOrigin.Center;
            videoView.PivotPoint             = PivotPoint.Center;
            win.Add(videoView);

            try
            {
                var playerHandle = videoView.NativeHandle;
                player = new myPlayer(playerHandle.DangerousGetHandle());
            }
            catch (Exception e)
            {
                if (e is global::System.ArgumentException)
                {
                    Tizen.Log.Fatal("NUI", $"[ERROR] could not get NativePlayerHandle!");
                }
            }
            if (player != null)
            {
                player.Start();
            }
        }
コード例 #2
0
        public void NUIVideoViewTest()
        {
            videoView                        = new VideoView();
            videoView.ResourceUrl            = resourcePath;
            videoView.Looping                = true;
            videoView.Size                   = new Size(300, 300);
            videoView.PositionUsesPivotPoint = true;
            videoView.ParentOrigin           = ParentOrigin.Center;
            videoView.PivotPoint             = PivotPoint.Center;
            win.Add(videoView);

            var playerHandle = new SafeNativePlayerHandle(videoView);

            player = new myPlayer(playerHandle.DangerousGetHandle());
            if (player != null)
            {
                player.Start();
            }
        }
コード例 #3
0
 private void Win_TouchEvent(object sender, Window.TouchEventArgs e)
 {
     if (e.Touch.GetState(0) == PointStateType.Down)
     {
         if (++cnt % 2 == 1)
         {
             if (player != null)
             {
                 player.Pause();
                 tlog.Fatal(tag, $"player pause!");
             }
         }
         else
         {
             if (player != null)
             {
                 player.Start();
                 tlog.Fatal(tag, $"player start!");
             }
         }
     }
 }
コード例 #4
0
        public async void PlayerTest()
        {
            player = new myPlayer();

            player.SetSource(new Tizen.Multimedia.MediaUriSource(resourcePath));

            player.Display = new Tizen.Multimedia.Display(win);

            await player.PrepareAsync();

            tlog.Fatal(tag, $"await player.PrepareAsync();");

            player.Start();
            tlog.Fatal(tag, $"player.Start();");

            if (player.DisplaySettings.IsVisible == false)
            {
                player.DisplaySettings.IsVisible = true;
            }
            tlog.Fatal(tag, $"Display visible = {player.DisplaySettings.IsVisible}");

            player.DisplaySettings.Mode = Tizen.Multimedia.PlayerDisplayMode.FullScreen;
        }