[Winform] Settings for full-screen playback of Media player components

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.