更新记录
1.0.5(2024-09-01)
-
1.0.4(2024-09-01)
-
1.0.3(2024-09-01)
-cs
查看更多
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
HBuilderX 3.1.0 app-vue |
× |
√ |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
hg-video-cover
<template>
<view>
<view class="content">
<view>
<text>网络视频封面https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4</text>
</view>
<!-- <hg-video-cover></hg-video-cover> -->
<view>
<image :src="imgPath1" mode="aspectFill"></image>
</view>
<button @click="getUrlPath">获取</button>
<hg-video-cover :url="video1" @success="imgPath1=$event"></hg-video-cover>
</view>
<view class="content">
<view>
<text>本地视频封面</text>
</view>
<view>
<image :src="imgPath2" mode="aspectFill"></image>
</view>
<button @click="choose">获取</button>
<!-- <hg-video-cover :url="video2" @success="imgPath2=$event"></hg-video-cover> -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
imgPath1: '',
imgPath2: "",
video1: '',
video2: ''
};
},
methods: {
getUrlPath() {
this.video1 = {
src: 'https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4',
width: 150,
height: 100
}
},
choose() {
uni.chooseVideo({
sourceType: ['camera', 'album'],
success: (blod) => {
this.video2 = {
src: blod.tempFilePath,
width: 100,
height: 100
}
}
})
},
}
}
</script>
<style lang="scss">
.content {
margin-top: 30rpx;
display: flex;
flex-direction: column;
// align-items: center;
// justify-content: center;
gap: 30rpx;
>view {
display: flex;
align-items: center;
justify-content: center;
>image {
width: 200rpx;
height: 200rpx;
background: rgba(22, 22, 22, 0.5);
}
>text {
font-size: 24rpx;
text-align: center;
}
}
}
</style>