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
.
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);