目录

InstreamView

Class Info

public class InstreamView extends PPSPlacementView implements IInstreamView

贴片广告视图。

Nested Class Summary

Qualifier and Type

Class Name and Description

interface

InstreamView.OnInstreamAdClickListener

贴片广告点击监听器。

Public Constructor Summary

Constructor Name

InstreamView(Context context)

贴片广告视图构造函数。

InstreamView(Context context, AttributeSet attrs)

贴片广告视图构造函数。

InstreamView(Context context, AttributeSet attrs, int defStyleAttr)

贴片广告视图构造函数。

Public Method Summary

Qualifier and Type

Class Name and Description

void

destroy()

销毁贴片广告视图。

View

getCallToActionView()

获取点击行为视图。

boolean

isPlaying()

获取当前是否正在播放。

void

mute()

静音贴片广告。

void

onClose()

关闭贴片广告。

void

pause()

暂停播放贴片广告。

void

play()

播放贴片广告。

void

removeInstreamMediaChangeListener()

移除贴片媒体切换监听器。

void

removeInstreamMediaStateListener()

移除贴片广告媒体状态监听器。

void

removeMediaMuteListener()

移除媒体静音监听器。

void

setCallToActionView(View callToActionView)

设置点击行为视图。

void

setInstreamAds(List<InstreamAd> ads)

设置贴片广告。

void

setInstreamMediaChangeListener(InstreamMediaChangeListener mediaChangeListener)

设置贴片广告媒体切换监听器。

void

setInstreamMediaStateListener(InstreamMediaStateListener stateListener)

设置贴片广告媒体状态监听器。

void

setMediaMuteListener(MediaMuteListener muteListener)

设置媒体静音监听器。

void

setOnInstreamAdClickListener(OnInstreamAdClickListener clickListener)

设置贴片广告点击监听器。

void

stop()

停止播放贴片广告。

void

unmute()

取消静音。

void

showAdvertiserInfoDialog(View anchorView, boolean showWhyThisAd)

展示广告主信息弹框。

void

hideAdvertiserInfoDialog()

隐藏广告主信息弹框。

void

showTransparencyDialog(View anchorView)

展示广告透明性弹框。

void

showTransparencyDialog(View anchorView, int[] location)

展示广告透明性弹框。

void

hideTransparencyDialog()

隐藏广告透明性弹框 。

Public Constructors

[h2]InstreamView(Context context)

Constructor

public InstreamView(Context context)

贴片广告视图构造函数。

Parameters

Name

Description

context

上下文。

[h2]InstreamView(Context context, AttributeSet attrs)

Constructor

public InstreamView(Context context, AttributeSet attrs)

贴片广告视图构造函数。

Parameters

Name

Description

context

上下文。

attrs

视图属性集合。

[h2]InstreamView(Context context, AttributeSet attrs, int defStyleAttr)

Constructor

InstreamView(Context context, AttributeSet attrs, int defStyleAttr)

贴片广告视图构造函数。

Parameters

Name

Description

context

上下文。

attrs

视图属性集合。

defStyleAttr

默认样式。

Public Methods

[h2]destroy

Method

public void destroy()

销毁贴片广告视图。

[h2]getCallToActionView

Method

public View getCallToActionView()

获取点击行为视图。

Returns

Type

Description

View

点击行为视图。

[h2]isPlaying

Method

public boolean isPlaying()

获取当前贴片广告视图广告媒体是否正在播放。

Returns

Type

Description

boolean

当前是否正在播放广告媒体:

  • true:是。
  • false:否。

[h2]mute

Method

public void mute()

静音贴片广告。

[h2]onClose

Method

public void onClose()

关闭贴片广告。

[h2]pause

Method

public void pause()

暂停播放贴片广告。

[h2]play

Method

public void play()

播放贴片广告。

[h2]removeInstreamMediaChangeListener

Method

public void removeInstreamMediaChangeListener()

移除贴片媒体切换监听器。

[h2]removeInstreamMediaStateListener

Method

public void removeInstreamMediaStateListener()

移除贴片广告媒体状态监听器。

[h2]removeMediaMuteListener

Method

public void removeMediaMuteListener()

移除媒体静音监听器。

[h2]setCallToActionView

Method

public void setCallToActionView(View callToActionView)

设置点击行为视图。

Parameters

Name

Description

callToActionView

点击行为视图。

[h2]setInstreamAds

Method

public void setInstreamAds(List<InstreamAd> ads)

设置贴片广告。

Parameters

Name

Description

ads

贴片广告列表。

[h2]setInstreamMediaChangeListener

Method

public void setInstreamMediaChangeListener(InstreamMediaChangeListener mediaChangeListener)

设置贴片广告媒体切换监听器。

Parameters

Name

Description

mediaChangeListener

贴片广告媒体切换监听器。

[h2]setInstreamMediaStateListener

Method

public void setInstreamMediaStateListener(InstreamMediaStateListener stateListener)

设置贴片广告媒体状态监听器。

Parameters

Name

Description

stateListener

贴片广告媒体状态监听器。

[h2]setMediaMuteListener

Method

public void setMediaMuteListener(MediaMuteListener muteListener)

设置媒体静音监听器。

Parameters

Name

Description

muteListener

媒体静音监听器。

[h2]setOnInstreamAdClickListener

Method

public void setOnInstreamAdClickListener(OnInstreamAdClickListener clickListener)

设置贴片广告点击监听器。

Parameters

Name

Description

clickListener

贴片广告点击监听器。

[h2]stop

Method

public void stop()

停止播放贴片广告。

[h2]unmute

Method

public void unmute()

取消静音。

[h2]showAdvertiserInfoDialog

Method

public void showAdvertiserInfoDialog(View anchorView, boolean showWhyThisAd)

展示广告主信息弹框。

Parameters

Name

Description

anchorView

锚点视图,弹框会根据锚点视图位置展示。

showWhyThisAd

广告主信息弹框上是否显示为什么看到此广告。

[h2]hideAdvertiserInfoDialog

Method

public void hideAdvertiserInfoDialog()

隐藏广告主信息弹框。

[h2]showTransparencyDialog

Method

public void showTransparencyDialog(View anchorView)

展示广告透明性弹框。

Parameters

Name

Description

anchorView

媒体自定义组件,弹框会基于组件位置展示。

[h2]showTransparencyDialog

Method

public void showTransparencyDialog(View anchorView, int[] location)

展示广告透明性弹框。

Parameters

Name

Description

anchorView

媒体自定义组件,弹框会基于组件位置展示。

location

自定义弹框锚点坐标。

[h2]hideTransparencyDialog

Method

public void hideTransparencyDialog()

隐藏广告透明性弹框。