Android SDK Version
  • java.lang.Object
    • RelativeLayout
      • com.facebook.ads.internal.api.AdNativeComponentView
        • com.facebook.ads.MediaView
Direct Known Subclasses:

public class MediaView
extends com.facebook.ads.internal.api.AdNativeComponentView
MediaView displays native ad media content.
MediaView can be declared and added to view:
 MediaView mediaView = new MediaView(context); addView(adView); mediaView.setNativeAd(nativeAd); 
Since:
4.6
Constructor Summary
Constructor and Description
MediaView(Context context) 
MediaView(Context context, AttributeSet attrs) 
MediaView(Context context, AttributeSet attrs, int defStyleAttr) 
MediaView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) 
Method Summary
Modifier and TypeMethod and Description
voidaddView(View child) 
voidaddView(View child, int index) 
voidaddView(View child, int width, int height) 
voidaddView(View child, int index, ViewGroup.LayoutParams params) 
voidaddView(View child, ViewGroup.LayoutParams params) 
voidbringChildToFront(View child) 
voiddestroy() 
ViewgetAdContentsView()
Used by other SDK classes and subject to change.
intgetMediaHeight() 
com.facebook.ads.internal.api.MediaViewApigetMediaViewApi()
Used by other SDK classes and subject to change.
intgetMediaWidth() 
voidsetListener(MediaViewListener listener) 
voidsetVideoRenderer(MediaViewVideoRenderer newVideoRenderer)
After creating the MediaView you can change the video renderer implementation to a custom extension of MediaViewVideoRenderer.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail

MediaView

public MediaView(Context context)
Since:
4.6

MediaView

public MediaView(Context context,
                 AttributeSet attrs)
Since:
4.6

MediaView

public MediaView(Context context,
                 AttributeSet attrs,
                 int defStyleAttr)
Since:
4.6

MediaView

public MediaView(Context context,
                 AttributeSet attrs,
                 int defStyleAttr,
                 int defStyleRes)
Since:
4.6
Method Detail

getMediaViewApi

public com.facebook.ads.internal.api.MediaViewApi getMediaViewApi()
Used by other SDK classes and subject to change.

setVideoRenderer

public void setVideoRenderer(MediaViewVideoRenderer newVideoRenderer)
After creating the MediaView you can change the video renderer implementation to a custom extension of MediaViewVideoRenderer.
Parameters:
newVideoRenderer - new implementation of MediaViewVideoRenderer

getMediaWidth

public int getMediaWidth()

getMediaHeight

public int getMediaHeight()

getAdContentsView

public View getAdContentsView()
Description copied from class: com.facebook.ads.internal.api.AdNativeComponentView
Used by other SDK classes and subject to change.
Specified by:
getAdContentsView in class com.facebook.ads.internal.api.AdNativeComponentView

setListener

public void setListener(MediaViewListener listener)

destroy

public void destroy()

addView

public void addView(View child)

addView

public void addView(View child,
                    int index)

addView

public void addView(View child,
                    ViewGroup.LayoutParams params)

addView

public void addView(View child,
                    int width,
                    int height)

addView

public void addView(View child,
                    int index,
                    ViewGroup.LayoutParams params)

bringChildToFront

public void bringChildToFront(View child)