Partager via


Personnaliser les options du lecteur vidéo sur Android

ANVideoPlayerSettings la classe permet à l’application éditeur de personnaliser certains contrôles/l’interface utilisateur du lecteur vidéo publicitaire.

Remarque

La personnalisation est appliquée à toutes les publicités vidéo diffusées par le biais du Kit de développement logiciel (SDK) Xandr à la fois Instream et Banner Video(Outstream).

Fonction Paramètre par défaut Description
void shouldShowClickThroughControl
(booléenshowClickThroughControl)
true Détermine si le contrôle ClickThrough est affiché. La définition de la valeur false rend la vidéo entière cliquable
void setClickThroughText
(chaîneclickThroughText)
« En savoir plus » Personnalise le texte associé au contrôle ClickThrough
void shouldShowFullScreenControl
(booléenshowFullScreenControl) (Bannière vidéo uniquement)
true Contrôle la visibilité du bouton plein écran pour bannière vidéo
void shouldShowTopBar
(booléenshowTopBar)
true Détermine si la barre supérieure, contenant les contrôles ClickThrough et Skip, est affichée
void shouldShowAdText
(booléenshowAdText)
true Contrôle la visibilité du texte de l’annonce en regard du contrôle ClickThrough
void setAdText
(chaîneadText)
« Annonce » Personnalise le texte de l’annonce sur le lecteur vidéo
void shouldShowVolumeControl
(booléenshowVolumeControl)
true Contrôle la visibilité du contrôle muet/unmute
void setInitialAudio
(ANInitialAudioSettinginitialAudio)
Son on (instream), Sound Off (bannière vidéo) Définit l’état audio initial des vidéos d’instream et de bannière
void shouldShowSkip
(booléenshowSkip) (Vidéo en flux continu uniquement)
true Contrôle la visibilité du contrôle Skip pour la vidéo en flux

Exemple

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