private _video: Laya.VideoNode;
private PlayerVideo() {
//this.VideoIcon fgui的图形,视频播放的位置
DebugLog.log("**** 播放视频");
this.VideoIcon.visible = true;
if (!this._video) {
this._video = new Laya.VideoNode();
this._video.set_width(this.VideoIcon.width);
this._video.set_height(this.VideoIcon.height);
this.VideoIcon.setNativeObject(this._video);
}
this._video.source = "resources/video/video_1.mp4";
this._video.play();
this._video.videoTexture.on("ended", this, () => {
//结束回调
this.VideoIcon.visible = false;
});
}
Laya3.0 播放视频(fgui搭建的界面)
最新推荐文章于 2024-07-10 17:30:15 发布