Skip to content

Commit

Permalink
fixed: VideoTexture.ts push error bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lirongf committed Mar 29, 2024
1 parent da5f60d commit 0cfb087
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/layaAir/laya/media/VideoTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ export class VideoTexture extends BaseTexture {
} else {
this._needUpdate = true;
}
//ios微信浏览器环境下默认不触发loadedmetadata,在主动调用play方法的时候才会触发loadedmetadata事件
if (ILaya.Browser.onWeiXin) {
this.loadedmetadata();
}

}

private isNeedUpdate() {
Expand Down Expand Up @@ -452,8 +449,16 @@ export class VideoTexture extends BaseTexture {

destroy() {
var isConchApp: boolean = LayaEnv.isConch;
if (isConchApp) {
(<any>this.element)._destroy();
if (this.element) {
if (LayaEnv.isConch) {
(<any>this.element)._destroy();
}
else {
this.element.pause();
this.element.src = "";
while (this.element.childElementCount)
this.element.firstChild.remove();
}
}

ILaya.timer.clear(this, this.render);
Expand Down

0 comments on commit 0cfb087

Please sign in to comment.