Skip to content

Commit

Permalink
fix(h5):修复Video组件ref为空而无法暂停播放的问题(#8550)
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and superNos committed Jan 20, 2021
1 parent 6fc25d6 commit e1fe8f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/taro-components/src/components/video/video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,11 @@ export class Video implements ComponentInterface {
style={{
'object-fit': objectFit
}}
ref={dom => (this.videoRef = dom as HTMLVideoElement)}
ref={dom => {
if (dom) {
this.videoRef = dom as HTMLVideoElement
}
}}
src={src}
autoplay={autoplay}
loop={loop}
Expand Down

0 comments on commit e1fe8f2

Please sign in to comment.