更新记录
1.0.5(2024-09-01)
-
1.0.4(2024-09-01)
-
1.0.3(2024-09-01)
-cs
查看更多平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | × | √ | √ | √ | × | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
√ | - | - | - | - | - | - | - | - | - | - |
其他
多语言 | 暗黑模式 | 宽屏模式 |
---|---|---|
× | × | √ |
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>