WX小游戏平台视频播放如何设置全屏

我的代码如下:
private _adatpterWXPlatform() {

    if(sys.platform == sys.Platform.WECHAT_GAME) {

        let impl = this._videoPlayer["_impl"];

        const self = this; // 保存外部this的引用

        impl.createVideoPlayer = function (url) {

            //@ts-ignore

            if (!wx.createVideo) {

                console.warn('VideoPlayer not supported');

                return;

            }



            if (!this._video) {

                //@ts-ignore

                this._video = wx.createVideo({

                    underGameView: true,

                    zIndex:-9999,

                });

                this._video.showCenterPlayBtn = false;

                this._video.controls = false;

                this._duration = 0;

                // this.

                this._currentTime = 0;

                this._loaded = false;

                this.setVisible(this._visible);

                this._bindEvent();

                this._forceUpdate = true;

                const screenSize = view.getVisibleSize();

                this.height = screenSize.height;

               

                // 使用工具函数设置视频尺寸,这里可以根据需要调整宽高值

                // 视频的原始尺寸就是1080*1920固定的

                // console.log("视频加载中")

                // const screenSize = view.getVisibleSize();

               

                // self._setVideoSize(this._video, 1080/1920*screenSize.height, screenSize.height);

            }



            this.setURL(url);

            this._forceUpdate = true;

            // setTimeout(() => {

            //     makeNodeFillScreen(this.node);

            // }, 30);

           

        }

    }

}

目前看来,视频的放大比例偏高,在Y方向上撑不满屏幕。
我想要的效果是,视频在Y方向上撑满屏幕。

wx.createVideo({objectFit: “cover” });

试了一下,Y方向撑满屏幕了,但是撑得又太多了。
检查了一下,应该Y和X方向都溢出手机屏幕了。
显示的视频比例过大,要怎么解决?

wx.createVideo({

        x: 0,

        y: 0,

        width: window.innerWidth,

        height: window.innerHeight,

        objectFit: "cover",

    });

这样设置,还是溢出了屏幕

你视频分辨率是多少,我用的是480*854,为了适配各种屏幕,肯定会有溢出的,出视频的时候就要留好安全区域,不能太靠近边缘