Android SDK Version

public final class MediaViewVideoRendererWithBackgroundPlayback
extends MediaViewVideoRenderer
This is a Default VideoViewRenderer used within MediaView. It can be replaced with any customized MediaViewVideoRenderer by calling MediaView.setVideoRenderer(MediaViewVideoRenderer)
Since:
5.0
Field Summary
Fields inherited from class com.facebook.ads.
nativeAd, videoAutoplayBehavior
Constructor Summary
Constructor and Description
MediaViewVideoRendererWithBackgroundPlayback(Context context) 
MediaViewVideoRendererWithBackgroundPlayback(Context context, AttributeSet attrs) 
MediaViewVideoRendererWithBackgroundPlayback(Context context, AttributeSet attrs, int defStyleAttr) 
MediaViewVideoRendererWithBackgroundPlayback(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) 
Method Summary
Modifier and TypeMethod and Description
voidonPrepared()
Callback when the video is prepared and ready to play.
booleanshouldAllowBackgroundPlayback()
Whether background video playback should be enabled or not.
Methods inherited from class com.facebook.ads.internal.api.AdComponentView
attachAdComponentViewApi, onAttachedToWindow, onDetachedFromWindow, onMeasure, onVisibilityChanged, onWindowFocusChanged, setLayoutParams
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail

MediaViewVideoRendererWithBackgroundPlayback

public MediaViewVideoRendererWithBackgroundPlayback(Context context)

MediaViewVideoRendererWithBackgroundPlayback

public MediaViewVideoRendererWithBackgroundPlayback(Context context,
                                                    AttributeSet attrs)

MediaViewVideoRendererWithBackgroundPlayback

public MediaViewVideoRendererWithBackgroundPlayback(Context context,
                                                    AttributeSet attrs,
                                                    int defStyleAttr)

MediaViewVideoRendererWithBackgroundPlayback

public MediaViewVideoRendererWithBackgroundPlayback(Context context,
                                                    AttributeSet attrs,
                                                    int defStyleAttr,
                                                    int defStyleRes)
Method Detail

onPrepared

public void onPrepared()
Description copied from class: MediaViewVideoRenderer
Callback when the video is prepared and ready to play.
Overrides:

shouldAllowBackgroundPlayback

public boolean shouldAllowBackgroundPlayback()
Description copied from class: MediaViewVideoRenderer
Whether background video playback should be enabled or not. This will allow videos in Native Ads to keep playing sound when the video is off-screen. It will not work when the video is set to full screen mode. Override this and return true to enable background playback.
Overrides:
Returns:
true if background video playback is enabled, false otherwise