Skip to content

广告播放组件

第1步:package.json引入库

点击查看源码
js
"@extscreen/es-component": "3.0.1",
"@extscreen/es-player": "x.x.x",

第2步:main-native.js中注册组件

点击查看源码
js
import {ESComponent} from "@extscreen/es-component";
Vue.use(ESComponent)

第3步:ESPage页面中中引入组件

点击查看源码
vue

<template>
  <div class="es-ad-player-root-css">
    <es-ad-player-view-component
        ref="ad_view"
        class="es-ad-view-root"
        :on-duration-changed-callback="onDurationChanged"
        :on-progress-changed-callback="onProgressChanged"
        @player-volume-changed="onPlayerVolumeChanged"
        @player-left-volume-changed="onLeftVolumeChanged"
        @player-right-volume-changed="onRightVolumeChanged"
        @player-status-changed="onPlayerStatusChanged"
        @canExitTime="onPlayerCanExitTime"
        @player-info="onPlayerInfo"
        @player-error="onPlayerError"/>
  </div>
</template>