The Windows Media Player control cannot be fullscreen the second time it is played

Source: Internet
Author: User

Create a new MFC project, insert Windows Media Player control, and set the URL parameter to True for the property set fullscreen.

Add the Cwmpplayer4,cwmpcontrols3 class.
The control binds the associated variable CWMPPlayer4 m_player and sets CWMPControls3 M_control = M_player.get_controls (), in response to the Playstatechange message in order to achieve the loop playback, The message processing function is the following two sentences: M_control.play (); M_player.put_fullscreen (1); At this time debugging engineering, found that only the first full screen, the second after the full screen, M_player.put_fullscreen ( 1) This sentence does not work at all. Online basically is to put this sentence with MoveWindow () or SetWindowPos () instead, but the first interface does not have the original full-screen look good, and there will be a screen flash, especially when placed on the tablet to use. The root cause of not being able to fullscreen after the second time is because the control has finished playing the URL's media for the first time, because the playlist has no subsequent content, only stop, when the M_player.play () Response stop state is treated as the second instance, Windows Media Player Unable to maintain two instances are fullscreen. We can add the following code in the Playstatechange response function to ensure that the first instance does not stop and that the second instance is not generated: if (newstate = = 8) {M_player.put_url (_t ("c:\\users\\ Administrator\\desktop\\test_tool\\video\\mid1080p.avi "));}

The Windows Media Player control cannot be fullscreen the second time it is played

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.