public override void RenderMedia() { // Configure an event for the end of a file // _videoPlayer.VideoEnd += new VideoPlayer.VideoEnd(_videoPlayer_FileEnd); // Use an event for the end of the playlist //_videoPlayer.PlaylistEnd += new VideoPlayer.PlaylistEnd(_videoPlayer_VideoEnd); // Render media as normal (starts the timer, shows the form, etc) base.RenderMedia(); try { // Start Player //_videoPlayer.StartPlayer(); // Show the player _videoPlayer.Show(); Trace.WriteLine(new LogMessage("Video - RenderMedia", "Video Started"), LogType.Audit.ToString()); } catch (Exception ex) { Trace.WriteLine(new LogMessage("Video - RenderMedia", ex.Message), LogType.Error.ToString()); // Unable to start video - expire this media immediately throw; } }
public override void RenderMedia() { // Check to see if the video exists or not (if it doesnt say we are already expired) if (!File.Exists(_filePath)) { Trace.WriteLine(new LogMessage("Video - RenderMedia", "Local Video file " + _filePath + " not found.")); throw new FileNotFoundException(); } // Do we need to determine the end time ourselves? if (_duration == 0) { // Use an event for this. _videoPlayer.VideoEnd += new VideoPlayer.VideoFinished(_videoPlayer_VideoEnd); // Set the duration to 1 second Duration = 1; _detectEnd = true; } // Render media as normal (starts the timer, shows the form, etc) base.RenderMedia(); try { // Start Player _videoPlayer.StartPlayer(_filePath); // Show the player _videoPlayer.Show(); Trace.WriteLine(new LogMessage("Video - RenderMedia", "Video Started"), LogType.Audit.ToString()); } catch (Exception ex) { Trace.WriteLine(new LogMessage("Video - RenderMedia", ex.Message), LogType.Error.ToString()); // Unable to start video - expire this media immediately throw; } }