veplayer-mp-douyin
Advanced tools
Comparing version 1.2.3-alpha.4 to 1.2.3-alpha.6
@@ -48,2 +48,7 @@ "use strict"; | ||
}, | ||
observers: { | ||
'albumId, episodeId': function () { | ||
this._videoPlayerCanPlay = false; | ||
} | ||
}, | ||
methods: { | ||
@@ -50,0 +55,0 @@ onGetSource(e) { |
@@ -27,3 +27,3 @@ "use strict"; | ||
exports.PKG = 'douyin'; | ||
exports.VERSION = '1.2.3-alpha.4'; | ||
exports.VERSION = '1.2.3-alpha.6'; | ||
/** | ||
@@ -30,0 +30,0 @@ * 控制栏状态枚举 |
@@ -249,2 +249,28 @@ "use strict"; | ||
} | ||
if (prop === 'play') { | ||
const playFn = Reflect.get(target, 'play', receiver); | ||
return () => new Promise((resolve, reject) => { | ||
self.media.once(index_1.MediaEvents.ERROR, (err) => { | ||
reject(err); | ||
}); | ||
// 注意这里IDE模拟器里,即使地址之类错误,也会触发一次TIMEUPDATE,而真机则不会,可忽略IDE的行为 | ||
self.media.once(index_1.MediaEvents.TIMEUPDATE, () => { | ||
resolve(null); | ||
}); | ||
if (tagType === 'video-player') { | ||
if (self._videoPlayerCanPlay) { | ||
playFn(); | ||
} | ||
else { | ||
self.media.once(index_1.MediaEvents.GETSOURCE, () => { | ||
self._videoPlayerCanPlay = true; | ||
playFn(); | ||
}); | ||
} | ||
} | ||
else { | ||
playFn(); | ||
} | ||
}); | ||
} | ||
return Reflect.get(target, prop, receiver); | ||
@@ -327,2 +353,3 @@ }, | ||
const evData = Object.assign(Object.assign({ e, data: this.data }, e.detail), err); | ||
this._emitEvt(index_1.MediaEvents.ERROR, e); | ||
this.triggerEvent(index_1.MediaEvents.ERROR, evData); | ||
@@ -329,0 +356,0 @@ this.triggerCollector(index_1.MediaEvents.ERROR, evData); |
{ | ||
"name": "veplayer-mp-douyin", | ||
"version": "1.2.3-alpha.4", | ||
"version": "1.2.3-alpha.6", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "miniprogramType": "tt-npm", |
Sorry, the diff of this file is not supported yet
159664
3000