[图片][图片]
平面 AR能力导致材质出错?使用平面AR能力(wx.createVKSession)导致引入的模型材质出现问题,但是直接引入却未发现
2023-03-31const mLoadWxVideo(src: string, x: number, repeat: boolean) { const mVideoWidth = 800; const mVideoHeight = 1334; const { screenHeight } = wx.getSystemInfoSync(); const vVideoWidth = (mVideoWidth * screenHeight) / mVideoHeight; const vWxVideo = wx.createVideo({ src, x, y: 0, width: vVideoWidth, height: screenHeight, autoplay: false, loop: repeat, controls: false, showCenterPlayBtn: false, enableProgressGesture: false, objectFit: 'cover', underGameView: true, }); return vWxVideo; } const PVideoCardFrame = [ [4.04, 5.55], [9.04, 11.04], [16.01, 18.01], [21.21, 23.19], [27.07, 28.63], [34.02, 35.6], [41.05, 43.05], [48.18, 50.18], ]; const mVideoWidth = 800; const mVideoHeight = 1334; const { screenWidth, screenHeight } = wx.getSystemInfoSync(); const vVideoWidth = (mVideoWidth * screenHeight) / mVideoHeight; const vVideoOffsetX = (vVideoWidth - screenWidth) / 2; const vVideo = this.mLoadWxVideo(`https://acsp-static.sit.sf-express.com/sfoss/annual-report/videos/normal.mp4`, -vVideoOffsetX, false); let vTimer = false; // 监听视频播放事件 vVideo.onPlay(() => { // console.log(`第${this._mPageIndex + 1}个非循环视频开始播放`); console.log('onPlay。。。。'); if (!vTimer) { vTimer = true; this.mScriptLoading.MAddProgress(); } }); // 监听视频播放到末尾事件 vVideo.onProgress((res) => { if (res.buffered > 5) { vVideo.play(); } }); vVideo.onTimeUpdate((res) => { if (res.position >= PVideoCardFrame[this.mPageIndex][1]) { const vTimer = res.position - PVideoCardFrame[this.mPageIndex][1]; vVideo.pause(); vVideo.seek(PVideoCardFrame[this.mPageIndex][0] + vTimer).then(res => { vVideo.play(); }); } });
在小游戏中使用 Video.seek 视频跳转时,画面会抖动一下ios 机型 seek 不会自动播放,而安卓机型会自动播放 // 监听视频播放进度 vVideo.onTimeUpdate((res) => { if (res.position >= PVideoCardFrame[this.mPageIndex][1]) { const vTimer = res.position - PVideoCardFrame[this.mPageIndex][1]; vVideo.pause(); vVideo.seek(PVideoCardFrame[this.mPageIndex][0] + vTimer).then(res => { vVideo.play(); }); } });
2022-11-16怎么在微信小游戏上有读取视频中每一帧转成图片的方法吗
视频文档不清晰let src = 'https://acsp-static.sit.sf-express.com/assets-web/images/annual/2022/video.mp4'; let info = wx.getSystemInfoSync(); let video = wx.createVideo({ x: 0, y: 0, width: info.windowWidth, height: info.windowHeight, autoplay: false, controls: false, showCenterPlayBtn: false, enableProgressGesture: false, objectFit: 'cover', src: src, }); video.play(); video.onWaiting(()=>{ console.log("onWaiting"); }); video.onPlay(()=>{ console.log("开始播放!"); }); video.onError((msg)=>{ console.log("出错了!",msg); }); 视频播放不了,也不能监听
2022-09-29