Skip to content

Commit

Permalink
play事件增加返回src等信息 #526
Browse files Browse the repository at this point in the history
  • Loading branch information
jin-yufeng committed Apr 13, 2024
1 parent 875dc39 commit 047f4fb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/miniprogram/node/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion src/uni-app/components/mp-html/node/node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 047f4fb

Please sign in to comment.