mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-10 21:06:15 -08:00
27 lines
622 B
Vue
27 lines
622 B
Vue
<script setup lang="ts">
|
|
import type Artplayer from 'artplayer'
|
|
import type { Option } from 'artplayer'
|
|
import { reactive } from 'vue'
|
|
import Player from './Player.vue'
|
|
|
|
const option = reactive({
|
|
url: 'https://artplayer.org/assets/sample/video.mp4',
|
|
autoSize: true,
|
|
} satisfies Partial<Option>)
|
|
|
|
const style = reactive({
|
|
width: '800px',
|
|
height: '600px',
|
|
margin: '60px auto 0',
|
|
})
|
|
|
|
function getInstance(art: Artplayer) {
|
|
// eslint-disable-next-line no-console
|
|
console.log('Artplayer instance:', art)
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<Player :option="option" :style="style" @get-instance="getInstance" />
|
|
</template>
|