Skip to content

Commit

Permalink
Fix the problem that the simulator reports errors and the real machin…
Browse files Browse the repository at this point in the history
…e does not display video on the Douyin mini game platform
  • Loading branch information
qiuguohua committed Dec 24, 2024
1 parent ca29ce0 commit 59e9ee9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ if (cc.internal.VideoPlayer) {
super(componenet);
this.videoNode = new cc.Node();
this.videoNode.addComponent(cc.Sprite);
this.videoNode.layer = this._node.layer;
this._node.insertChild(this.videoNode, 0);
}

Expand Down Expand Up @@ -166,12 +167,15 @@ if (cc.internal.VideoPlayer) {
if (!video || video.src === path) {
return;
}
video.stop();
const self = this;
if (self._playing) {
video.stop();
}
this._unbindEvent();
video.autoplay = true;
video.src = path;
video.muted = true;
const self = this;

this._loaded = false;
function loadedCallback () {
self._bindEvent();
Expand Down

0 comments on commit 59e9ee9

Please sign in to comment.