private void MediaPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { var state = (WMPLib.WMPPlayState)e.newState; if (state == WMPLib.WMPPlayState.wmppsPlaying) // = 3 { if (CurMode == VidkaPreviewPlayerMode.StillFrame) { Ctlcontrols2.pause(); Ctlcontrols2.currentPosition = stillPositionSec; Ctlcontrols2.step(1); CurMode = VidkaPreviewPlayerMode.None; } else if (CurMode == VidkaPreviewPlayerMode.SequentialPlayback) { if (Ctlcontrols2.currentPosition >= curClipSecEnd) { Ctlcontrols2.pause(); CurMode = VidkaPreviewPlayerMode.None; } } } //VideoShitbox.ConsoleSingleton.cxzxc("newState:" + e.newState); //if ((WMPLib.WMPPlayState)e.newState == WMPLib.WMPPlayState.wmppsStopped) //{ // MessageBox.Show("WMPLib.WMPPlayState.wmppsStopped"); //} }
public void PlayVideoClip(string filename, double clipSecStart, double clipSecEnd) { Ctlcontrols2.pause(); CurMode = VidkaPreviewPlayerMode.SequentialPlayback; curClipSecEnd = clipSecEnd; MediaPlayer.URL = null; MediaPlayer.URL = curUrl = filename; Ctlcontrols2.currentPosition = clipSecStart; Ctlcontrols2.play(); }
public VidkaPreviewPlayer() { InitializeComponent(); MediaPlayer.PlayStateChange += MediaPlayer_PlayStateChange; MediaPlayer.MediaError += MediaPlayer_MediaError; MediaPlayer.uiMode = "none"; //MediaPlayer.settings.autoStart = false; Ctlcontrols2 = (IWMPControls2)MediaPlayer.Ctlcontrols; CurMode = VidkaPreviewPlayerMode.None; }
public void PlayVideoClip(string filename, double clipSecStart, double clipSecEnd, bool mute) { previousOneWasInFullScreen = MediaPlayer.fullScreen; Ctlcontrols2.pause(); CurMode = VidkaPreviewPlayerMode.SequentialPlayback; curClipSecEnd = clipSecEnd; MediaPlayer.URL = null; MediaPlayer.URL = curUrl = filename; MediaPlayer.settings.mute = mute; Ctlcontrols2.currentPosition = clipSecStart; Ctlcontrols2.play(); }
public void SetStillFrame(string filename, double offsetSeconds) { // prepare the message CurMode = VidkaPreviewPlayerMode.StillFrame; stillPositionSec = offsetSeconds; if (curUrl == filename) { Ctlcontrols2.currentPosition = stillPositionSec; Ctlcontrols2.step(1); //jump to the next frame. This force the player to update frame. //MediaPlayer.Refresh(); } else { MediaPlayer.URL = curUrl = filename; MediaPlayer.Ctlcontrols.currentPosition = stillPositionSec - SHORTEST_TIME_TO_STOP; //VideoShitbox.ConsoleSingleton.cxzxc("newURL:" + curUrl); } }
public void StopWhateverYouArePlaying() { Ctlcontrols2.pause(); CurMode = VidkaPreviewPlayerMode.StillFrame; previousOneWasInFullScreen = false; }