-
Notifications
You must be signed in to change notification settings - Fork 152
/
App.vue
68 lines (60 loc) · 1.34 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<template>
<div id="app">
<div id="container">
<Player playsinline ref="player" @vPlaybackReady="onPlaybackReady">
<Video poster="https://files.vidstack.io/agent-327/poster.png">
<source
data-src="https://files.vidstack.io/agent-327/720p.mp4"
type="video/mp4"
/>
</Video>
<DefaultUi>
<!-- Custom UI component. -->
<TapSidesToSeek />
</DefaultUi>
</Player>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
import { Player, Video, DefaultUi } from '@vime/vue-next';
// Default theme.
import '@vime/core/themes/default.css';
// Optional light theme (extends default).
// import '@vime/core/themes/light.css';
// Custom UI Component.
import TapSidesToSeek from './TapSidesToSeek.vue';
export default defineComponent({
name: 'App',
components: {
Player,
Video,
DefaultUi,
TapSidesToSeek,
},
setup() {
// Obtain a ref if you need to call any methods.
const player = ref<HTMLVmPlayerElement | null>(null);
return { player };
},
methods: {
onPlaybackReady() {
// ...
},
},
});
</script>
<style>
#app {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
#container {
width: 100%;
max-width: 960px;
}
</style>