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

refine script to fix videoplayer some play issue #824

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

mmyduckx
Copy link
Contributor

@mmyduckx mmyduckx commented Jul 19, 2023

https://github.com/cocos/3d-tasks/issues/10920

  • cancel check Play On Awake
  • call videoPlayer.play() after load video source other than listening VideoPlayer.Event to prevent call play() on unpredictable time.

Please do not merge before finishing test v3.8.0.
Rely on PR: cocos/cocos-engine#15782

this.videoPlayer.clip = this.videClip;
}
if (!this.videoPlayer.isPlaying) {
this.videoPlayer.play();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why need to check the status before playing? VideoPlayer will not check the status?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, it may cause to replay.

Copy link
Contributor Author

@mmyduckx mmyduckx Jul 20, 2023

Choose a reason for hiding this comment

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

Currently, we do not have this check in VideoPlayer. And different platform have different strategies when repeatly call play. So I think it's a foolproof way to check in script.

this.videoPlayer.play();
}
else {
if (this.videoPlayer.remoteURL !== remoteURL) {
this.videoPlayer.remoteURL = remoteURL;
Copy link
Contributor

Choose a reason for hiding this comment

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

The same as above.

@minggo minggo merged commit ac7553b into cocos:v3.8 Jul 20, 2023
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.

2 participants