Skip to main content
Skip table of contents

Overriding KeepScreenOn behaviour

The SDK KeepScreenOn behaviour is by default:

  • The screen will be on when content is playing and will not go to ambient (screen saver) mode even after the user inactivity timeout.

  • The screen will go to ambient mode after the user inactivity timeout when content playback is paused or completed.

You can override this behaviour in the OTVPlayerConfiguration.

The application needs to set the overrideKeepScreenOn configuration flag using the OTVPlayerConfiguration.Builder API setOverrideKeepScreenOn.

JAVA
OTVPlayerConfiguration.Builder configBuilder = new OTVPlayerConfiguration.Builder();
// override KeepScreenOn as the application wants to handle the KeepScreenOn logic
configBuilder.setOverrideKeepScreenOn(true);

//Build the player configuration and pass it to OTVVideoView
OTVPlayerConfiguration config = configBuilder.build();
// Here videoView is the instance of OTVVideoView.
videoView.setPlayerConfiguration(config);

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.