-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(h5): 修复 video methods #7891
fix(h5): 修复 video methods #7891
Conversation
https://github.com/helsonxiao/taro-tiktok |
const parentTagName = parentElement.tagName | ||
if (this.isFullScreen) { | ||
if (parentTagName !== 'BODY') { | ||
parentElement.removeChild(this.el) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一段我没理解原来想做什么,对于全屏以及退出全屏我没测出有影响,反而导致了 Safari 上全屏后自动退出。我先全删了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const timestamp = new Date().getTime() | ||
if (!e.detail && this.isFullScreen && !document[screenFn.fullscreenElement] && timestamp - this.fullScreenTimestamp > 100) { | ||
this.toggleFullScreen(false) | ||
} | ||
} | ||
|
||
@Listen('fullscreenchange') onNativeFullScreenChange (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里没必要监听这么多个,挺冗余的,用screenFn判断下监听吧
pauseFunc={this.pause} | ||
playFunc={this.play} | ||
seekFunc={this.seek} | ||
pauseFunc={() => this.pause()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此处的更改没有必要
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我加一些测试吧,现在处于 this 指向有问题,不能工作的状态。这里更改的原因是因为 this.pause
现在已经不是箭头函数了,如下。
/** 暂停视频 */
@Method() async pause () {
this.videoRef.pause()
}
上面这段代码说实话我不知道怎么改,才能让 stencil 即正常,这边又不用额外再新创建箭头函数。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
未能复现该问题,重新build一下试试把
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我加了测试,你可以试试直接用 this.play/this.pause/this.seek,在 control bar 里面调用的话 this 是不对的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
来晚了,感谢贡献
这个 PR 做了什么? (简要描述所做更改)
这个 PR 是什么类型? (至少选择一个)
这个 PR 满足以下需求:
这个 PR 涉及以下平台:
其它需要 Reviewer 或社区知晓的内容: