123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <template>
- <div class="app-container">
- <!-- 裂解区域子组件 -->
- <div v-if="area=='cracking1'">
- <cracking1 :area="area" @handleDevClick="handleDevClick"></cracking1>
- </div>
- <div v-if="area=='cracking2'">
- <cracking2 :area="area" @handleDevClick="handleDevClick"></cracking2>
- </div>
- <div v-if="area=='cracking3'">
- <cracking3 :area="area" @handleDevClick="handleDevClick"></cracking3>
- </div>
- <!-- 视频播放组件 -->
- <el-dialog
- :title="dialogTitle"
- :visible.sync="dialogVisible"
- width="80%">
- <div class="video-player-container">
- <video-player
- class="video-player"
- ref="videoPlayer"
- :playsinline="true"
- :options="playerOptions"
- style="width: 100%;"
- ></video-player>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { getDevVideoByAreaAndDev } from "@/api/aerial/devVideo";
- import { videoPlayer } from "vue-video-player";
- import Cracking1 from "@/views/aerial/cracking1/index.vue";
- import Cracking2 from "@/views/aerial/cracking2/index.vue";
- import Cracking3 from "@/views/aerial/cracking3/index.vue";
- export default {
- components: {
- videoPlayer,
- Cracking1,
- Cracking2,
- Cracking3,
- },
- props: {},
- data() {
- return {
- areaName: '',
- area: '',
- dialogVisible: false,
- dialogTitle: '',
- playerOptions: {
- playbackRates: [0.5, 1.0, 1.5, 2.0],
- autoplay: true,
- muted: false,
- loop: true,
- preload: "auto",
- language: "zh-CN",
- aspectRatio: "16:9",
- fluid: true,
- sources: [
- {
- type: "video/mp4",
- // src: "http://www.html5videoplayer.net/videos/madagascar3.mp4",
- src: '',
- },
- ],
- poster: "", // 封面地址
- width: document.documentElement.clientWidth,
- notSupportedMessage: "加载中......", //允许覆盖Video.js无法播放媒体源时显示的默认信息。
- controlBar: {
- timeDivider: true, // 当前时间和持续时间的分隔符
- durationDisplay: true, // 显示持续时间
- remainingTimeDisplay: true, // 是否显示剩余时间功能
- fullscreenToggle: true, // 是否显示全屏按钮
- },
- },
- }
- },
- created() {
- this.areaName = this.$route.query.areaName;
- this.area = this.$route.query.area;
- },
- methods: {
- handleDevClick(devName) {
- this.playerOptions.sources = [
- {
- type: "video/mp4",
- src: '',
- },
- ];
- this.playerOptions.notSupportedMessage = '加载中......';
- getDevVideoByAreaAndDev({
- "areaName": this.areaName,
- "devName": devName,
- }).then(response => {
- if (response.data != null && response.data != "") {
- this.playerOptions.sources = [
- {
- type: "video/mp4",
- src: 'http://localhost:8090'+ response.data.fileUrl,
- },
- ];
- } else {
- this.playerOptions.notSupportedMessage = '视频未上传......';
- }
- this.dialogTitle = this.areaName + " - " + devName;
- this.dialogVisible = true;
- });
- },
- }
- }
- </script>
- <style scoped>
- /deep/.video-js .vjs-big-play-button {
- width: 88px !important;
- height: 88px !important;
- border-radius: 50% !important;
- border: 0;
- line-height: 88px;
- font-size: 56px;
- object-fit: cover;
- text-align: center;
- background-color: rgba(0, 0, 0, 0.5);
- display: none;
- }
- </style>
|