Skip to content

Commit

Permalink
fix(components): 修复跳转时视频继续播放的问题, fix NervJS#5412
Browse files Browse the repository at this point in the history
  • Loading branch information
Littly authored and jiangzm committed Dec 7, 2020
1 parent dcc4336 commit 03a24f5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/taro-components/src/components/video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Video组件的样式参考了[uni-app](https://github.com/dcloudio/uni-app/tree/master/packages/uni-h5)的实现
*/

import Taro from '@tarojs/taro-h5'
import Nerv, { Component, createPortal } from 'nervjs'
import classnames from 'classnames'
import Danmu from './danmu'
Expand Down Expand Up @@ -412,6 +413,12 @@ class Video extends Component {
componentDidMount () {
this.unbindTouchEvents = this.bindTouchEvents()
this.sendDanmu(this.props.danmuList)

Taro.eventCenter.on('__taroRouterChange', () => {
if (this.state.isPlaying) {
this.stop()
}
})
}

componentWillReceiveProps (nProps) {
Expand Down

0 comments on commit 03a24f5

Please sign in to comment.