Skip to content
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: keepAspectRatio invalid when update clip

Merged
merged 1 commit into from Feb 10, 2020

Conversation

knoxHuang
Copy link
Contributor

@knoxHuang knoxHuang commented Feb 4, 2020

Re: cocos/2d-tasks#2458

Changes:

  • 修复通过本地下载的视频 url,Keep Aspect Ratio 无效的问题

@@ -334,6 +334,7 @@ let VideoPlayer = cc.Class({
url = cc.loader.md5Pipe.transformURL(url);
}
this._impl.setURL(url, this._mute || this._volume === 0);
this._impl.setKeepAspectRatioEnabled(this.keepAspectRatio);
Copy link
Contributor

@holycanvas holycanvas Feb 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要不要加 CC_EDITOR 的判断,我看你下面是有这个判断的

Copy link
Contributor Author

@knoxHuang knoxHuang Feb 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不需要了,因为函数内已经有做 CC_EDITOR 判断了

image

@PPpro
Copy link
Contributor

PPpro commented Feb 10, 2020

备注:因为更新了 url,c++ 层会重新初始化视频的 keepAspectRatio
js 上需要再强制设置一次

PPpro
PPpro approved these changes Feb 10, 2020
@holycanvas holycanvas merged commit d3b55aa into cocos:v2.3.0-release Feb 10, 2020
1 check passed
@knoxHuang knoxHuang deleted the v2.3.0-bug branch Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants