Пример #1
0
        public void PlayTransitionVideo(Video transition)
        {
            var player = StaticControls.GetControlByName("MainVideoPlayer") as AxVLCPlugin2;

            if (player == null)
            {
                throw new NullReferenceException("MainVideoPlayer from static controls is null.");
            }
            player.playlist.add(transition.Path);
            player.playlist.play();
        }
Пример #2
0
 public override void Load()
 {
     Control = StaticControls.GetControlByName(ControlName);
     if (Control == null)
     {
         throw new FailedToInitializeException("Failed to retrieve static control.");
     }
     if (!Control.Created)
     {
         Control.CreateControl();
     }
     if (Content != null && Control is PictureBox pictureBoxControl)
     {
         Content.Load();
         pictureBoxControl.Image = Content.Data;
     }
 }
Пример #3
0
        // HIGH: Game state should not care about these, if a stage needs them, it will grab them and register as needed
        public void InitializeControls()
        {
            var player = StaticControls.GetControlByName("MainVideoPlayer") as AxVLCPlugin2;

            if (player == null)
            {
                throw new NullReferenceException("MainVideoPlayer from static controls is null.");
            }
            Window.AddControl(player); // NOTE: This sets the parent and must be called before creating the control
            player.CreateControl();    // TODO: This is a static object and should be initialized more reliably
            player.audio.mute             = true;
            player.Visible                = true;
            player.AutoPlay               = false;
            player.Toolbar                = false;
            player.MediaPlayerPlaying    += MainVideoPlayer_MediaPlayerPlaying;
            player.MediaPlayerEndReached += MainVideoPlayer_MediaPlayerEndReached;

            var scenebox         = StaticControls.GetControlByName("SceneBox");
            var topNavigation    = StaticControls.GetControlByName("TopNavigation");
            var leftNavigation   = StaticControls.GetControlByName("LeftNavigation");
            var rightNavigation  = StaticControls.GetControlByName("RightNavigation");
            var bottomNavigation = StaticControls.GetControlByName("BottomNavigation");

            topNavigation.Parent    = scenebox;
            leftNavigation.Parent   = scenebox;
            rightNavigation.Parent  = scenebox;
            bottomNavigation.Parent = scenebox;
            Window.AddControl(scenebox);
            Window.AddControl(topNavigation);
            Window.AddControl(leftNavigation);
            Window.AddControl(rightNavigation);
            Window.AddControl(bottomNavigation);
            ResizeControlToParent(player);
            ResizeControlToParent(scenebox);

            Window.Resize += WindowOnResize;

            foreach (var control in StaticControls.StoryNavigationControls)
            {
                control.Visible = false;
            }
        }
Пример #4
0
 private void WindowOnResize(object sender, EventArgs eventArgs)
 {
     ResizeControlToParent(StaticControls.GetControlByName("MainVideoPlayer"));
     ResizeControlToParent(StaticControls.GetControlByName("SceneBox"));
 }
Пример #5
0
 private static void MainVideoPlayer_MediaPlayerEndReached(object sender, EventArgs e)
 {
     StaticControls.GetControlByName("MainVideoPlayer").Visible = false;
     StaticControls.GetControlByName("SceneBox").Visible        = true;
 }