/// <summary>
 /// Sets the fullscreen state of the current player (wmp/quicktime) in a threadsafe way, meaning you can call it from the GUI but also from one of the server threads even though the gui elements themselves may not be threadsafe
 /// Even if you know you're already likely to be in the right thread (eg youre handling a GUI event), you should still use this method as it will check which player to set the fullscreen property of for you.
 /// </summary>
 /// <param name="fullscreen">Whether the player should be fullscreen</param>
 private void setVideoFullscreen(bool fullscreen)
 {
     //quicktime player
     if (usingQuicktime)
     {
         if (quicktimePlayer.InvokeRequired)//wrong thread, send callback
         {
             setVideoFullscreenCallback d = new setVideoFullscreenCallback(setVideoFullscreen);
             quicktimePlayer.Invoke(d, new object[] { fullscreen });
         }
         else //right thread :-)
         {
             if (fullscreen) //we have to do some custom things for quicktime fullscreen to make it work properly, and also allow you to exit fullscreen (the esc key property doesnt always seem to work)
             {
                 this.quicktimePlayer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); //either the quicktime player or c# has a problem with anchoring in fullscreen, which means the video doesnt get stretched to the full size of the screen if anchored. So remove the custom anchors, and set them back when fullscreen is finished (rememeber to do this in the QTEvent for ending fullscreen)
                 quicktimePlayer.FullScreen  = fullscreen;
                 this.KeyDown += Publish_KeyDown;                                                                                                                       //add the listener to key events to end the fullscreen
                 quicktimePlayer.Focus();
             }
             else
             {
                 if (quicktimePlayer.Movie != null)
                 {
                     quicktimePlayer.FullScreen = fullscreen;
                     this.KeyDown -= Publish_KeyDown; //remove the key listener as we don't need it to exit fullscreen anymore and we dont want events triggered trying to exit fullscreen on every keypress when it's not fullscreen
                 }
                 else
                 {
                     if (fullscreen) //if trying to fullscreen when no movie is loaded...
                     {
                         MessageBox.Show("Start playing a movie before choosing fullscreen", "Start Movie");
                     }
                 }
             }
         }
     }
     else //wmp player
     {
         if (player.InvokeRequired) //wrong thread, send callback
         {
             setVideoFullscreenCallback d = new setVideoFullscreenCallback(setVideoFullscreen);
             player.Invoke(d, new object[] { fullscreen });
         }
         else //right thread :-)
         {
             if (fullscreen == true && (player.playState == WMPLib.WMPPlayState.wmppsStopped || player.URL == ""))
             {
                 MessageBox.Show("Start playing a movie before choosing fullscreen", "Start Movie");
             }
             else
             {
                 player.fullScreen = fullscreen;
             }
         }
     }
 }
 /// <summary>
 /// Sets the fullscreen state of the current player (wmp/quicktime) in a threadsafe way, meaning you can call it from the GUI but also from one of the server threads even though the gui elements themselves may not be threadsafe
 /// Even if you know you're already likely to be in the right thread (eg youre handling a GUI event), you should still use this method as it will check which player to set the fullscreen property of for you.
 /// </summary>
 /// <param name="fullscreen">Whether the player should be fullscreen</param>
 private void setVideoFullscreen(bool fullscreen)
 {
     //quicktime player
     if (usingQuicktime)
     {
         if (quicktimePlayer.InvokeRequired)//wrong thread, send callback
         {
             setVideoFullscreenCallback d = new setVideoFullscreenCallback(setVideoFullscreen);
             quicktimePlayer.Invoke(d, new object[] { fullscreen });
         }
         else //right thread :-)
         {
             if (fullscreen) //we have to do some custom things for quicktime fullscreen to make it work properly, and also allow you to exit fullscreen (the esc key property doesnt always seem to work)
             {
                 this.quicktimePlayer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); //either the quicktime player or c# has a problem with anchoring in fullscreen, which means the video doesnt get stretched to the full size of the screen if anchored. So remove the custom anchors, and set them back when fullscreen is finished (rememeber to do this in the QTEvent for ending fullscreen)
                 quicktimePlayer.FullScreen = fullscreen;
                 this.KeyDown += Publish_KeyDown; //add the listener to key events to end the fullscreen
                 quicktimePlayer.Focus();
             }
             else
             {
                 if (quicktimePlayer.Movie != null)
                 {
                     quicktimePlayer.FullScreen = fullscreen;
                     this.KeyDown -= Publish_KeyDown; //remove the key listener as we don't need it to exit fullscreen anymore and we dont want events triggered trying to exit fullscreen on every keypress when it's not fullscreen
                 }
                 else
                 {
                     if (fullscreen) //if trying to fullscreen when no movie is loaded...
                     {
                         MessageBox.Show("Start playing a movie before choosing fullscreen", "Start Movie");
                     }
                 }
             }
         }
     }
     else //wmp player
     {
         if (player.InvokeRequired) //wrong thread, send callback
         {
             setVideoFullscreenCallback d = new setVideoFullscreenCallback(setVideoFullscreen);
             player.Invoke(d, new object[] { fullscreen });
         }
         else //right thread :-)
         {
             if (fullscreen == true && (player.playState == WMPLib.WMPPlayState.wmppsStopped || player.URL == ""))
             {
                 MessageBox.Show("Start playing a movie before choosing fullscreen", "Start Movie");
             }
             else
             {
                 player.fullScreen = fullscreen;
             }
         }
     }
 }