这个query的参数是怎么传的呀
onLaunch安卓中,小程序启动时,onLaunch 回调函数获取的场景参数scene:1014时, query:"{abc=123, gdf=100}", 是一个字符串,而且不是JSON格式的,解析起来十分困难; 而在 iOS中,query:是object,这个是正确的, 其他场景值没有测试过,另外说明一下,反复检查了模板消息中的page参数,确认没有问题 [图片]
2018-07-17请问问题解决了吗 我也遇到了 有的能放有的不能放
微信小程序Android手机不可以播放 audio的m3u8src地址: http://hls2.xxx.cn/xxx.m3u8 wxml文件: <audio id="myaudio" class="w-audio" bindplay="play" poster="{{audio.poster}}" name="{{audio.name}}" author="{{audio.author}}" src="{{audio.src}}" action="{{action}}" controls ></audio> PC端开发者工具提示:VM3488:2 Uncaught (in promise) NotSupportedError: Failed to load because no supported source was found. IOS 手机可以播放m3u8地址正常。 Android手机不可以播放,也没有报错。 请问有人遇到吗?如何解决的?
2018-05-21onHide的时候用 this.ctx.stop()事件呢
live-player页面隐藏后仍然继续播放【急】live-player中在onHide中操作直播实例不生效 <view class="page-body"> <view class="page-section tc"> <live-player id="player" src="{{liveSrc}}" mode="live" bindstatechange="statechange" binderror="error" background-mute/> <view class="btn-area"> <button bindtap="bindPlay" class="page-body-button" type="primary">播放</button> <button bindtap="bindPause" class="page-body-button" type="primary">暂停</button> <button bindtap="bindStop" class="page-body-button" type="primary">停止</button> <button bindtap="bindResume" class="page-body-button" type="primary">恢复</button> <button bindtap="bindMute" class="page-body-button" type="primary">静音</button> <button bindtap="setSrc" class="page-body-button" type="primary">src</button> </view> </view> </view> /* eslint-disable */ const app = getApp() Page({ data: { liveSrc: "", state: 0, // 当前视频状态,0暂停,1播放,-1无视频或播放失败,用于控制页面上元素的展示 fullScreen: false, mute: false, init: true // 是否是第一次播放,用于控制只进行一次play() }, onLoad: function () { this.setData({ // liveSrc:"http://tx.corp-flv.huya.com/huyalive/35754395-35754395-153563957213265920-3155517294-10057-A-1523883632-63059.flv?wsSecret=551b73f934a29fcc48ec24010c6a3a81&wsTime=5ad601ce" liveSrc:"rtmp://live.hkstv.hk.lxdns.com/live/hks" }) }, onReady(res) { this.ctx = wx.createLivePlayerContext('player') }, /* 直播相关 start */ // 静音按钮 tapMute() { this.bindMute(); }, // 监听状态改变 statechange(e) { if (e.detail.code == '-2301') { console.log('loading fail'); this.setData({ state: -1 }); } console.log('live-player code:', e.detail.code) }, // 错误处理 error(e) { console.error('live-player error:', e.detail.errMsg); this.setData({ state: -1 }); }, bindPlay() { this.ctx.play({ success: res => { this.setData({ // state:1 - this.data.state // 1 state: 1 }); console.log('play success') }, fail: res => { console.log('play fail'); this.setData({ state: -1 }); } }) }, bindPause() { this.ctx.pause({ success: res => { this.setData({ // state:1 - this.data.state // 0 state: 0 }); console.log('pause success') }, fail: res => { console.log('pause fail') this.setData({ state: -1 }); } }) }, bindStop() { this.ctx.stop({ success: res => { this.setData({ // state:1 - this.data.state // 0 state: 0, init: true }); console.log('stop success') }, fail: res => { console.log('stop fail') this.setData({ state: -1 }); } }) }, bindResume() { this.ctx.resume({ success: res => { this.setData({ // state:1 - this.data.state // 1 state: 1 }); console.log('resume success') }, fail: res => { console.log('resume fail') this.setData({ state: -1 }); } }) }, bindMute() { this.ctx.mute({ success: res => { this.setData({ mute: !this.data.mute }); console.log('mute success') }, fail: res => { console.log('mute fail') this.setData({ state: -1 }); } }) }, bindFullScreen() { this.ctx.exitFullScreen({ success: res => { console.log('exitFullScreen success') }, fail: res => { console.log('exitFullScreen fail') this.setData({ state: -1 }); } }) }, bindExitFullScreen() { this.ctx.requestFullScreen({ direction: 90, success: res => { console.log('requestFullScreen success') }, fail: res => { console.log('requestFullScreen fail') this.setData({ state: -1 }); } }) }, setSrc(){ this.setData({ liveSrc: "" }); console.log(this.data.liveSrc); this.ctx = null; }, onShow(){ console.log("show~~~~~~"); // setTimeout(() => { // this.bindPlay(); // }, 1000); }, onHide(){ console.log("hide~~~~~~"); this.setData({ liveSrc: "" }); this.bindStop(); } /* 直播相关 end */ })
2018-05-21