movie-night-web/src/components/LoadingIcon.vue

34 lines
760 B
Vue
Raw Normal View History

2025-04-22 19:32:12 -05:00
<template>
<video
2025-04-22 21:22:11 -05:00
alt="Loading"
2025-04-22 19:32:12 -05:00
autoplay
class="flex absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"
loop
muted
2025-04-23 12:52:06 -05:00
playsinline
2025-04-22 20:22:17 -05:00
>
2025-04-23 13:15:10 -05:00
<source
v-if="supportsHEVC"
src="/assets/img/movie-loader.mov"
type="video/quicktime"
/>
<source v-else src="/assets/img/movie-loader.webm" type="video/webm" />
2025-04-22 20:22:17 -05:00
</video>
2025-04-22 19:32:12 -05:00
</template>
2025-04-23 13:15:10 -05:00
<script lang="ts" setup>
const supportsHEVC = ref(false);
onMounted(() => {
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
// iOS devices also support HEVC
const isIOS =
/iPad|iPhone|iPod/.test(navigator.userAgent) && !(window as any).MSStream;
supportsHEVC.value = isSafari || isIOS;
});
</script>
2025-04-22 19:32:12 -05:00
<style scoped></style>