|
@@ -67,7 +67,15 @@
|
|
|
height: $uv.addUnit(height)
|
|
|
}"
|
|
|
controls
|
|
|
+ playsinline
|
|
|
+ webkit-playsinline
|
|
|
+ :object-fit="'fill'"
|
|
|
+ :enable-play-gesture="true"
|
|
|
+ :show-play-btn="true"
|
|
|
+ :show-center-play-btn="true"
|
|
|
+ :muted="false"
|
|
|
@tap="clickHandler(index)"
|
|
|
+ @error="onVideoError"
|
|
|
></video>
|
|
|
<text
|
|
|
v-if="showTitle && $uv.test.object(item) && item.title"
|
|
@@ -202,6 +210,14 @@
|
|
|
// 点击某个item
|
|
|
clickHandler(index) {
|
|
|
this.$emit('click', index)
|
|
|
+ },
|
|
|
+ onVideoError(e) {
|
|
|
+ console.error('视频加载失败', e)
|
|
|
+ // 可以在这里添加错误处理逻辑,比如显示错误提示或fallback图片
|
|
|
+ this.$emit('video-error', {
|
|
|
+ index: this.currentIndex,
|
|
|
+ error: e
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
}
|