private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsMediaEnded) { aTimer = new Timer(); aTimer.Interval = 10; aTimer.Enabled = true; lectureFonction(); } }
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsMediaEnded) { // if (axWindowsMediaPlayer1.Ctlcontrols.currentPosition == axWindowsMediaPlayer1.currentMedia.duration) // { MessageBox.Show("Play Ended"); // } } }
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (e.newState == 1) { //MessageBox.Show(""); axWindowsMediaPlayer1.Ctlcontrols.currentPosition = axWindowsMediaPlayer1.currentMedia.duration - 0.1; axWindowsMediaPlayer1.Ctlcontrols.play(); axWindowsMediaPlayer1.Ctlcontrols.pause(); } }
private void axWindowsMediaPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (((WMPLib.WMPPlayState)e.newState == WMPLib.WMPPlayState.wmppsMediaEnded)) // Supposed to interpret when the JukeBox is no longer playing its current song. If this is the case, it empties 'currently playing' and allows the next song to be played. { textBox_Now_Playing.Text = ""; timer_Move_to_Playing.Enabled = true; timer_Move_to_Playing.Start(); timer_Move_to_Playing.Tick += timer_Move_to_Playing_Tick; // This code should determine when the current song has finished, then call the originl timer for moving songs to 'now playing'. } }
private void targetVideo_PlayStateChange_1(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (e.newState != 1) { return; } targetVideo.Ctlcontrols.currentPosition = targetVideo.currentMedia.duration;//- .001; targetVideo.Ctlcontrols.play(); targetVideo.Ctlcontrols.pause(); }
/// <summary> /// This handles Play states for loging. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mediaPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { String currentFile; if (mediaPlayer.playState == WMPPlayState.wmppsMediaEnded) { currentFile = mediaPlayer.currentMedia.name; log.Info("ended playing " + currentFile); } }
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsStopped) { MessageBox.Show("File ended!"); axWindowsMediaPlayer1.Ctlcontrols.play(); } Font = new Font("Times", 12, FontStyle.Bold | FontStyle.Italic); }
/// <summary> /// get the state of the song /// </summary> private void Juke_box_MediaPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (Juke_box_MediaPlayer.playState == WMPPlayState.wmppsStopped) { // No song playing playing_song = false; // Timer event will run timer_player.Enabled = true; } }
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsMediaEnded) { timer1.Interval = 100; timer1.Enabled = true; played[listBox1.SelectedIndex] = true; last = listBox1.SelectedIndex; } }
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsStopped) { if (m) { ExitWindowsEx(0, 0); } } }
private void axWindowsPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (e.newState == (int)WMPLib.WMPPlayState.wmppsPlaying) { if (this.axWindowsPlayer.currentMedia != null) { this.txtNow.Text = (this.axWindowsPlayer.currentMedia.name); } } }
private void mediaPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { //The other possible states are defined here: //https://msdn.microsoft.com/en-us/library/windows/desktop/dd562460(v=vs.85).aspx if (e.newState == 1) { LoadNextImage(1); } }
private void wmpDuck_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { //Util.MensajeInformacion("wmpDuck_PlayStateChange " + e.newState, ""); switch (e.newState) { case 8: // MediaEnded this.Close(); break; } }
//Go on when intro video stopped private void player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { // 8 = Media Ended if (e.newState == 8 || e.newState == 1) { pnlIntroVideo.Hide(); ///show hint lbAanwijzing1 and question1 pnlIntroductie.Show(); } }
void axWMP_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (e.newState == 8) { // indicate we are stopped _finished = true; VideoEnd(); } }
private void myPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (e.newState == 3) { double dur = Controller.currentMedia.duration; MusicBar.Maximum = (int)dur; } }
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (axWindowsMediaPlayer1.playState.Equals(WMPLib.WMPPlayState.wmppsMediaEnded)) { axWindowsMediaPlayer1.close(); axWindowsMediaPlayer1.Visible = false; game = new Game(this); // zaczyna grę this.Focus(); } }
//自动播放,循环播放,自动启动 private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { //当前播放器的播放状态发生改变的是偶,判断当前音乐播放器的播放状态是否到达了Ended, 如果是则进行下一曲 if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsMediaEnded) { if (listBox1.SelectedIndex < 0) { MessageBox.Show("请选择歌曲", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } int a = tabControl1.SelectedIndex; if (a == 0) { int index = listBox1.SelectedIndex; //获得当前选中歌曲的索引 index++; if (comboBox1.Text == "单曲循环") { axWindowsMediaPlayer1.settings.setMode("loop", true); axWindowsMediaPlayer1.URL = listsongs[listBox1.SelectedItem.ToString()]; return; } else if (comboBox1.Text == "顺序播放") { if (index == listBox1.Items.Count) { index = 0; } listBox1.SelectedIndex = index; //将改变后的索引重新赋值给我当前选中项的索引 label2.Text = listBox1.SelectedItem.ToString(); axWindowsMediaPlayer1.URL = listsongs[listBox1.SelectedItem.ToString()]; return; } if (index == listBox1.Items.Count) { index = 0; } listBox1.SelectedIndex = index; //将改变后的索引重新赋值给我当前选中项的索引 label2.Text = listBox1.SelectedItem.ToString(); axWindowsMediaPlayer1.URL = listsongs[listBox1.SelectedItem.ToString()]; } } else if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsReady) //播放器准备就绪后播放 { //捕获异常 并忽略异常 try { axWindowsMediaPlayer1.Ctlcontrols.play(); } catch (Exception) { } } }
/// <summary> /// player state be changed will affect the timer which is for storing data in hardware /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (player.playState == WMPLib.WMPPlayState.wmppsMediaEnded) { //get the listbox seleceted int index = listBox1.SelectedIndex; //clean the all selected listBox1.SelectedIndices.Clear(); index++; if (index == listBox1.Items.Count) { index = 0; } //change the index listBox1.SelectedIndex = index; //assign it to currentname currentname = Path.GetFileName(listPath[listBox1.SelectedIndex]); //string[] processPosition = File.ReadAllLines(process,Encoding.Default); //if(processPosition.Length > 0) // listProcess = processPosition.ToList(); //asign to URL action must be before to asign the currentposition,otherwise the breakpoint will be not working //because each time the URL setting will reset all the data feild of the player. player.URL = listPath[index]; foreach (var item in listProcess) { string[] strnew = item.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries); if (strnew[0].Equals(currentname)) { //player.Ctlcontrols.currentPosition = Double.Parse(strnew[1]); //currentname = strnew[0]; changeTime(Double.Parse(strnew[1])); listProcess.Remove(item); break; } } } if (player.playState == WMPLib.WMPPlayState.wmppsReady) { try { player.Ctlcontrols.play(); } catch { } } if (player.playState == WMPLib.WMPPlayState.wmppsPlaying) { timer1.Enabled = true; } if (player.playState == WMPLib.WMPPlayState.wmppsStopped) { timer1.Enabled = false; } }
private void WMPMain_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (WMPMain.playState == WMPPlayState.wmppsPlaying || WMPMain.playState == WMPPlayState.wmppsPaused) { timer1.Start(); } else { timer1.Stop(); } }
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (!IsPlaying) { IsPlaying = true; } else { IsPlaying = false; } }
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { Console.WriteLine(e); //on event E being 1 (event one being the end of the video, exit the form) if (e.newState == 1) { Console.WriteLine("end of video"); System.Windows.Forms.Application.ExitThread(); this.Close(); } }
// player.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(player_PlayStateChange); private void WR_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { //WR.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(WR_PlayStateChange); if (e.newState == 8) { termino = true; // WR.URL = (); // WR.Ctlcontrols.play(); } }
/// <summary> /// 设置为加载后播放自动开始 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mediaPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (mediaPlayer.status == "准备就绪") { mediaPlayer.Ctlcontrols.play(); } if (mediaPlayer.status.Contains("正在播放")) { playList.SelectedItem = mediaPlayer.currentMedia.name; } }
private void player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { WMPLib.WMPPlayState state = (WMPLib.WMPPlayState)e.newState; Debug.WriteLine("Play state:" + state); switch (state) { case WMPLib.WMPPlayState.wmppsBuffering: break; case WMPLib.WMPPlayState.wmppsLast: break; case WMPLib.WMPPlayState.wmppsMediaEnded: break; case WMPLib.WMPPlayState.wmppsPaused: break; case WMPLib.WMPPlayState.wmppsPlaying: musicTimer.Start(); break; case WMPLib.WMPPlayState.wmppsReady: break; case WMPLib.WMPPlayState.wmppsReconnecting: break; case WMPLib.WMPPlayState.wmppsScanForward: break; case WMPLib.WMPPlayState.wmppsScanReverse: break; case WMPLib.WMPPlayState.wmppsStopped: var playId = m_curPlayId; m_curPlayId = 0; musicTimer.Stop(); tryPostPlayState(MusicPlayState.Stop, playId); //停止 break; case WMPLib.WMPPlayState.wmppsTransitioning: break; case WMPLib.WMPPlayState.wmppsUndefined: break; case WMPLib.WMPPlayState.wmppsWaiting: break; default: break; } }
void Player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if ((WMPLib.WMPPlayState)e.newState == WMPLib.WMPPlayState.wmppsMediaEnded) { _timer.Start(); } else if ((WMPLib.WMPPlayState)e.newState == WMPLib.WMPPlayState.wmppsReady) { Player.Ctlcontrols.play(); } }
//event pu to xrisimopoiw gia na paizei apeythias(xwris na pathsw play)to epomeno tragudi private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { //an ftasei sto telos tu tragudiu if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsMediaEnded) { if (checkBox1.Checked) { //to Next mu vgazei enan tyxaio akeraio int next = r.Next(random.Count); p = random[next]; axWindowsMediaPlayer1.URL = p; song = true; } //h periptwsh opu den exume tyxaia anaparagwgh,kai me ayton ton tropo paizei synexomena to ena tragudi meta to allo if (!checkBox1.Checked) { if (rand == 1) { axWindowsMediaPlayer1.URL = "Kaleo - No Good.mp3"; rand = 2; } else if (rand == 2) { axWindowsMediaPlayer1.URL = "Kaleo - Way Down We Go.mp3"; rand = 3; } else if (rand == 3) { axWindowsMediaPlayer1.URL = "Taylor Swift - Look What You Made Me Do.mp3"; rand = 4; } else if (rand == 4) { axWindowsMediaPlayer1.URL = "twenty one pilots- Stressed Out.mp3";; rand = 4; } else { axWindowsMediaPlayer1.URL = "Imagine Dragons - Believer.mp3"; rand = 1; } song = true; } } if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsReady) { //an to allo tragudi einai true!diladi einai etoimo na paiksei tote paiksto if (song) { axWindowsMediaPlayer1.Ctlcontrols.play(); song = false; } } }
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsStopped) { foreach (DataGridViewRow row in dataGridView1.Rows) { row.Cells[5].Value = "▶"; row.Cells[5].Tag = true; } } }
/// <summary> /// 播放状态改变事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { //正在播放 if (Player.status.Contains("正在播放")) { DownAdVolume(); this.Hide(); } //播放已完成 else if (Player.status.Contains("已完成")) { UpAdVolume(); } //播放停止 else if (Player.status.Contains("停止")) { //获取音频时长 向上取整 int duration = (int)Math.Ceiling(Player.currentMedia.duration); //休眠 播放间隔-音频时长 int sleep = Convert.ToInt32((interval * 60 - duration) * 1000); System.Threading.Thread.Sleep(sleep); //重新播放时判断广告程序是否已经启动 bool flag = false; while (!flag) { flag = isStartAd(); if (flag) { //获取播放时间间隔 IsDurationSetInterval(); //播放计数 ++i; //记录播放日志 WriteLog.WritePlayLogToFile(string.Format("计算机【{0}】主题【{1}】播放第【{2}】次,【{3}】", System.Environment.MachineName, recordTitle, i, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")), true); //重新播放 Player.Ctlcontrols.play(); } else { System.Threading.Thread.Sleep(10000); } } } }
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsPlaying) { btn_preview.BackgroundImage = Resources.play_button_up_playing; } else { btn_preview.BackgroundImage = Resources.play_button_up; } }