const { regClass } = Laya;
import { VideoRuntimeBase } from "./VideoRuntime.generated";
@regClass()
export class VideoRuntime extends VideoRuntimeBase {
onEnable(): void {
Laya.stage.on(Laya.Event.MOUSE_DOWN, () => {
//Laya.loader.load("resources/files/layaAir.mp4").then(() => {
this.VideoNode.play(); //播放视频
//});
})
}
}
Laya.loader.load没有必要,在IDE里面已经赋予网络地址了。参考下VideoPlayIn3DWorld