-jio-start-block-type-4
¶ Rewarded Video Ads-jio-style-title ¶ IntroductionRewarded Video ads are full-screen advertisements that appear between two content pages or during natural breaks in the user's interaction with an application or website. These ads cover the entire screen, providing a highly immersive and attention-grabbing experience. |
![]() |
![]() |
-jio-end-block-type-4
Complete GETTING STARTED section and INITIALIZE SDK section before starting this section.
-jio-start-block-type-2
-jio-style-title
Cache native ads by initializing a JioAdView
, setting up an ad listener, creating an ad container, adding the ad view, and initiating the caching process with a single call to jioAdViewInterstitial.cacheAd()
.
JioAdView jioAdViewRewarded = new JioAdView (this,”<ADSPOT_KEY_GOES_HERE>“,
JioAdView.AD_TYPE.INTERSTITIAL);
// context passed here should be Activity context.
jioAdViewRewarded.setAdListener(new JioAdListener() {
@Override public void onAdFailedToLoad(JioAdError jioAdError,JioAdView jioAdView) {
// Error Callback
}
@Override public void onAdPrepared(JioAdView jioAdView) {
// Success callback
}
@Override public void onAdClosed(JioAdView jioAdView,boolean isVideoCompleted, boolean isEligibleForReward) {
// When Ad is closed
}
@Override public void onAdRender(JioAdView jioAdView){
// When ad is rendered on screen
}
@Override public void onAdMediaEnd(JioAdView jioAdView) {
// When media ended
}
});
jioAdViewRewarded.cacheAd();
-jio-style-title
When jioAdViewRewarded.loadAd()
API is called, SDK will try to render the ad inside the container shared.
jioAdViewRewarded.loadAd();
-jio-style-title
Check for isEligibleForReward
flag inside onAdClosed()
callback
-jio-style-title
-jio-style-title
Lifecycle Management
Ensure proper lifecycle management by calling jioAdViewRewarded.onDestroy()
within the onDestroy() method of the activity to destroy the Interstitial ad object
override fun onDestroy() {
if (jioAdViewRewarded != null) {
jioAdViewRewarded.onDestroy()
}
super.onDestroy()
}
-jio-end-block-type-2
-jio-start-block-type-2
This section covers customizing Rewarded Video ads. Ads can be image or video.
Below API need to be called to enable customization.
jioAdViewRewarded.setCustomInterstitialAdContainer(portraitLayoutId: Int,
landscapeLayoutId: Int,
adCategory: Int)
//Example:
//jioAdViewRewarded?.setCustomInterstitialAdContainer(R.layout.vast_interstitial_custom_portrait,
// R.layout.vast_interstitial_custom_landscape,
// Constants.AdCategory.VIDEO_INTERSTITIAL)
//
Add required elements with their tags to support individual functionality.
Below are the possible values for AdCategory.
• HTML_INTERSTITIAL
• NATIVE_INTERSTITIAL
• VIDEO_INTERSTITIAL
-jio-style-title
Container for displaying the Rewarded Video Ad's media content, either image or video, with specified dimensions and styling.
<RelativeLayout
android:id=”@+id/media_view”
android:layout_width=”match_parent”
android:layout_height=”240dp”
android:clickable=”true”
android:gravity=”center”
android:tag=”@string/jio_native_media_layout”
/>
-jio-style-title
<RelativeLayout
android:id=”@+id/fl_video_container”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:layout_centerInParent=”true”
android:layout_gravity=”center”
android:tag=”@string/jio_video_player_container” />
-jio-style-title
Include an Image View for Video Close functionality in the video player.
<TextView
android:id=”@+id/iv_close_button”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_alignParentTop=”true”
android:layout_alignParentEnd=”true”
android:layout_margin=”10dp”
android:drawableRight=”@drawable/jio_close_advertisement_video”
android:gravity=”center_vertical”
android:tag=”@string/jio_video_skip_element”
android:text=”@string/you_can_skip_ad_in_skip_counter”
android:textAppearance=”?android:attr/textAppearanceSmall”
android:textColor=”@android:color/white”
android:visibility=”gone” />
-jio-style-title
Add an Image View for controlling the Mute/Unmute functionality in the video player.
<ImageView
android:id=”@+id/iv_sound_unmute_button”
android:layout_width=”30dp”
android:layout_height=”30dp”
android:layout_marginStart=”10dp”
android:layout_marginTop=”10dp”
android:background=”@drawable/jio_mute”
android:contentDescription=”@string/jio_video_volume_icon”
android:src=”@drawable/jio_unmute”
android:tag=”@string/jio_video_volume_icon”
android:visibility=”gone” />
-jio-style-title
Include an Image View for Play/Pause functionality in the video player.
<ImageView
android:id=”@+id/adPlayback”
android:layout_width=”30dp”
android:layout_height=”30dp”
android:layout_alignParentStart=”true”
android:layout_alignParentBottom=”true”
android:layout_centerVertical=”true”
android:layout_marginStart=”10dp”
android:layout_marginBottom=”10dp”
android:background=”@drawable/jio_vast_play”
android:contentDescription=”@string/jio_video_playback_icon”
android:src=”@drawable/jio_vast_pause”
android:tag=”@string/jio_video_playback_icon”
android:visibility=”gone” />
-jio-style-title
Include a Progress Bar for visual representation of the video ad progress
<LinearLayout
android:id=”@+id/progressLayout”
android:layout_width=”wrap_content”
android:layout_height=”30dp”
android:layout_alignParentBottom=”true”
android:layout_marginStart=”5dp”
android:layout_marginBottom=”10dp”
android:layout_toEndOf=”@id/adPlayback”>
<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_gravity=”center”
android:text=”@string/ad_text_with_colon”
android:textAppearance=”?android:attr/textAppearanceSmall”
android:textColor=”@android:color/white”
android:textSize=”12sp” />
<TextView
android:id=”@+id/progressCount”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_gravity=”center”
android:contentDescription=”@string/jio_video_progresscount_down”
android:padding=”5dp”
android:tag=”@string/jio_video_progresscount”
android:text=”@string/_00_00”
android:textAppearance=”?android:attr/textAppearanceSmall”
android:textColor=”@android:color/white”
android:textSize=”12sp” />
</LinearLayout>
-jio-end-block-type-2