public abstract class MediaViewVideoRenderer
extends com.facebook.ads.internal.api.AdComponentFrameLayout
Modifier and Type | Field and Description |
---|---|
protected NativeAd |
nativeAd
Deprecated.
|
protected VideoAutoplayBehavior |
videoAutoplayBehavior
Deprecated.
|
Constructor and Description |
---|
MediaViewVideoRenderer(Context context) |
MediaViewVideoRenderer(Context context,
AttributeSet attrs) |
MediaViewVideoRenderer(Context context,
AttributeSet attrs,
int defStyleAttr) |
MediaViewVideoRenderer(Context context,
AttributeSet attrs,
int defStyleAttr,
int defStyleRes) |
Modifier and Type | Method and Description |
---|---|
void |
addView(View child) |
void |
addView(View child,
int index) |
void |
addView(View child,
int width,
int height) |
void |
addView(View child,
int index,
ViewGroup.LayoutParams params) |
void |
addView(View child,
ViewGroup.LayoutParams params) |
void |
destroy()
Deprecated.
|
void |
disengageSeek(VideoStartReason startReason)
Take the video out of seek mode.
|
void |
engageSeek()
Used to put the video into seek mode.
|
int |
getCurrentTimeMs()
Get the current playback position in milliseconds.
|
int |
getDuration()
Get the duration of the video in milliseconds.
|
com.facebook.ads.internal.api.MediaViewVideoRendererApi |
getMediaViewVideoRendererApi()
Used by other SDK classes and subject to change.
|
float |
getVolume()
Get the volume of the video player.
|
void |
onCompleted()
Callback when the video has completed playing.
|
void |
onError()
Callback when the video had an error during initialization or playback.
|
void |
onPaused()
Callback when the video has been paused.
|
void |
onPlayed()
Callback when the video has started playing.
|
void |
onPrepared()
Callback when the video is prepared and ready to play.
|
void |
onSeek()
Callback when the video is seeked.
|
void |
onSeekDisengaged()
Callback when seek mode is disengaged.
|
void |
onSeekEngaged()
Callback when seek mode is engaged.
|
void |
onVolumeChanged()
Callback when the volume of the video has changed.
|
void |
pause(boolean pausedByUser)
Stop video playback.
|
void |
play(VideoStartReason startReason)
Start video playback.
|
void |
seekTo(int timeMs)
Set the seek position in milliseconds.
|
void |
setNativeAd(NativeAd nativeAd)
Deprecated.
since 5.2
|
void |
setVolume(float volume)
Set the volume of the video player.
|
boolean |
shouldAllowBackgroundPlayback()
Whether background video playback should be enabled or not.
|
boolean |
shouldAutoplay()
Returns if the video should autoplay or not.
|
void |
unsetNativeAd()
Deprecated.
since 5.2
|
@Deprecated protected NativeAd nativeAd
@Deprecated protected VideoAutoplayBehavior videoAutoplayBehavior
public MediaViewVideoRenderer(Context context)
public MediaViewVideoRenderer(Context context, AttributeSet attrs)
public MediaViewVideoRenderer(Context context, AttributeSet attrs, int defStyleAttr)
public MediaViewVideoRenderer(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
public com.facebook.ads.internal.api.MediaViewVideoRendererApi getMediaViewVideoRendererApi()
@Deprecated public void setNativeAd(NativeAd nativeAd)
nativeAd
- NativeAd to load@Deprecated public void unsetNativeAd()
public final void play(VideoStartReason startReason)
startReason
- Whether this video play was triggered by user or an automatic mechanism.public final void pause(boolean pausedByUser)
public final int getCurrentTimeMs()
public final void engageSeek()
public final void disengageSeek(VideoStartReason startReason)
startReason
- Playback may resume after disengaging seek and we need to know whether
this was triggered by user or an automatic mechanism for proper watch time
attribution.public final void seekTo(int timeMs)
timeMs
- int value representing the position in millisecondspublic final int getDuration()
public final void setVolume(float volume)
volume
- float value representing the volumepublic final float getVolume()
public final boolean shouldAutoplay()
@Deprecated public void destroy()
public void onPrepared()
public void onPlayed()
public void onPaused()
public void onSeekEngaged()
public void onSeek()
public void onSeekDisengaged()
public void onCompleted()
public void onVolumeChanged()
public void onError()
public boolean shouldAllowBackgroundPlayback()
public void addView(View child)
addView
in interface com.facebook.ads.internal.api.AdComponentView
addView
in class com.facebook.ads.internal.api.AdComponentFrameLayout
public void addView(View child, int index)
addView
in interface com.facebook.ads.internal.api.AdComponentView
addView
in class com.facebook.ads.internal.api.AdComponentFrameLayout
public void addView(View child, ViewGroup.LayoutParams params)
addView
in interface com.facebook.ads.internal.api.AdComponentView
addView
in class com.facebook.ads.internal.api.AdComponentFrameLayout
public void addView(View child, int width, int height)
addView
in interface com.facebook.ads.internal.api.AdComponentView
addView
in class com.facebook.ads.internal.api.AdComponentFrameLayout
public void addView(View child, int index, ViewGroup.LayoutParams params)
addView
in interface com.facebook.ads.internal.api.AdComponentView
addView
in class com.facebook.ads.internal.api.AdComponentFrameLayout