private void MediaPlayer_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { var errSource = e.pMediaObject as IWMPMedia2; if (errSource != null) { var errorItem = errSource.Error; MessageBox.Show("Error #" + errorItem.errorCode.ToString("X") + " in " + errSource.sourceURL); } }
/// <summary> /// event handler to display any errors encountered by the player /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Player_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { //if media error is called, check and notify user if file is missing or corrupt try { IWMPMedia2 errSource = e.pMediaObject as IWMPMedia2; IWMPErrorItem errorItem = errSource.Error; MessageBox.Show("Error " + errorItem.errorCode.ToString("X") + " in " + errSource.sourceURL); } catch (InvalidCastException ex) { MessageBox.Show("Error received:" + ex.Message); } }
private void preview_process_WMP_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { try { IWMPMedia2 errSrc = e.pMediaObject as IWMPMedia2; IWMPErrorItem errItem = errSrc.Error; MessageBox.Show("Error " + errItem.errorCode.ToString("X") + " in " + errSrc.sourceURL); } catch (InvalidCastException) { } }
private void mediaPlayer_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { try // If the Player encounters a corrupt or missing file, // show the hexadecimal error code and URL. { IWMPMedia2 errSource = e.pMediaObject as IWMPMedia2; IWMPErrorItem errorItem = errSource.Error; MessageBox.Show(errorItem.errorDescription + " - " + errSource.sourceURL); } catch (InvalidCastException) // In case pMediaObject is not an IWMPMedia item. { MessageBox.Show("Error."); } }
private void axWindowsMediaPlayer1_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { /*try * // If the Player encounters a corrupt or missing file, * // show the hexadecimal error code and URL. * { * IWMPMedia2 errSource = e.pMediaObject as IWMPMedia2; * IWMPErrorItem errorItem = errSource.Error; * MessageBox.Show("Error " + errorItem.errorCode.ToString("X") + " in " + errSource.sourceURL); + } + catch (InvalidCastException) + // In case pMediaObject is not an IWMPMedia item. + { + MessageBox.Show("Error."); + } */ }
void axWindowsMediaPlayer1_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { try // If the Player encounters a corrupt or missing file, // show the hexadecimal error code and URL. { IWMPMedia2 errSource = e.pMediaObject as IWMPMedia2; IWMPErrorItem errorItem = errSource.Error; MessageBox.Show("Error " + errorItem.errorCode.ToString("X", CultureInfo.CurrentCulture) + " in " + errSource.sourceURL); } catch (InvalidCastException) // In case pMediaObject is not an IWMPMedia item. { MessageBox.Show("Error."); } }
private void wmpVideo_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { wmpVideo.close(); loadVideo(configMrw.folder_video); }
private void AxWindowsMediaPlayer1_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { Console.WriteLine("error"); }
private void MediaPlayer_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { MessageBox.Show("Cannot play media file."); }
private void AxWindowsMediaPlayer1_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { throw new NotImplementedException(); }
private void WMP_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { }
private void axWindowsMediaPlayer1_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { this.Close(); }
private void AxWindowsMediaPlayer1_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { }
private void wmp_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { GetNextPicture(); }
/// <summary> /// Function for handling error in media. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mediaPlayer_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { String currentFile = mediaPlayer.currentMedia.name; log.Error("error while playing file " + currentFile); }
void activeXMediaPlayer_MediaError(object sender, AxWMPLib._WMPOCXEvents_MediaErrorEvent e) { BorrarReproduccionActual(); terminoLaReproduccionActual(true); }