目录

AdsNativeVideo

Overview

Video player component for native ads.

Parameters

Parameter

Mandatory

Type

Description

radius

No

number

Radius for rounded corners of the component's outer frame.

startMute

No

number

Indicates whether to start playing a video in mute mode.

  • 0: no.
  • 1: yes.

autoplaynet

No

number

Indicates whether videos are automatically played when a mobile data network is used.

  • 0: no
  • 1: yes

videoautoplay

No

string

Indicates whether videos are automatically played.

  • y: yes
  • n: no

If you want videos to be automatically played on both Wi-Fi and mobile data networks, set videoautoplay to y and autoplaynet to 1.

If you want videos to be automatically played only on Wi-Fi networks, set videoautoplay to y and autoplaynet to 0.

If you do not want videos to be automatically played, set videoautoplay to n.

Methods

Method

Description

Parameter

Return Value

play(auto)

Plays a video.

The parameter in the method is of the Boolean type.

  • true: Play a new video after the video on the current page is played.
  • false: Play a new video immediately.

-

pause()

Pauses video playback.

-

-

stop()

Stops video playback.

-

-

Events

Event

Description

Usage

Description

videoStart

Triggered when the video starts playing.

adsNativeVideoView.addEventListener('videoStart',callback)

Parameter in callback:

adId: ID of an ad asset.

videoPause

Triggered when the video playback pauses.

adsNativeVideoView.addEventListener('videoPause',callback)

videoResume

Triggered when the video playback resumes.

adsNativeVideoView.addEventListener('videoResume',callback)

videoComplete

Triggered when the video playback is completed.

adsNativeVideoView.addEventListener('videoComplete',callback)

videoError

Triggered when an error occurs during the video playback.

adsNativeVideoView.addEventListener('videoError',callback)