Customize video player options on Android

ANVideoPlayerSettings class allows publisher app to customize some of the Ad Video Player UI/Controls.

Note

The customization is applied to all of the Video ads served through Xandr SDK both Instream and Banner Video(Outstream).

Function Default Setting Description
void shouldShowClickThroughControl
(boolean showClickThroughControl)
true Determines whether the ClickThrough Control is displayed. Setting it to false makes the entire video clickable
void setClickThroughText
(string clickThroughText)
"Learn More" Customizes the text associated with the ClickThrough Control
void shouldShowFullScreenControl
(boolean showFullScreenControl) (Banner Video Only)
true Controls the visibility of the fullscreen button for Banner Video
void shouldShowTopBar
(boolean showTopBar)
true Determines whether the top bar, containing ClickThrough and Skip controls, is displayed
void shouldShowAdText
(boolean showAdText)
true Controls the visibility of the ad text next to the ClickThrough control
void setAdText
(string adText)
"Ad" Customizes the ad text on the video player
void shouldShowVolumeControl
(boolean showVolumeControl)
true Controls the visibility of the mute/unmute control
void setInitialAudio
(ANInitialAudioSetting initialAudio)
Sound On (Instream), Sound Off ( Banner Video) Sets the initial audio state for Instream and Banner Videos
void shouldShowSkip
(boolean showSkip) (Instream Video Only)
true Controls the visibility of the Skip control for Instream Video

Example

// Show or Hide the ClickThrough control on the video player. Default is YES, setting it to NO will make the entire video clickable
ANVideoPlayerSettings.getVideoPlayerSettings().shouldShowClickThroughControl(false);
 
// Change the ClickThrough text on the video player
ANVideoPlayerSettings.getVideoPlayerSettings().setClickThroughText("SampleText");
 
// Show or hide fullscreen control on the player. This is applicable only for Banner Video
ANVideoPlayerSettings.getVideoPlayerSettings().shouldShowFullScreenControl(true);
 
// Show or hide the top bar that has (ClickThrough & Skip control)
ANVideoPlayerSettings.getVideoPlayerSettings().shouldShowTopBar(true);
 
// Show or hide the "Ad" text next to the ClickThrough control
ANVideoPlayerSettings.getVideoPlayerSettings().shouldShowAdText(true);
ANVideoPlayerSettings.getVideoPlayerSettings().setAdText("Video Ad");
 
// Show or hide the volume control on the player
ANVideoPlayerSettings.getVideoPlayerSettings().shouldShowVolumeControl(true);
 
// Decide how the ad video sound starts initially (sound on or off). By default, Instream Video will have sound enabled, while Banner Video will have sound disabled
ANVideoPlayerSettings.getVideoPlayerSettings().setInitialAudio(DEFAULT);
ANVideoPlayerSettings.getVideoPlayerSettings().setInitialAudio(SOUND_ON);
ANVideoPlayerSettings.getVideoPlayerSettings().setInitialAudio(SOUND_OFF);
 
// Show or hide the Skip control on the player
ANVideoPlayerSettings.getVideoPlayerSettings().shouldShowSkip(true);
 
// Change the skip description on the video player
ANVideoPlayerSettings.getVideoPlayerSettings().setSkipDescription("Video Skip Demo");
 
// Change the skip button text on the video player
ANVideoPlayerSettings.getVideoPlayerSettings().setSkipLabelName("Test");
 
// Configure the skip offset on the video player
ANVideoPlayerSettings.getVideoPlayerSettings().setSkipOffset(2);