Commit 06bdf838 authored by liupengfei's avatar liupengfei

正式

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