ANVideoPlayerSettings クラスを使用すると、パブリッシャー アプリで一部の広告ビデオ プレーヤー UI コントロールをカスタマイズできます。
注:
これらの設定は、Mobile SDK を通じて配信されるすべての動画広告 (インストリーム ビデオ、バナー ビデオ (アウトストリーム)、スポットビデオ) に適用されます。
| 機能 | 既定の設定 | 説明 | 設定をサポートする広告ユニット |
|---|---|---|---|
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 | Skip コントロールの可視性を制御します。 | インストリーム/スポット |
void setSkipDescription (StringskipDescription) |
"%%TIME%%で広告をスキップ" | [説明のスキップ] をカスタマイズします。 | インストリーム/スポット |
void setSkipLabelName (StringskipLabelName) |
"広告のスキップ" | ラベルのスキップをカスタマイズします。 | インストリーム/スポット |
void setSkipOffset (IntegerskipOffset) |
"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);