Plugin with external player, how to tell MP to not run Screensasver? (1 Viewer)

MightyPolo

Portal Pro
October 24, 2007
181
80
Home Country
Czech Republic Czech Republic
Hi.
My plugin uses external player.
Now some users reported, that when they are watching movie, MPs screensaver is run.

I have done some research and find out that using SetThreadExecutionState prohibits screensaver starting (tested on win7).
But when MP is running, its screensaver is runned anyway.

Is there a way to tell MP not to lunch screensaver?
I have noticed g_Player but this can be only used for reading. Iam able to stop playing video using it.
Is there a way, I can say MP that external player is used so that screensaver wount popup?

Thank you.

p.
p.s. External player is needed, because netflix player is showed in it. I had problems disposing WebBrowser object because of SilverLight, which I think would impact whole MPs stability.
 

geoffstewart

MP Donator
  • Premium Supporter
  • October 12, 2008
    346
    112
    Ottawa
    Home Country
    Canada Canada
    I was browsing the source for MP online. The MediaPortal.cs file has a section that might be useful:

    Code:
          if (_useScreenSaver)
          {
            if ((GUIGraphicsContext.IsFullScreenVideo && g_Player.Paused == false) || GUIWindowManager.ActiveWindow == (int)GUIWindow.Window.WINDOW_SLIDESHOW || GUIWindowManager.ActiveWindow == _idlePluginWindowId)
            {
              GUIGraphicsContext.ResetLastActivity();
            }
            if (!GUIGraphicsContext.BlankScreen && !Windowed)
            {
              TimeSpan ts = DateTime.Now - GUIGraphicsContext.LastActivity;
              if (ts.TotalSeconds >= _timeScreenSaver)
              {
                if (_useIdleblankScreen)
                {
                  if (!GUIGraphicsContext.BlankScreen)
                  {
                    Log.Debug("Main: Idle timer is blanking the screen after {0} seconds of inactivity", ts.TotalSeconds.ToString("n0"));
                  }
                  GUIGraphicsContext.BlankScreen = true;
                }
                else if (_useIdlePluginScreen)
                {
                  if (_idlePluginWindowId != 0)
                  {
                    if (!_idlePluginActive)
                    {
                      _idlePluginActive = true;
                      Log.Debug("Main: Idle timer is setting the screensaver application after {0} seconds of inactivity", ts.TotalSeconds.ToString("n0"));
                      GUIWindowManager.ActivateWindow(_idlePluginWindowId);
    
                    }
                  }
                  else...



    It seems you might be able to use the IExternalPlayer to register the player as a valid player. Then when you get your player from the player factory and trigger a play, MP will know that the g_Player is actually playing....

    Seems complicated ;)

    Thanks for asking, anyway
     

    Users who are viewing this thread

    Top Bottom