Esempio n. 1
0
        public static bool InitializeVideoPlayerAndContainer(string fileName, VideoInfo videoInfo, VideoPlayerContainer videoPlayerContainer, EventHandler onVideoLoaded, EventHandler onVideoEnded)
        {
            try
            {
                videoPlayerContainer.VideoPlayer = GetVideoPlayer();
                videoPlayerContainer.VideoPlayer.Initialize(videoPlayerContainer.PanelPlayer, fileName, onVideoLoaded, onVideoEnded);
                videoPlayerContainer.ShowStopButton       = Configuration.Settings.General.VideoPlayerShowStopButton;
                videoPlayerContainer.ShowFullscreenButton = false;
                videoPlayerContainer.ShowMuteButton       = Configuration.Settings.General.VideoPlayerShowMuteButton;
                videoPlayerContainer.Volume = Configuration.Settings.General.VideoPlayerDefaultVolume;
                videoPlayerContainer.EnableMouseWheelStep();
                if (fileName != null && (fileName.StartsWith("https://", StringComparison.OrdinalIgnoreCase) || fileName.StartsWith("http://", StringComparison.OrdinalIgnoreCase)))
                {
                    // we don't have videoInfo for streams...
                }
                else
                {
                    videoPlayerContainer.VideoWidth  = videoInfo.Width;
                    videoPlayerContainer.VideoHeight = videoInfo.Height;
                    videoPlayerContainer.VideoPlayer.Resize(videoPlayerContainer.PanelPlayer.Width, videoPlayerContainer.PanelPlayer.Height);
                }

                return(true);
            }
            catch (Exception exception)
            {
                videoPlayerContainer.VideoPlayer = null;
                var videoError = new VideoError();
                videoError.Initialize(fileName, exception);
                videoError.ShowDialog();
                SeLogger.Error(exception, "InitializeVideoPlayerAndContainer failed to load video player");
                return(false);
            }
        }
Esempio n. 2
0
 public static void InitializeVideoPlayerAndContainer(string fileName, VideoInfo videoInfo, VideoPlayerContainer videoPlayerContainer, EventHandler onVideoLoaded, EventHandler onVideoEnded)
 {
     try
     {
         videoPlayerContainer.VideoPlayer = GetVideoPlayer();
         videoPlayerContainer.VideoPlayer.Initialize(videoPlayerContainer.PanelPlayer, fileName, onVideoLoaded, onVideoEnded);
         videoPlayerContainer.ShowStopButton       = Configuration.Settings.General.VideoPlayerShowStopButton;
         videoPlayerContainer.ShowFullscreenButton = false;
         videoPlayerContainer.ShowMuteButton       = Configuration.Settings.General.VideoPlayerShowMuteButton;
         videoPlayerContainer.Volume = Configuration.Settings.General.VideoPlayerDefaultVolume;
         videoPlayerContainer.EnableMouseWheelStep();
         if (fileName != null && (fileName.StartsWith("https://") || fileName.StartsWith("http://")))
         {
             // we don't have videoInfo for streams...
         }
         else
         {
             videoPlayerContainer.VideoWidth  = videoInfo.Width;
             videoPlayerContainer.VideoHeight = videoInfo.Height;
             videoPlayerContainer.VideoPlayer.Resize(videoPlayerContainer.PanelPlayer.Width, videoPlayerContainer.PanelPlayer.Height);
         }
     }
     catch (Exception exception)
     {
         videoPlayerContainer.VideoPlayer = null;
         var videoError = new VideoError();
         videoError.Initialize(fileName, videoInfo, exception);
         videoError.ShowDialog();
     }
 }
 public static void InitializeVideoPlayerAndContainer(string fileName, VideoInfo videoInfo, VideoPlayerContainer videoPlayerContainer, EventHandler onVideoLoaded, EventHandler onVideoEnded)
 {
     try
     {
         videoPlayerContainer.VideoPlayer = GetVideoPlayer();
         videoPlayerContainer.VideoPlayer.Initialize(videoPlayerContainer.PanelPlayer, fileName, onVideoLoaded, onVideoEnded);
         videoPlayerContainer.ShowStopButton = Configuration.Settings.General.VideoPlayerShowStopButton;
         videoPlayerContainer.ShowFullscreenButton = false;
         videoPlayerContainer.ShowMuteButton = Configuration.Settings.General.VideoPlayerShowMuteButton;
         videoPlayerContainer.Volume = Configuration.Settings.General.VideoPlayerDefaultVolume;
         videoPlayerContainer.EnableMouseWheelStep();
         videoPlayerContainer.VideoWidth = videoInfo.Width;
         videoPlayerContainer.VideoHeight = videoInfo.Height;
         videoPlayerContainer.VideoPlayer.Resize(videoPlayerContainer.PanelPlayer.Width, videoPlayerContainer.PanelPlayer.Height);
     }
     catch (Exception exception)
     {
         videoPlayerContainer.VideoPlayer = null;
         var videoError = new VideoError();
         videoError.Initialize(fileName, videoInfo, exception);
         videoError.ShowDialog();
     }
 }