English
Log In
You can then view all documents
Installation/Android/Template Draw Video Ads
Template Draw Video Ads
Last updated 2022-01-19 21:55:05

Template Draw Video Ads

Introduction

Template rendering Draw: Developers do not need to edit and render the ad style by themselves, they can directly call the relevant interface to get the ad view for display

Supported ad size: vertical video (aspect ratio 16:9)

Note: Developers are not supported to add buttons to the view and block ads

Permission

**Template rendering Draw video ads: ** Provided by default

Template rendering information flow request method (TTNativeExpressAd)

Note: The template ad request method requires the developer to set the setExpressViewAcceptedSize parameter in dp.
If the height is set to 0, the returned view will be highly adaptive according to the different templates checked on the platform.

Create TTAdNative object

复制

Create ad request AdSlot

复制

Parameter description

Parameter

Description

setCodeId

The code ID created by the platform starts with 9 and 9 digits

setAdCount

The number of requests is 1-3. It is recommended to set to 1

setExpressViewAcceptedSize

Set the size of the request template creative unit: dp

Note: In the parameter setting of the desired personalized template size, the personalized template Draw video ad height cannot be set to 0

Request ads

The access party can call loadExpressDrawFeedAd(AdSlot adSlot, @NonNull NativeExpressAdListener listener) to load ads asynchronously
Note: The click event registration time is before the ad render, otherwise it will affect the display and click data reporting

复制

NativeExpressAdListener Description

Callback

Description

onError()

Advertisement request failed callback The returned error code (code) indicates the reason why the advertisement request failed,详情请见链接

onNativeExpressAdLoad()

Callback for successful ad request, the client can call render() in this callback for ad rendering

Ad click event listener

复制

ExpressAdInteractionListener Description

Callback

Description

onAdClicked()

The callback of the ad click, the action after the click is controlled by the sdk.

onAdShow()

Advertisement display callback, display volume can be counted in the method provided by CSJ

onRenderFail()

Personalized template rendering failed

onRenderSuccess()

The personalized template is rendered successfully, the client can directly add the view of the advertisement to the control to be displayed in the callback

Note: After loading the ad, call the TTNativeExpressAd.render() method to render the ad. In the onRenderSuccess(View view, float width, float height) callback, handle the logic of adding the ad view, width&height is The width and height of the ad.

视频状态监听

复制

ExpressVideoAdListener description

Method

Description

onVideoLoad()

Video ad loaded successfully callback

onVideoError()

Video ad loading failed callback

onVideoAdStartPlay()

Video ad show callback

onVideoAdPaused()

Video ad pause callback

onVideoAdContinuePlay()

Video ad rebroadcast callback

onProgressUpdate()

Video ad playback progress callback

onVideoAdComplete()

Video ad playback complete callback

onClickRetry()

Video ad click replay callback

Destroy the ad object

复制

Reference Demo

For template Draw ads, please refer to the DrawNativeExpressVideoActivity example in Demo

Template rendering Draw Note:

  1. The personalized template Draw ad does not support dislike logic.
  2. In the parameter setting of the template size, the height of the personalized template Draw video advertisement cannot be set to 0


Contents
Contact us