安装:
npm install --save vue-video-player
npm install --save videojs-flash
<template>
<section class="video-box">
<videoPlayer
ref="videoPlayer"
:options="videoOptions"
class="vjs-custom-skin videoPlayer"
:playsinline="true"
/>
</section>
</template>
<script>
import 'video.js/dist/video-js.css'
import 'vue-video-player/src/custom-theme.css'
import { videoPlayer } from 'vue-video-player'
import 'videojs-flash'
export default {
components: {
videoPlayer
},
data () {
return {
videoSrc: '',
// 视频播放
videoOptions: {
playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
autoplay: false, //如果true,浏览器准备好时开始回放。
muted: false, // 默认情况下将会消除任何音频。
loop: false, // 导致视频一结束就重新开始。
preload: 'a