在winform里调用了AxMediaPlayer控件,希望在开始播放时自动全屏,停止后恢复到原来大小。
用fullscreen属性=true,却说是灾难性事故
在属性里设置全屏播放,第一次可以全屏,第二次按播放按钮时却不能自动全屏了。如何控制全屏播放呢,出血跪求!!!

解决方案 »

  1.   

    you have to watch the state changes (through the relevant event) and only change to full screen after the buffering is complete. 
      

  2.   

    只要在axMediaPlayer的属性栏里面将fullscreen设为true就可以了
      

  3.   

    在属性里设置全屏播放,第一次可以全屏,第二次按播放按钮时却不能自动全屏了?我这里测试是可以的。每次播放都是全屏。
    this.axWindowsMediaPlayer1.fullScreen = true;只有在播放开始以后才可以用。附:
    The fullScreen property gets or sets a value indicating whether video content is played in full-screen mode. Copy Code[Visual Basic]
    Public Overridable Property fullScreen As Boolean[C#]
    public virtual bool fullScreen {get; set;}
    Property ValueA System.Boolean value that indicates whether content is played in full-screen mode. The default value is false.ResFor full-screen mode to work properly when embedding the Windows Media Player control, the video display area must have a height and width of at least one pixel. If uiMode is set to "mini" or "full", the height of the control itself must be 65 or greater to accommodate the video display area in addition to the user interface.If uiMode is set to "invisible", then setting this property to true raises an error and does not affect the behavior of the control.During full-screen playback, Windows Media Player hides the mouse cursor when enableContextMenu equals false and uiMode equals "none".If uiMode is set to "full" or "mini", Windows Media Player displays transport controls in full-screen mode when the mouse cursor moves. After a brief interval of no mouse movement, the transport controls are hidden. If uiMode is set to "none", no controls are displayed in full-screen mode. Note   Displaying transport controls in full-screen mode requires the Windows XP operating system.If transport controls are not displayed in full-screen mode, then Windows Media Player automatically exits full-screen mode when playback stops.
      

  4.   

    如果是直接用手工填写代码,在初始化的时候axMediaPlayer没有默认的播放列表自然会出错的。直接属性栏中设置播放完毕后也会自动恢复原始大小。
      

  5.   

    可以在后期作调整,在media player控件的StatusChange事件中去处理
    例如:
    if( yourPlayer.status == "Playing" )
    yourPlayer.fullScreen = true;
      

  6.   

    代码贴出来,急用,哥们给个代码先!(渔翁的法子试了不行,郁闷)属性窗口里设置了全屏播放为truemp是控件名称private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
    {
    mp.URL=@"C:\Documents and Settings\Administrator\桌面\1.avi";
    mp.Ctlcontrols.play();
    }private void cmdback_Click(object sender, System.EventArgs e)
    {
    mp.Ctlcontrols.stop();
    }第一次播放是能够全屏,播放完成后会恢复大小,正常的
    第二次播放时就不能自动全屏了,要双击才行,怎么回事?
      

  7.   

    to 代码贴出来,急用,哥们给个代码先!(渔翁的法子试了不行,郁闷)why?我试过了,没有问题,而且看你的程序也是winform。
    this.wmpPlay.StatusChange += new System.EventHandler(this.wmpPlay_StatusChange);
    private void wmpPlay_StatusChange(object sender, System.EventArgs e)
    {
    Debug.WriteLine( wmpPlay.status );
    if( wmpPlay.status == "Playing" )
    wmpPlay.fullScreen = true;
    }
      

  8.   

    Debug显示的是:正在连接...
    正在连接...
    正在播放
    正在播放
    已完成
    打开媒体
    已停止
      

  9.   

    if( mp.status == "正在播放" )
    mp.fullScreen = true;这样就可以了看来渔翁的法子是对的,多谢啦!!!可是为什么一定每次都要设置fullscreen属性呢?
      

  10.   

    to 可是为什么一定每次都要设置fullscreen属性呢?因为当停止后,fullscreen为false,所以需要重新设,这和你用播放播放影片是一样的。
      

  11.   

    最近CSDN很多窗口都不能打开,奇慢无比
    现在接贴窗口也半天了没打开大家是不是也一样啊???