Example #1
0
        public override void Dispose()
        {
            GUIWindowManager.OnNewAction -= GUIWindowManager_OnNewAction;

            if (!bufferCompleted)
            {
                GUIWaitCursor.Hide();
            }

            try { if (osd != null)
                  {
                      osd.Dispose(); osd = null;
                  }
            }
            catch (Exception ex) { Log.Instance.Warn(ex.ToString()); }

            try { if (wmpCtrl != null)
                  {
                      wmpCtrl.Dispose(); wmpCtrl = null;
                  }
            }
            catch (Exception ex) { Log.Instance.Warn(ex.ToString()); }

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
Example #2
0
        public override void Process()
        {
            if (media == null)
            {
                return;
            }

            if (media.State == States.Ended || media.State == States.Stopped)
            {
                playState = PlayState.Ended;
            }
            if (Initializing && media.State == States.Playing)
            {
                playState = PlayState.Playing;
            }

            if (!bufferingDone && !Initializing)
            {
                GUIWaitCursor.Hide(); // hide the wait cursor
                bufferingDone = true;

                if (Ended)
                {
                    PlaybackEnded();
                }
                else
                {
                    if (GoFullscreen)
                    {
                        GUIWindowManager.ActivateWindow(GUIOnlineVideoFullscreen.WINDOW_FULLSCREEN_ONLINEVIDEO);
                    }
                    GUIMessage msgPb = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED, 0, 0, 0, 0, 0, null);
                    msgPb.Label = CurrentFile;
                    GUIWindowManager.SendThreadMessage(msgPb);
                    SetVideoWindow();
                    osd = OSDController.Instance;
                }
            }

            if (osd != null)
            {
                osd.UpdateGUI();
            }
        }
Example #3
0
        public override void Process()
        {
            if (wmpCtrl != null)
            {
                if (Initializing)
                {
                    if (!bufferCompleted && wmpCtrl.playState.Equals(WMPPlayState.wmppsPlaying))
                    {
                        bufferCompleted = true;
                    }

                    if (wmpCtrl.playState.Equals(WMPPlayState.wmppsReady))
                    {
                        GUIWaitCursor.Hide(); // hide the wait cursor
                        Log.Instance.Info("WMPVideoPlayer: error encountered while trying to play {0}", currentFile);
                        bufferCompleted = true;
                        PlaybackEnded();
                    }
                    else if (bufferCompleted)
                    {
                        AdaptRefreshRate();
                        GUIWaitCursor.Hide(); // hide the wait cursor
                        wmpCtrl.Visible = true;
                        playState       = PlayState.Playing;
                        if (GoFullscreen)
                        {
                            GUIWindowManager.ActivateWindow(GUIOnlineVideoFullscreen.WINDOW_FULLSCREEN_ONLINEVIDEO);
                        }
                        GUIMessage msgPb = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED, 0, 0, 0, 0, 0, null);
                        msgPb.Label = CurrentFile;
                        GUIWindowManager.SendThreadMessage(msgPb);
                        SetVideoWindow();
                        osd = OSDController.Instance;
                    }
                }
                else if (Playing && osd != null)
                {
                    osd.UpdateGUI();
                }
            }
        }
 /// <summary>
 /// Creates the instance of the external OSD controller. Seperated for creation in a different thread.
 /// </summary>
 private void OsdGetInstance()
 {
     _osd = OSDController.Instance;
 }