android视频闪退,安卓 app 视频闪退问题
第一個問題: 視頻圖片列表頁分頁加載,只要有一個視頻預加載報錯,安卓端app就會閃退,ios正常
第二個問題:onPageScroll 用戶滾動時播放當前的視頻,視頻過多安卓端app就會閃退,ios正常
onLoad(options) {
//創(chuàng)建視頻上下文
this.videoContent = uni.createVideoContext
},
onPageScroll(e){
const that = this
if(that.tabId=="dynamic" && app.globalData.platformObj.platform=='ios'){
if(that.playId){
that.videoContent(that.playId).pause(); //暫停上一次播放的視頻
that.playId = ''
}
clearTimeout(that.debounce)
that.debounce = setTimeout(()=>{
that.dynListData.forEach(item=>{
if(item.type==2){
let scrTop = parseInt(e.scrollTop),top = parseInt(item.top) + parseInt(item.height);
if(scrToptop){
console.log('播放用戶當前滑動的視頻')
let currentId = 'video' + item.id;// 獲取當前視頻id
that.playId = currentId
that.videoContent(currentId).play(); //播放當前視頻
// return
}
}
})
}, 500)
}
}
總結(jié)
以上是生活随笔為你收集整理的android视频闪退,安卓 app 视频闪退问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android+六边形布局,androi
- 下一篇: html怎么整体放大,html页面放大时