Summary
When the Setup program starts to run, let the video play in full-screen, directly set
true;
Will error, the code is as follows
Windowsmediaplay.url = _videopath; WindowsMediaPlay.Ctlcontrols.play (); true ; + = windowsmediaplay_clickevent ; + = windowsmediaplay_keyupevent ; + = Windowsmediaplay_statuschange;
Error
Embrace the belief that Microsoft's mood, in the conjecture, may be the wrong position, is it necessary to video in the playback can be set to full screen?
So in the event of a video state change, this setting
voidWindowsmediaplay_statuschange (Objectsender, EventArgs e) { /** 0 Undefined Windows Media Player is a Undefined state. (undefined) 1 Stopped Playback of the current media item is Stopped. (stop) 2 Paused Playback of the current media item is Paused. When a media item is paused, resuming
Playback begins from the same location. (stay) 3 Playing The current media item is Playing. (played) 4 Scanforward the current media item is fast forwarding. 5 Scanreverse The current media item is fast rewinding. 6 buffering The current media item was getting additional data from the server. (conversion) 7 waiting Connection is established, and the server is not sending data. Waiting for session to begin. (pause) 8 mediaended Media item has completed playback. (end of playback) 9 transitioning Preparing New media item. Ten ready to begin playing. (ready) reconnecting reconnecting to stream. (reconnect)*/ //determine if the video has stopped playing if((int) Windowsmediaplay.playstate = =1) { //pause for 2 seconds and replay againSystem.Threading.Thread.Sleep ( +); //re-playWindowsMediaPlay.Ctlcontrols.play (); } Else if((int) Windowsmediaplay.playstate = =3) {Windowsmediaplay.fullscreen=true; } }
Test, solve the problem.
[Winform] Settings for full-screen playback of Media player components