ANVideoPlayerSettings アプリでビデオ プレーヤーの UI コントロールをカスタマイズできます。 これらの設定は、Android SDK が提供するすべての動画広告 (インストリーム動画、バナー動画 (アウトストリーム)、インタースティシャル動画) に適用されます。
[収益化] 配置設定ページ (UI と API) にも同様のオプションが表示されますが、一部のみが有効になります。
- ビデオ プレーヤーの UI オプション — 無視されます。 SDK では、以下のクライアント側の値のみが使用されます。
- UI 以外の設定 (VAST バージョン、MIME タイプ、許可される期間など) — 適用されます。 これらのポリシーによって、Monetize が提供できる広告が決まります。
| 機能 | 既定の設定 | 説明 | 設定をサポートする広告ユニット |
|---|---|---|---|
void shouldShowClickThroughControl(boolean showClickThroughControl) |
true | クリックスルー コントロールが表示されるかどうかを決定します。 false に設定すると、動画全体がクリック可能になります。 | インストリーム / バナー動画 / インタースティシャル |
void setClickThroughText(String clickThroughText) |
"詳細情報" | クリックスルー コントロールに関連付けられているテキストをカスタマイズします。 | インストリーム / バナー動画 / インタースティシャル |
void shouldShowFullScreenControl(boolean showFullScreenControl) |
true | 全画面表示ボタンの表示を制御します。 | バナー動画 |
void shouldShowTopBar(boolean showTopBar) |
true | 非推奨。 上部のバー (クリックスルー コントロールとスキップ コントロールを含む) を表示するかどうかを決定します。 このメソッドは機能しなくなり、将来の SDK バージョンで削除される予定です。 | インストリーム/バナー動画 |
void shouldShowAdText(boolean showAdText) |
true | クリックスルー コントロールの横にある広告テキストの表示設定を制御します。 | インストリーム / バナー動画 / インタースティシャル |
void setAdText(String adText) |
"Ad" | 動画プレーヤーで広告テキストをカスタマイズします。 | インストリーム / バナー動画 / インタースティシャル |
void shouldShowVolumeControl(boolean showVolumeControl) |
true | ミュート/ミュート解除コントロールの可視性を制御します。 | インストリーム / バナー動画 / インタースティシャル |
void setInitialAudio(ANInitialAudioSetting initialAudio) |
サウンド オン (インタースティシャル/インストリーム)、サウンド オフ (バナー動画) | 初期オーディオの状態を設定します。 | インストリーム / バナー動画 / インタースティシャル |
void shouldShowSkip(boolean showSkip) |
true | [スキップ] コントロールの可視性を制御します。 | インストリーム/インタースティシャル |
void setSkipDescription (文字列skipDescription) |
"%%TIME%% で広告をスキップ" | スキップの説明をカスタマイズします。 | インストリーム/インタースティシャル |
void setSkipLabelName (文字列skipLabelName) |
"広告をスキップする" | スキップ ラベルをカスタマイズします。 | インストリーム/インタースティシャル |
void setSkipOffset (整数skipOffset) |
"5 秒" | スキップ オフセットをカスタマイズします。 | インストリーム/インタースティシャル |
void shouldForceControlBarVisible (booleanforceControlBarVisible) |
true | [ true] に設定すると、ビデオ コントロール バー (再生/一時停止、シーク、音量、その他のコントロール) は、ユーザーの操作に関係なく常に表示されます。false に設定すると、プレイヤーは自動非表示動作を使用し、一定時間操作がないとコントロール バーが非表示になります。 |
インストリーム / バナー動画 / インタースティシャル |
void shouldClickBehaviorPausePlay(boolean clickBehaviorPausePlay) |
true |
true (既定) に設定した場合、ビデオをタップすると再生/一時停止が切り替わります。
false に設定すると、タップは他のハンドラー (クリックスルーなど) に渡されます。 |
インストリーム / バナー動画 / インタースティシャル |
例
// Show or hide the ClickThrough control on the video player. Default is true; setting it to false makes 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);
// Deprecated: this method is no longer functional and will be removed in a future SDK version
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(ANInitialAudioSetting.DEFAULT);
ANVideoPlayerSettings.getVideoPlayerSettings().setInitialAudio(ANInitialAudioSetting.SOUND_ON);
ANVideoPlayerSettings.getVideoPlayerSettings().setInitialAudio(ANInitialAudioSetting.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. Minimum value is 5 seconds; lower values are clamped to 5
ANVideoPlayerSettings.getVideoPlayerSettings().setSkipOffset(2);
// Show or hide the control bar permanently (default is true to always show). If set to false, the player will auto-hide the control bar after inactivity.
ANVideoPlayerSettings.getVideoPlayerSettings().shouldForceControlBarVisible(false);
// When set to true (default), tapping the video toggles play/pause. Set to false to pass taps to other handlers (for example, click-through)
ANVideoPlayerSettings.getVideoPlayerSettings().shouldClickBehaviorPausePlay(false);