Commit 21f07b64 authored by 以墨为白's avatar 以墨为白 🎧

2

parent cb3900de
<template>
<div>
<video style="height: 100%;width: 100%;" id="my-player" v-if="this.src.endsWith('flv')" preload="auto" muted autoplay controls>
<video style="height: 100%;width: 100%;" id="my-player" v-if="this.src.endsWith('flv')" preload="auto" muted
autoplay controls>
</video>
<video style="height: 100%;width: 100%;" id="my-player" v-if="!this.src.endsWith('flv')" class="video-js" preload="auto" muted autoplay controls>
<video style="height: 100%;width: 100%;" id="my-player" v-if="!this.src.endsWith('flv')" class="video-js"
preload="auto" muted autoplay controls>
</video>
</div>
</template>
<script>
import flvjs from "flv.js";
import videozhCN from "video.js/dist/lang/zh-CN.json";
import videojs from "video.js";
import videozhCN from "video.js/dist/lang/zh-CN.json";
import "video.js/dist/video-js.css";
export default {
props: ['src'],
......@@ -39,6 +41,7 @@ export default {
this.flvPlayer.play();//播放
}
} else {
videojs.addLanguage("zh-CN", videozhCN);
this.mp4Player = videojs('my-player', {
sources: [{
language: "zh-CN",
......@@ -47,9 +50,8 @@ export default {
playbackRates: [0.5, 1, 1.5, 2] //倍速播放
}]
}, function () {
console.log("videojs播放器初始化成功");
});
videojs.addLanguage("zh-CN", videozhCN);
this.mp4Player.play();
}
},
......
......@@ -387,6 +387,7 @@ import VideoPlayer from "../../components/common/video_player.vue"
export default {
data() {
return {
errimg: '',
centerDialogVisible_add: false,
centerDialogVisible_edit: false,
centerDialogVisible_video: false,
......@@ -921,12 +922,12 @@ export default {
}
},
//视频预览弹出框隐藏事件
centerDialogVisible_video: function (s) {
if (!s) {
this.video_src = "";
document.getElementById("video").pause();
}
},
// centerDialogVisible_video: function (s) {
// if (!s) {
// this.video_src = "";
// document.getElementById("video").pause();
// }
// },
//音频预览弹出框隐藏事件
centerDialogVisible_sound: function (s) {
if (!s) {
......
......@@ -915,12 +915,12 @@ export default {
}
},
//视频预览弹出框隐藏事件
centerDialogVisible_video: function (s) {
if (!s) {
this.video_src = "";
document.getElementById("video").pause();
}
},
// centerDialogVisible_video: function (s) {
// if (!s) {
// this.video_src = "";
// document.getElementById("video").pause();
// }
// },
//音频预览弹出框隐藏事件
centerDialogVisible_sound: function (s) {
if (!s) {
......
......@@ -956,12 +956,12 @@ export default {
}
},
//视频预览弹出框隐藏事件
centerDialogVisible_video: function (s) {
if (!s) {
this.video_src = "";
document.getElementById("video").pause();
}
},
// centerDialogVisible_video: function (s) {
// if (!s) {
// this.video_src = "";
// document.getElementById("video").pause();
// }
// },
//音频预览弹出框隐藏事件
centerDialogVisible_sound: function (s) {
if (!s) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment