Commit 06bdf838 authored by liupengfei's avatar liupengfei

正式

parent 501285e7
......@@ -100,7 +100,6 @@
/* fenge */
.video-loading {
/* background: url('//yun.dui88.com/advideo2020viewfile.gif') no-repeat; */
background-size: contain;
background-color:black;
width: 100%;
......
This diff is collapsed.
This diff is collapsed.
......@@ -10,7 +10,7 @@
<meta name="screen-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
<meta name="360-fullscreen" content="true" />
<link rel="stylesheet" type="text/css" href="./advideo.css" />
<link rel="stylesheet" type="text/css" href="./advideo2.css" />
<style>
html,
body {
......
......@@ -34,6 +34,7 @@ class MyAdvideo {
appContent: appContent;
isPlayEnd: boolean;
isPlaying: boolean;
playSuccessCloseCb : any;
constructor(config) {
this.el = config.el;
this._times = {
......@@ -135,6 +136,10 @@ class MyAdvideo {
this.isPlaying = false;
this.stragegyFn[this.strategy].report.videoClose(this.videoRaw, this._times);
this.isVideoIng = false;
this.isPlayEnd = false;
if (this.playSuccessCloseCb) {
this.playSuccessCloseCb();
}
this.hide();
});
}
......@@ -144,6 +149,7 @@ class MyAdvideo {
if (this.isVideoIng) {
return;
}
this.reset();
this.isVideoIng = true;
this.strategy = 'dianxing';
const res = await this.stragegyFn[this.strategy].getVideo(type);
......
......@@ -3,7 +3,7 @@ export default {
controls: false,
playsInline: true,
preload: 'auto',
poster: '//yun.dui88.com/h5-mani/makeMoney/video/viewfile.gif',
poster: '//yun.dui88.com/advideo2020viewfile.gif',
'x5-video-player-fullscreen': true,
'x5-video-orientation': 'landscape|portrait',
'x5-video-player-type': 'h5',
......
......@@ -40,6 +40,11 @@ class EventEmitter {
removeAll() {
this._events = {};
}
removeEvent(event) {
if (this._events[event]) {
this._events[event] = [];
}
}
}
export default EventEmitter;
......@@ -10,6 +10,7 @@ let videoContanier = document.querySelector('#video-contanier');
// 消消乐的监听
window['playingVideoClose'] = () => {
if (videoIns && videoIns.isPlaying) {
console.log('正在播放中');
videoIns.isPlaying = false;
videoIns.hide();
videoIns.player.$video.src = '';
......@@ -18,6 +19,7 @@ window['playingVideoClose'] = () => {
return '0';
}
if (videoIns && videoIns.isPlayEnd) {
console.log('播放完成');
videoIns.player.emit('$videoClose');
playBg();
return '0'
......@@ -43,10 +45,10 @@ export const handleVideo = (
videoIns.play().then(() => {
// completeCallback();
})
videoIns.player.event.once('$videoClose', () => {
videoIns.playSuccessCloseCb = () => {
console.log('呗调用');
returnCallback(true);
playBg();
})
}
} else {
showToast("广告准备中,请稍后再试");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment