视频播放组件,在ios下,首次进入seek功能正常,点击切换src后再seek,只能从0开始播放,测试机型:6s;Android和h5下均正常;不知道大家有没有碰到类似问题
<template>
<view>
<video id="myvideo" ref="myvideo" :src="src" @error="videoErrorCallback" controls v-if="show"></video>
<uni-list>
<uni-list-item title="video1" note="" link @tap="play(0)"></uni-list-item>
<uni-list-item title="video2" note="" link @tap="play(1)"></uni-list-item>
</uni-list>
</view>
</template>
<script>
export default {
data() {
return {
show: true,
src: '',
videoContext: '',
videoList: [
'https://outin-ad708207f43f11eaabcd00163e1a65b6.oss-cn-shanghai.aliyuncs.com/sv/5474f3df-1748a91db3d/5474f3df-1748a91db3d.mp4?Expires=1601022477&OSSAccessKeyId=LTAI8bKSZ6dKjf44&Signature=ClhTE93%2F7WSc2HqGOq4%2BbMGWt%2BE%3D',
'https://outin-ad708207f43f11eaabcd00163e1a65b6.oss-cn-shanghai.aliyuncs.com/sv/22c9a7b6-17495ce541d/22c9a7b6-17495ce541d.mp3?Expires=1601022539&OSSAccessKeyId=LTAI8bKSZ6dKjf44&Signature=4IrVpMAFTJdZTYBQnk1PMhIqCR4%3D'
]
}
},
onLoad() {},
onReady() {},
methods: {
play(idx) {
this.videoContext = uni.createVideoContext('myvideo')
this.src = this.videoList[idx]
this.$nextTick(() => {
this.videoContext.play()
this.videoContext.seek(100)
})
},
videoErrorCallback: function(e) {
console.log('视频错误信息:')
console.log(e.target)
},
}
}
</script>
<style>
</style>
l***@163.com
问下怎么换原生sdk?
2020-09-28 18:55
魇七7
问下怎么换原生
2021-01-12 13:12