veplayer-mp-wechat
Advanced tools
Comparing version 0.1.11 to 0.1.12
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const eventemitter3_1 = require("eventemitter3"); | ||
const xgplayer_service_miniprogram_1 = require("xgplayer-service-miniprogram"); | ||
const xgplayer_service_miniprogram_1 = require("xgplayer-service-miniprogram/index.js"); | ||
const videoBehavior_1 = require("./behaviors/videoBehavior"); | ||
@@ -15,7 +15,13 @@ const collectorBehavior_1 = require("./behaviors/collectorBehavior"); | ||
controls: { | ||
type: String, | ||
type: String || Boolean, | ||
optionalTypes: [Boolean], | ||
value: 'custom', | ||
observer(newVal, oldVal, _changedPath) { | ||
// console.log(`!!!!!Player${this.data.videoId} controls:`, `newVal:${newVal}, oldVal:${oldVal}, !!newVal:${!!newVal}`); | ||
const { customControls } = this.data; | ||
// console.log(`>>>Player${this.data.videoId} controls:`, `newVal:${newVal}, oldVal:${oldVal}, !!newVal:${!!newVal} customControls:${customControls}`); | ||
if (!customControls) { | ||
this.setData({ | ||
customControls: newVal === 'native' ? false : newVal | ||
}); | ||
} | ||
if (newVal !== 'native') { | ||
@@ -82,3 +88,4 @@ newVal ? this.focusPlayer(false) : this.blurPlayer(); | ||
playbackDefinitionList: undefined, | ||
isFocus: true | ||
isFocus: true, | ||
customControls: false // 控制栏初始状态 | ||
}, | ||
@@ -156,2 +163,3 @@ observers: { | ||
const { videoId, videoProps, isFullScreen, loadedMeta, toggleCtrlOverLayer, ended } = this.data; | ||
const { controls } = this.properties; | ||
// console.log('>>>>Player attached', this.properties.loggerInfo) | ||
@@ -163,3 +171,4 @@ let _videoId = videoId || this.properties.componentId; | ||
this.setData({ | ||
videoId: _videoId | ||
videoId: _videoId, | ||
customControls: controls !== 'native' ? controls : false | ||
}); | ||
@@ -238,3 +247,3 @@ const videoCtx = wx.createVideoContext(_videoId, this); | ||
} | ||
// console.log(`!!!!!Player${videoId} focusPlayer`, `isFocus:${isFocus}, controls:${controls}`) | ||
// console.log(`!!!!!Player ${videoId} focusPlayer`, `isFocus:${isFocus}, controls:${controls}`) | ||
needAutoHide && (this.fTimer = setTimeout(() => { | ||
@@ -343,3 +352,3 @@ this.blurPlayer(); | ||
onTimeupdate(e) { | ||
const { seeking } = this.data; | ||
const { seeking, paused } = this.data; | ||
const { currentTime, duration } = e.detail; | ||
@@ -356,2 +365,5 @@ // console.log('Math.floor((currentTime / duration) * 100)', Math.floor((currentTime / duration) * 100)) | ||
} | ||
if (paused) { | ||
data.paused = false; | ||
} | ||
this.setData(data); | ||
@@ -358,0 +370,0 @@ this._emitEvt(index_1.MediaEvents.TIMEUPDATE, e); |
{ | ||
"name": "veplayer-mp-wechat", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "miniprogram": "dist", |
Sorry, the diff of this file is not supported yet
114316
2007