-
Notifications
You must be signed in to change notification settings - Fork 215
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
Conversation
this.videoPlayer.clip = this.videClip; | ||
} | ||
if (!this.videoPlayer.isPlaying) { | ||
this.videoPlayer.play(); | ||
} |
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.
Why need to check the status before playing? VideoPlayer will not check the status?
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.
Ok, it may cause to replay.
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.
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; |
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.
The same as above.
https://github.com/cocos/3d-tasks/issues/10920
Play On Awake
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