diff --git a/src/miniprogram/node/node.js b/src/miniprogram/node/node.js index 19e57f4..76d3d2b 100644 --- a/src/miniprogram/node/node.js +++ b/src/miniprogram/node/node.js @@ -55,7 +55,15 @@ Component({ * @param {Event} e */ play (e) { - this.root.triggerEvent('play') + const i = e.target.dataset.i + const node = this.getNode(i) + this.root.triggerEvent('play', { + source: node.name, + attrs: { + ...node.attrs, + src: node.src[this.data.ctrl[i] || 0] + } + }) if (this.root.properties.pauseVideo) { let flag = false const id = e.target.id diff --git a/src/uni-app/components/mp-html/node/node.vue b/src/uni-app/components/mp-html/node/node.vue index a509b83..d09cf85 100644 --- a/src/uni-app/components/mp-html/node/node.vue +++ b/src/uni-app/components/mp-html/node/node.vue @@ -185,7 +185,15 @@ export default { * @param {Event} e */ play (e) { - this.root.$emit('play') + const i = e.currentTarget.dataset.i + const node = this.childs[i] + this.root.$emit('play', { + source: node.name, + attrs: { + ...node.attrs, + src: node.src[this.ctrl[i] || 0] + } + }) // #ifndef APP-PLUS if (this.root.pauseVideo) { let flag = false