mirror of
https://gitcode.com/leisileken/cloud-smart.git
synced 2026-09-11 10:27:20 +08:00
fix: 首页背景视频跳过前2秒水印
This commit is contained in:
@@ -1,11 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { images } from '@/assets/images'
|
||||
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const bgVideoRef = ref<HTMLVideoElement | null>(null)
|
||||
|
||||
onMounted(() => {
|
||||
if (bgVideoRef.value) {
|
||||
bgVideoRef.value.currentTime = 2
|
||||
bgVideoRef.value.addEventListener('timeupdate', () => {
|
||||
if (bgVideoRef.value && bgVideoRef.value.duration > 0) {
|
||||
if (bgVideoRef.value.currentTime < 2) {
|
||||
bgVideoRef.value.currentTime = 2
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const stats = [
|
||||
{ value: '20+', label: '服务客户' },
|
||||
{ value: '10+', label: '成功案例' },
|
||||
@@ -83,6 +98,7 @@ const activeTestimonial = ref(0)
|
||||
<div class="min-h-screen">
|
||||
<section class="relative min-h-screen flex items-center overflow-hidden">
|
||||
<video
|
||||
ref="bgVideoRef"
|
||||
src="/videos/tech3.mp4"
|
||||
class="absolute inset-0 w-full h-full object-cover"
|
||||
autoplay loop muted playsinline
|
||||
|
||||
Reference in New Issue
Block a user