mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
44 lines
748 B
Vue
44 lines
748 B
Vue
<script lang="ts">
|
|
import videojs from 'video.js';
|
|
|
|
export default {
|
|
name: 'VideoPlayer',
|
|
props: {
|
|
options: {
|
|
type: Object,
|
|
default() {
|
|
return {};
|
|
}
|
|
},
|
|
url: {
|
|
type: String,
|
|
default() {
|
|
return "";
|
|
}
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
player: null
|
|
}
|
|
},
|
|
mounted() {
|
|
this.player = videojs(this.$refs.videoPlayer, this.options, () => {
|
|
this.player.log('onPlayerReady', this);
|
|
});
|
|
},
|
|
beforeDestroy() {
|
|
if (this.player) {
|
|
this.player.dispose();
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<video ref="videoPlayer" class="video-js" controls>
|
|
Your browser does not support the video tag.
|
|
</video>
|
|
</div>
|
|
</template> |