微信小游戏VideoPlayer的stayOnBottom无效

微信小游戏VideoPlayer的stayOnBottom无效,web端是有效果的。

我打赌没人知道怎么解决 :slightly_smiling_face:

1赞

你好,这个功能目前并没有适配微信小游戏。

解决方案来啦:

// 微信端就用微信自己的视频播放器API吧
const frameSize = cc.view.getFrameSize();
this.wxVideo = wx.createVideo({
    x: 0,
    y: 0,
    width: frameSize.width,
    height: frameSize.height,
    src: "https://www.xxx.com/aaa.mp4",
    initialTime: 0,
    controls: false,
    showProgress: false,
    showProgressInControlMode: false,
    autoplay: true,
    underGameView: true, // 这句是关键
});
this.wxVideo.onplay = () => {
    console.log("开始播放");
};
this.wxVideo.ontimeupdate = res => {
    console.log("进度更新");
};
this.wxVideo.onended = () => {
    console.log("结束播放");
};
2赞

mark!

mark~也是被美女包围那种类型的游戏?