Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private void PlayVideoWithMpc(ScenePlayOptions scenePlayOptions)
{
VideoPlayerProcess = new Process
{
StartInfo =
{
FileName = SettingsVm.Instance.MpcPath,
Arguments = "\"" + scenePlayOptions.SceneVm.Path + "\""
}
};
if (scenePlayOptions.Enqueued)
VideoPlayerProcess.StartInfo.Arguments += " /add";
else if (!Properties.Settings.Default.AllowOnlyOneInstance)
VideoPlayerProcess.StartInfo.Arguments += " /new";
if (Properties.Settings.Default.StartFullScreen)
VideoPlayerProcess.StartInfo.Arguments += " /fullscreen";
if (scenePlayOptions.StartTime > 0)
VideoPlayerProcess.StartInfo.Arguments += " /play /start " + Convert.ToInt32(scenePlayOptions.StartTime);
VideoPlayerProcess.Start();
VideoPlayerProcess.WaitForInputIdle();
SetForegroundWindow(new WindowInteropHelper(Application.Current.MainWindow).Handle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.