top

How to block the screensaver during video playback?

Published 2014-10-27 | (Compatible with SDK 2.5,3.5,4.5,5.0,5.1 and 2011,2012,2013,2014 models)

Screensaver blocking - policy and implementation details.

In the Samsung TVs and BD Players, if there is no input to TV for a specified time, the screensaver is launched automatically. This might be strongly inconvenient in applications that play videos or image slideshow.

Important

If your application includes some video playback or image slideshow, you should disable the screensaver during the playback. Otherwise, this will be reported as a defect in QA.

Source Files

Note

The files needed for the sample application are here.

  1. Add the Service API library to the index.html file:

    <script type='text/javascript' language='javascript' src='$MANAGER_WIDGET/Common/af/2.0.0/loader.js'></script>
    
  2. Set off the screensaver when video content is played or resumed:

    Player.play = function () {
        sf.service.setScreenSaver(true, 100);
        ...
    }
    
  3. Set on the screensaver when the video is paused or stopped

    Player.stop = function () {
        sf.service.setScreenSaver(false);
        ...
    }
    
    Player.onRenderingComplete = function () {
        sf.service.setScreenSaver(false);
        ...
    }
    

    Note

    The screensaver should be turned on in the callback functions for all player events which stop the playback.