我也出现了 请问解决了吗?
Video视频在IOS端正常播放,在安卓手机上一直播放不了https://beto.oss-cn-hangzhou.aliyuncs.com/txky1145134089304dac62d434c742faa360e18f88f73682.mp4 这是视频源 <video id="myVideo" src="{{worksVideoUrl}}" custom-cache="{{false}}" autoplay loop direction bindtap='videoTap' controls="{{false}}" style="height:{{height}}px"> </video>
2020-09-10请问解决了吗
视频videoContext play方法在安卓上无效使用wx.createVideoContext创建ctx对象,点击按钮执行ctx.play()方法,在iOS可以触发播放,在安卓上则不行。 以及,在调试工具中输出ctx对象,发现原型链上没有ctx方法。 另外,亲测: wx.createVideoContext的构造时机没问题,在onReady和在onLoad中构造都一样 视频本身没有问题,在浏览器中可以访问。 基础库版本1.7.0,微信版本6.5.22,不会是版本过低的问题。 把video-compnent的hidden改为false,也不会解决问题。 以及,重点是:上上周这样的写法是没有问题的。。。这周就不行了 wxml: [代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"section tc"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"video-item"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码][代码] [代码][代码]data-id[代码][代码]=[代码][代码]"{{ video.id }}"[代码][代码] [代码][代码]catchtap[代码][代码]=[代码][代码]"handleTap"[代码][代码] [代码][代码]class[代码][代码]=[代码][代码]"video-item-discover"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]class[代码][代码]=[代码][代码]"video-item-discover-bg"[代码] [代码]src[代码][代码]=[代码][代码]"{{ video.preview_pic_url }}"[代码] [代码]/>[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]class[代码][代码]=[代码][代码]"video-item-btn"[代码] [代码]src[代码][代码]=[代码][代码]"/images/write-question/ic-reload@3x.png"[代码] [代码]/>[代码][代码] [代码][代码]view[代码][代码]>[代码][代码][代码][代码][代码][代码] [代码][代码][代码][代码][代码][代码][代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"video-component"[代码] [代码]hidden[代码][代码]=[代码][代码]"{{ true }}"[代码][代码]>[代码][代码][代码][代码][代码][代码] [代码][代码]<[代码][代码]video[代码][代码][代码][代码][代码][代码] [代码][代码]id[代码][代码]=[代码][代码]"{{ video.id }}"[代码][代码][代码][代码][代码][代码] [代码][代码]data-id[代码][代码]=[代码][代码]"{{ video.id }}"[代码][代码][代码][代码][代码][代码] [代码][代码]controls[代码][代码]=[代码][代码]"{{ true }}"[代码][代码][代码][代码][代码][代码] [代码][代码]bindplay[代码][代码]=[代码][代码]"handleVideoPlayEvent"[代码][代码][代码][代码][代码][代码] [代码][代码]bindpause[代码][代码]=[代码][代码]"handleVideoPauseEvent"[代码][代码][代码][代码][代码][代码] [代码][代码]bindended[代码][代码]=[代码][代码]"handleVideoEndedEvent"[代码][代码][代码][代码][代码][代码] [代码][代码]bindfullscreenchange[代码][代码]=[代码][代码]"handleVideoFullScreenEvent"[代码][代码][代码][代码][代码][代码] [代码][代码]src[代码][代码]=[代码][代码]"{{ video.cdn_url }}"[代码][代码][代码][代码][代码][代码] [代码][代码]poster[代码][代码]=[代码][代码]"{{ video.preview_pic_url }}"[代码] [代码]/>[代码][代码][代码][代码][代码][代码] [代码][代码]view[代码][代码]>[代码][代码][代码][代码][代码][代码][代码][代码][代码][代码] [代码][代码]view[代码][代码]>[代码][代码][代码][代码][代码][代码][代码][代码][代码][代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"btn-area"[代码][代码]>[代码][代码][代码][代码][代码][代码][代码][代码] [代码][代码]<[代码][代码]input[代码] [代码]bindblur[代码][代码]=[代码][代码]"bindInputBlur"[代码][代码]/>[代码][代码][代码][代码][代码][代码][代码][代码] [代码][代码]<[代码][代码]button[代码] [代码]bindtap[代码][代码]=[代码][代码]"handleTap"[代码] [代码]data-id[代码][代码]=[代码][代码]"{{ Num }}"[代码][代码]>点击播放button[代码][代码]>[代码][代码][代码][代码][代码][代码][代码] [代码][代码]view[代码][代码]>[代码][代码][代码][代码][代码][代码][代码][代码][代码][代码]>[代码][代码][代码][代码][代码]index.js [代码]const config = {[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]Num: 12345,[代码][代码] [代码][代码]video: {[代码][代码] [代码][代码]id: 12345,[代码][代码] [代码][代码]preview_pic_url: [代码][代码]'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000'[代码][代码],[代码][代码] [代码][代码]cdn_url: [代码][代码]'http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]videoContextList: [][代码][代码] [代码][代码]},[代码][代码] [代码][代码]onLoad () {[代码][代码] [代码][代码]const { Num } = [代码][代码]this[代码][代码].data;[代码][代码] [代码][代码]// this.videoContext = wx.createVideoContext(String(Num));[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]videoContextList: [[代码][代码] [代码][代码]{ id: Num, ctx: wx.createVideoContext(String(Num))}[代码][代码] [代码][代码]][代码][代码] [代码][代码]});[代码][代码] [代码][代码]},[代码][代码] [代码][代码]getVideoContext(id) {[代码][代码] [代码][代码]const { videoContextList } = [代码][代码]this[代码][代码].data;[代码][代码] [代码][代码]// 对每一个video都按照单例模式设置[代码][代码] [代码][代码]return[代码] [代码]videoContextList.find(video => video.id === id).ctx || wx.createVideoContext(String(id));[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 点击图片开始播放[代码][代码] [代码][代码]* @param {*} event[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]handleTap(event) {[代码][代码] [代码][代码]const { currentTarget: { dataset: { id }}} = event;[代码][代码] [代码][代码]const ctx = [代码][代码]this[代码][代码].getVideoContext(id);[代码][代码] [代码][代码]console.log(ctx);[代码][代码] [代码][代码]// 点击图片时,必然是非全屏状态,此时必然没有播放,直接play即可[代码][代码] [代码][代码]ctx.play();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 视频播放事件处理函数[代码][代码] [代码][代码]* 开始播放时自动全屏[代码][代码] [代码][代码]* @param {*} event 播放[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]handleVideoPlayEvent(event) {[代码][代码] [代码][代码]const { currentTarget: { dataset: { id }}} = event;[代码][代码] [代码][代码]const ctx = [代码][代码]this[代码][代码].getVideoContext(id);[代码][代码] [代码][代码]console.log(ctx);[代码][代码] [代码][代码]ctx.requestFullScreen();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 视频暂停事件处理函数[代码][代码] [代码][代码]* @param {*} event 暂停[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]handleVideoPauseEvent(event) {[代码][代码] [代码][代码]console.log(event);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 全屏事件处理函数[代码][代码] [代码][代码]* @param {*} event 事件[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]handleVideoFullScreenEvent(event) {[代码][代码] [代码][代码]console.warn([代码][代码]'handleVideoFullScreenEvent'[代码][代码]);[代码][代码] [代码][代码]const { detail: { fullScreen }, target: { dataset: { id }} } = event;[代码][代码] [代码][代码]const ctx = [代码][代码]this[代码][代码].getVideoContext(id);[代码][代码] [代码][代码]console.log(ctx);[代码][代码] [代码][代码]// 退出全屏时,若正在播放,则自动暂停,且跳到起始位置[代码][代码] [代码][代码]if[代码] [代码](!fullScreen) {[代码][代码] [代码][代码]ctx.seek(0);[代码][代码] [代码][代码]ctx.pause();[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码] [代码][代码]/**[代码][代码] [代码][代码]* 视频播放到末尾的处理函数[代码][代码] [代码][代码]* @param {*} event 自然播放结束[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]handleVideoEndedEvent(event) {[代码][代码] [代码][代码]console.log(event);[代码][代码] [代码][代码]}[代码][代码]};[代码] [代码]Page(config);[代码]wxss样式 [代码].video-item {[代码][代码] [代码][代码]width: 100%;[代码][代码] [代码][代码]height: 100%;[代码][代码]}[代码][代码].video-item video {[代码][代码] [代码][代码]width: 100%;[代码][代码] [代码][代码]height: 100%;[代码][代码]}[代码][代码].video-item .video-item-discover{[代码][代码] [代码][代码]position: relative;[代码][代码] [代码][代码]width:100%;[代码][代码] [代码][代码]height:100%;[代码][代码]}[代码][代码].video-item .video-item-discover .video-item-btn{[代码][代码] [代码][代码]position: absolute;[代码][代码] [代码][代码]width: 70rpx;[代码][代码] [代码][代码]height: 70rpx;[代码][代码] [代码][代码]top: 50%;[代码][代码] [代码][代码]left: 50%;[代码][代码] [代码][代码]transform: translate(-50%, -50%);[代码][代码] [代码][代码]z-index: 100;[代码][代码]}[代码][代码].video-item .video-item-discover .video-item-discover-bg{[代码][代码] [代码][代码]width: 100%;[代码][代码] [代码][代码]height: 100%;[代码][代码] [代码][代码]filter: brightness(0.6);[代码][代码]}[代码][代码].section.tc {[代码][代码] [代码][代码]display: flex;[代码][代码] [代码][代码]align-items: center;[代码][代码] [代码][代码]justify-content: center;[代码][代码] [代码][代码]flex-wrap: wrap;[代码][代码]}[代码][代码].section.tc .video-item .video-item-discover{[代码][代码] [代码][代码]width: 200px;[代码][代码] [代码][代码]height: 200px;[代码][代码] [代码][代码]flex-basis: 100vw;[代码][代码] [代码][代码]margin: 0 auto;[代码][代码]}[代码]
2020-09-10兄弟解决了吗 我也遇到这个问题了
小程序横屏模式下 live-player 与 live-pusher 的方向反了- 当前 Bug 的表现(可附上截图) - 预期表现 - 复现路径 - 提供一个最简复现 Demo 设置 pageOrientation = landscape live-player 与 live-puhser 的 orientation 值一致,但是各自看到对方的画面就是被旋转了。
2020-06-24兄弟问题解决了吗 我现在也是这个问题
BackgroundAudioManager的protocol参数不生效。文档明确指出: [图片] 但是,当src为m3u8时,报10001。 js为: const backgroundAudioManager = wx.getBackgroundAudioManager() backgroundAudioManager.title = event.currentTarget.dataset.title; backgroundAudioManager.startTime = 0; backgroundAudioManager.protocol = 'hls'; backgroundAudioManager.epname = 'xx广播电视台'; backgroundAudioManager.singer = '广播中心'; backgroundAudioManager.coverImgUrl = 'https://v.bak.domain.com/imgs/logo-ljtv.png'; // 设置了 src 之后会自动播放 backgroundAudioManager.src = 'https://v.bak.domain.com/hls/music/fm106.m3u8'; backgroundAudioManager.play(); 确认该url可正常播放。请管理员和各位大侠指导。非常感谢! [图片]
2020-06-18[图片]
wx.previewImage API已经显示调用成功了 但是图一直在转圈?[图片][图片][图片][图片]
2019-08-28