MediaView
Last updated
Last updated
package com.intowow.sdk
public class MediaView extends RelativeLayout
This class is a inner class of
You should use this class after Native Ad is loaded.
If you want to configure the media view's width, you can implement the following code after ad loaded :
You could also use AdProperty
to configure your ad if necessary.
AdProperty.HIDE_COUNTDOWN
: if need to hide the countdown or not, the default value is false
AdProperty.HIDE_WIFITAG
: if need to hide the Wi-Fi hint or not, the default value is false
AdProperty.HIDE_SPEAKER
: if need to hide speaker or not, the default value is false
AdProperty.HIDE_AD_ICON
: if need to hide ad icon or not, the default value is true
AdProperty.AUTO_CONTROL_VOLUME
: if need to let the media view toggle video mute and unmute status when user click it, the default value is true
AdProperty.VIDEO_AUTO_REPEAT
: if need to let the video ad auto repeat play, the default value is true
AdProperty.TOUCH_EFFECT
: Set the touch effect by using argb color, the default effect is none.
AdProperty.SILENT_START
: if need to let the video auto silent start, the default value is true
Public constructors
Public methods
void
boolean
boolean
boolean
void
void
boolean
boolean
void
void
void
void
void
NativeAd(Context context, String placement)
Instantiates a new native ad.
Parameters
context
Context: the context.
placement
String: A specific group of ad units on which an advertiser can choose to place their ads using placement targeting.
void destroy()
Release the media view.
boolean isAvailableAttachToWindow()
Check if this ad is available to attach to window.
Returns
boolean
true if is available to attach to window otherwise return false.
boolean isFullScreen()
Check if this ad is full screen.
Returns
boolean
true if this ad is full screen otherwise return false.
boolean isMute()
Check if this ad is muted.
Returns
boolean
true if this ad is muted otherwise return false.
void mute()
Mute video ad.
void play()
Allow this ad to play.
boolean resize(int width)
Resize the media view.
Parameters
width
int: the width.
Returns
boolean
true if resize this ad successfully otherwise return false.
Resize the media view by CEAdSize.
Parameters
ceAdSize
Returns
boolean
true if resize this ad successfully otherwise return false.
void setFullScreenMode(FullScreenMode mode)
Set the full screen mode.
Parameters
mode
FullScreenMode: NONE, RIGHT_SIDE_UP or LEFT_SIDE_UP
void setNativeAd(NativeAd nativeAd)
Set the native ad. you should call this method after native ad onAdLoaded().
Parameters
nativeAd
NativeAd: the origin nativeAd you requesting.
void setTouchEffect(int argbColor)
Set touch effect. you could use AdProperty to configure this effect instead of using this method.
Parameters
argbColor
int: the argb color
void stop()
Disallow this ad to play.
void unmute()
Unmute video ad.
Instantiates a new media view.
Instantiates a new media view.
Release the media view.
Check if this ad is available to attach to window.
Check if this ad is full screen.
Check if this ad is muted.
Mute video ad.
Allow this ad to play.
Resize the media view.
Resize the media view by CEAdSize.
Set the full screen mode.
Set the native ad.
Set touch effect.
Disallow this ad to play.
Unmute video ad.
boolean resize( ceAdSize)
: the ceAdSize.