private void SplashScreen_Load(object sender, EventArgs e) { timer1.Start(); PlayFile(@"D:\Logo.mp4"); } //Trying to add video. WMPLib.WindowsMediaPlayer Player; private void PlayFile(String url) { Player = new WMPLib.WindowsMediaPlayer(); Player.PlayStateChange += new WMPLib._WMPOCXEvents_PlayStateChangeEventHandler(Player_PlayStateChange); Player.MediaError += new WMPLib._WMPOCXEvents_MediaErrorEventHandler(Player_MediaError); Player.URL = url; Player.controls.play(); } private void Player_PlayStateChange(int NewState) { if ((WMPLib.WMPPlayState)NewState == WMPLib.WMPPlayState.wmppsStopped) { this.Close(); } } private void Player_MediaError(object pMediaObject) { MessageBox.Show("Cannot play media file."); this.Close(); }
PlayFile
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)