Setting Screensaver

This topic describes how your application can enable and disable the screensaver functionality on the device.

The screensaver is used to prevent screen burn when the device screen displays a still image or the user provides no input for some time. If the screensaver is enabled, it is automatically shown after a defined amount of time with no activity.

You must disable the screensaver during activities when the user is watching the screen without giving input, such as video playback or image slideshows. You can use the AppCommon API to enable and disable the screensaver.

Note

If "Auto Protection Time" is switched off in the device settings, enabling and disabling the screensaver using the AppCommon API has no effect.

Before published, your application must enable and disable the screensaver appropriately.

  • To enable the screensaver when media playback is paused or stopped:
webapis.appcommon.setScreenSaver(
  webapis.appcommon.AppCommonScreenSaverState.SCREEN_SAVER_ON,
  function(result) {
    console.log(result);
  }, function(error) {
    console.log(JSON.stringify(error));
  }
);
  • To disable the screensaver when media playback is started or resumed:
webapis.appcommon.setScreenSaver(
  webapis.appcommon.AppCommonScreenSaverState.SCREEN_SAVER_OFF,
  function(result) {
    console.log(result);
  }, function(error) {
    console.log(JSON.stringify(error));
  }
);