public string InitialisePlayers(VideoDisplay _videoDisplay1, VideoDisplay _videoDisplay2, string path) { videoDisplay = _videoDisplay1; videoDisplay2 = _videoDisplay2; videoDisplay.Height = resolutionHight; videoDisplay2.Height = resolutionHight; videoDisplay.Width = screens * resolutionWidth; videoDisplay2.Width = 0; videoDisplay2.StartPosition = FormStartPosition.Manual; videoDisplay2.Location = videoPlayer2Location; videoDisplay.VideoDisplayInitialise(path); videoDisplay2.VideoDisplayInitialise(path); videoDisplay.MaximiseForm(); videoDisplay2.MaximiseForm(); videoDisplay.BringToFront(); videoDisplay2.BringToFront(); videoDisplay2.Show(); videoDisplay.Show(); JsonReturn = videoDisplay.getVideoLength(path); return JsonReturn; }
public string PerformVideoAction(VideoAction action, string message) { string JsonReturn = "failed at PVA"; if (txtServer.InvokeRequired) { return Invoke(videoFormActionDelegate, action, message).ToString(); } else { if (action == VideoAction.InitialisePlayers) { if (videoDisplay != null) { videoDisplay.Dispose(); videoDisplay2.Dispose(); videoDisplay = null; videoDisplay2 = null; } videoDisplay = new VideoDisplay(1, message); //expecting direction to reset to 0 if new one opened videoDisplay2 = new VideoDisplay(2, message); if (imageDisplay != null) { imageDisplay.Dispose(); imageDisplay2.Dispose(); imageDisplay = null; imageDisplay2 = null; } videoDisplay.Width = screens * resolutionWidth; videoDisplay2.Width = screens * resolutionWidth; videoDisplay.Height = resolutionHight; videoDisplay2.Height = resolutionHight; videoDisplay.StartPosition = FormStartPosition.Manual; videoDisplay.Location = new Point(0, 0); videoDisplay2.StartPosition = FormStartPosition.Manual; videoDisplay2.Location = new Point(0, 0); videoDisplay2.Show(); videoDisplay.Show(); JsonReturn = videoDisplay.getVideoLength(message); return JsonReturn; } else if (action == VideoAction.VideoPlayerControls) { JsonReturn = VideoPlayerControls(message); } else { JsonReturn = "video action failed"; } return JsonReturn; } }