Commit 2f7789bb authored by 罗超's avatar 罗超

匹配教室终端

parent 5b763858
...@@ -100,23 +100,13 @@ ...@@ -100,23 +100,13 @@
<q-dialog v-model="showVideo" @hide="clearVideo"> <q-dialog v-model="showVideo" @hide="clearVideo">
<q-card <q-card
class="my-card" class="my-card"
style="width:60vw !important;max-width:60vw !important;max-height:unset !important;" style="width:64vw !important;max-width:64vw !important;max-height:32vw !important;height:32vw !important;"
flat flat
> >
<!-- <q-card-section> <div
<div class="text-h6" v-if="currentRoom"> id="player-con"
{{ currentRoom.RoomName }} style="width:100%;height:100%;overflow:hidden;"
</div> ></div>
</q-card-section> -->
<q-card-section>
<video
id="my_video"
class="video-js vjs-default-skin"
controls
preload
v-if="showVideo"
></video>
</q-card-section>
</q-card> </q-card>
</q-dialog> </q-dialog>
</div> </div>
...@@ -125,8 +115,6 @@ ...@@ -125,8 +115,6 @@
<script> <script>
import { getUseClassRoomList } from "../../api/classroom/index"; import { getUseClassRoomList } from "../../api/classroom/index";
import * as signalR from "@aspnet/signalr"; import * as signalR from "@aspnet/signalr";
import videojs from "video.js";
import "videojs-contrib-hls";
export default { export default {
meta: { meta: {
title: "教室状态" title: "教室状态"
...@@ -139,6 +127,7 @@ export default { ...@@ -139,6 +127,7 @@ export default {
videoObj: null, videoObj: null,
currentRoom: null, currentRoom: null,
queryStatus: 0, queryStatus: 0,
player: null,
connection: "", //signalr连接 connection: "", //signalr连接
roomStatusList: [] //返回消息 roomStatusList: [] //返回消息
}; };
...@@ -174,31 +163,36 @@ export default { ...@@ -174,31 +163,36 @@ export default {
methods: { methods: {
changeViewStatusHandler() {}, changeViewStatusHandler() {},
clearVideo() { clearVideo() {
this.videoObj.dispose(); this.player.stop();
this.player.dispose();
this.showVideo = false; this.showVideo = false;
}, },
openVideo(item) { openVideo(item) {
this.showVideo = true; this.showVideo = true;
this.currentRoom = item; this.currentRoom = item;
let url = `http://47.96.12.235:5000/live/${item.RoomId}.m3u8`;
this.$nextTick(() => { this.$nextTick(() => {
this.videoObj = videojs("my_video", { this.initPlayer(url);
controls: true, //是否显示播放器控件
autoplay: true, //是否自动播放
sources: [
{
type: "application/x-mpegURL",
src: `http://47.96.12.235:5000/live/${item.RoomId}.m3u8`
}
]
});
this.videoObj.play();
setTimeout(() => {
document
.getElementById("my_video_html5_api")
.setAttribute("controls", "controls");
}, 2000);
}); });
}, },
initPlayer(url) {
this.player = new Aliplayer(
{
id: "player-con",
source: url,
width: "100%",
height: "100%",
autoplay: true,
isLive: true,
rePlay: false,
playsinline: true,
preload: true,
controlBarVisibility: "hover",
useH5Prism: true
},
function(player) {}
);
},
changeStatus() { changeStatus() {
this.initStatus(); this.initStatus();
if (this.roomStatusList && this.roomStatusList.length > 0) { if (this.roomStatusList && this.roomStatusList.length > 0) {
...@@ -300,23 +294,4 @@ export default { ...@@ -300,23 +294,4 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.video-js div,
.video-js button {
display: none !important;
}
.video-js {
width: 100%;
}
.video-js video {
width: 100%;
}
.video-js .no-video {
display: flex;
height: 100%;
font-size: 14px;
text-align: center;
justify-content: center;
align-items: center;
background: #000;
}
</style> </style>
<style scoped> <style scoped>
#player-con{ #player-con {
width: 100%; width: 100%;
height: 500px; height: 500px;
background-color: #eee; background-color: #eee;
} }
.no-video{ .no-video {
width: 800px; width: 800px;
height: 450px; height: 450px;
margin: 0 auto; margin: 0 auto;
background-color: #000; background-color: #000;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content:center; justify-content: center;
color: #fff; color: #fff;
font-size: 30px; font-size: 30px;
} }
.title{ .title {
color: #000000; color: #000000;
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
margin-bottom: 20px; margin-bottom: 20px;
} }
.scheduInfo { .scheduInfo {
height: 100%; height: 100%;
width: 100%; width: 100%;
padding: 15px; padding: 15px;
background-color: #f2f4f7; background-color: #f2f4f7;
overflow: hidden; overflow: hidden;
} }
.scheduInfo .schedu_left { .scheduInfo .schedu_left {
width: 248px; width: 248px;
flex: 0 0 auto; flex: 0 0 auto;
position: relative; position: relative;
...@@ -37,49 +37,49 @@ ...@@ -37,49 +37,49 @@
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% auto; background-size: 100% auto;
height: 100%; height: 100%;
} }
.scheduInfo .okr-menu-active { .scheduInfo .okr-menu-active {
color: var(--q-color-primary); color: var(--q-color-primary);
font-weight: bold; font-weight: bold;
background: #ecf1ff; background: #ecf1ff;
} }
.mySched { .mySched {
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
height: 100%; height: 100%;
background-color: #fff; background-color: #fff;
} }
.schedu_ImgDiv { .schedu_ImgDiv {
width: 68px; width: 68px;
height: 68px; height: 68px;
border-radius: 20px; border-radius: 20px;
overflow: hidden; overflow: hidden;
margin: 75px auto 0; margin: 75px auto 0;
} }
.schedu_ImgDiv img { .schedu_ImgDiv img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.schedu_Name { .schedu_Name {
color: #fff; color: #fff;
font-size: 16px; font-size: 16px;
margin-top: 26px; margin-top: 26px;
text-align: center; text-align: center;
} }
.schedu_Status { .schedu_Status {
font-size: 12px; font-size: 12px;
color: #fff; color: #fff;
text-align: center; text-align: center;
margin-top: 15px; margin-top: 15px;
} }
.schedu_st { .schedu_st {
display: inline-block; display: inline-block;
width: 10px; width: 10px;
height: 10px; height: 10px;
...@@ -87,24 +87,24 @@ ...@@ -87,24 +87,24 @@
margin-right: 5px; margin-right: 5px;
position: relative; position: relative;
top: 1px; top: 1px;
} }
.zbz { .zbz {
background-color: #00DB4E; background-color: #00db4e;
} }
.xxz { .xxz {
background-color: #DBDBDB; background-color: #dbdbdb;
} }
.wdk { .wdk {
background-color: #FE4475; background-color: #fe4475;
} }
.clockon_Duty { .clockon_Duty {
width: 120px; width: 120px;
height: 34px; height: 34px;
background: linear-gradient(90deg, #00BDD3, #00D761); background: linear-gradient(90deg, #00bdd3, #00d761);
border-radius: 10px; border-radius: 10px;
margin: 100px auto 24px; margin: 100px auto 24px;
text-align: center; text-align: center;
...@@ -112,120 +112,120 @@ ...@@ -112,120 +112,120 @@
color: #fff; color: #fff;
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
} }
.sche_daka { .sche_daka {
font-size: 18px; font-size: 18px;
position: relative; position: relative;
left: 5px; left: 5px;
top: 2px; top: 2px;
} }
.schedu_jiaojie { .schedu_jiaojie {
width: 120px; width: 120px;
height: 34px; height: 34px;
line-height: 34px; line-height: 34px;
text-align: center; text-align: center;
border-radius: 10px; border-radius: 10px;
border: 1px solid #91AEFF; border: 1px solid #91aeff;
color: #C4D4FF; color: #c4d4ff;
font-size: 14px; font-size: 14px;
margin: auto; margin: auto;
cursor: pointer; cursor: pointer;
} }
.scheInfo_rightTop { .scheInfo_rightTop {
width: 100%; width: 100%;
/* height: 80px; */ /* height: 80px; */
padding: 20px 0; padding: 20px 0;
background-color: #fff; background-color: #fff;
} }
.schScroll { .schScroll {
background-color: #F6F8FA; background-color: #f6f8fa;
} }
.scheInfo_Topflex { .scheInfo_Topflex {
display: flex; display: flex;
/* width: 90%; */ /* width: 90%; */
/* height: 80px; */ /* height: 80px; */
align-items: center; align-items: center;
} }
.Sctop_Color { .Sctop_Color {
font-size: 18px; font-size: 18px;
color: #000000; color: #000000;
width: 246px; width: 246px;
text-align: center; text-align: center;
} }
.Scotop_little { .Scotop_little {
color: #AAAAAA; color: #aaaaaa;
font-size: 14px; font-size: 14px;
margin-right: 15px; margin-right: 15px;
display: inline-block; display: inline-block;
text-align: right; text-align: right;
width: 60px; width: 60px;
} }
.Scdu_benci::after { .Scdu_benci::after {
content: ""; content: "";
position: absolute; position: absolute;
height: 29px; height: 29px;
width: 2px; width: 2px;
background: #EBEBEB; background: #ebebeb;
right: 0; right: 0;
} }
.sche_mid { .sche_mid {
display: flex; display: flex;
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
} }
.sche_midList { .sche_midList {
width: 31.6%; width: 31.6%;
height: 300px; height: 300px;
background: #fff; background: #fff;
border-radius: 16px; border-radius: 16px;
border: 1px solid #EBEBEB; border: 1px solid #ebebeb;
box-shadow: 0px 1px 1px 0px #E4E7FB; box-shadow: 0px 1px 1px 0px #e4e7fb;
overflow: hidden; overflow: hidden;
font-family: 'MicrosoftYaHei'; font-family: "MicrosoftYaHei";
position: relative; position: relative;
} }
.Sche_Bottom { .Sche_Bottom {
margin: 26px 40px 0 40px; margin: 26px 40px 0 40px;
} }
.scheList_TOP { .scheList_TOP {
width: 100%; width: 100%;
height: 107px; height: 107px;
border-radius: 16px; border-radius: 16px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
} }
.scheList_TOP img { .scheList_TOP img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.word_sche { .word_sche {
color: #fff; color: #fff;
font-size: 20px; font-size: 20px;
position: absolute; position: absolute;
top: 25px; top: 25px;
left: 32px; left: 32px;
} }
.word_scheNumber { .word_scheNumber {
display: inline-block; display: inline-block;
width: 36px; width: 36px;
height: 36px; height: 36px;
color: #fff; color: #fff;
background-color: #FE4475; background-color: #fe4475;
position: absolute; position: absolute;
top: 30px; top: 30px;
left: 130px; left: 130px;
...@@ -233,35 +233,33 @@ ...@@ -233,35 +233,33 @@
line-height: 36px; line-height: 36px;
border-radius: 8px; border-radius: 8px;
font-size: 25px; font-size: 25px;
} }
.scheList_Bottom { .scheList_Bottom {
font-size: 14px; font-size: 14px;
color: #000000; color: #000000;
height: 46px; height: 46px;
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #F3F3F3; border-bottom: 1px solid #f3f3f3;
} }
.sche_Dian { .sche_Dian {
display: inline-block; display: inline-block;
width: 6px; width: 6px;
height: 6px; height: 6px;
background-color: #6D97FF; background-color: #6d97ff;
border-radius: 50%; border-radius: 50%;
margin-right: 10px; margin-right: 10px;
} }
.schScroll::-webkit-scrollbar { .schScroll::-webkit-scrollbar {
display: none; display: none;
} }
.Sch_MainColor { .Sch_MainColor {
font-size: 18px; font-size: 18px;
color: #000000; color: #000000;
}
}
</style> </style>
<template> <template>
...@@ -280,80 +278,80 @@ ...@@ -280,80 +278,80 @@
</div> </div>
</template> </template>
<script> <script>
import {getTimeDetail} from '../../api/classroom/index' import { getTimeDetail } from "../../api/classroom/index";
import {getVideoPlayAuth,getVideoPlayUrl} from '../../api/classroom/video' import { getVideoPlayAuth, getVideoPlayUrl } from "../../api/classroom/video";
import schedulVisit from './components/schedul-visit' import schedulVisit from "./components/schedul-visit";
import schedulHead from './components/schedul-head' import schedulHead from "./components/schedul-head";
export default { export default {
props: {}, props: {},
components: { components: {
schedulVisit, schedulVisit,
schedulHead, schedulHead
}, },
data() { data() {
return { return {
dataList: {}, dataList: {},
player:null, player: null
} };
}, },
created() { created() {
if (this.$route.query.id) { if (this.$route.query.id) {
this.id = this.$route.query.id; this.id = this.$route.query.id;
} }
}, },
mounted(){ mounted() {
this.getdata(); this.getdata();
}, },
methods: { methods: {
getdata(){ getdata() {
getTimeDetail({ID:this.id}).then(res=>{ getTimeDetail({ ID: this.id }).then(res => {
if(res.Code===1){ if (res.Code === 1) {
this.dataList=res.Data this.dataList = res.Data;
if(res.Data.VideoUrl){ if (res.Data.VideoUrl) {
this.getAuth(res.Data.VideoUrl) this.getAuth(res.Data.VideoUrl);
} // this.$nextTick(() => {
} // this.initPlayer(res.Data.VideoUrl);
}) // });
}
}
});
}, },
//初始化视频播放器 //初始化视频播放器
initPlayer(url,cover,auth){ initPlayer(url, cover, auth) {
this.player = new Aliplayer({ this.player = new Aliplayer(
"id": "player-con", {
"source": url, id: "player-con",
"width": "100%", source: url,
"height": "500px", width: "100%",
"autoplay": true, height: "500px",
"isLive": false, autoplay: false,
"rePlay": false, isLive: false,
"playsinline": true, rePlay: false,
"preload": true, playsinline: true,
"controlBarVisibility": "hover", preload: true,
"useH5Prism": true, controlBarVisibility: "hover",
"cover":cover, useH5Prism: true,
"playauth":auth, cover: cover,
}, function (player) { playauth: auth
},
} function(player) {}
); );
}, },
getAuth(url){ getAuth(url) {
getVideoPlayAuth({strVid:url}).then(res=>{ getVideoPlayAuth({ strVid: url }).then(res => {
if(res.Code===1&&res.Data.PlayAuth){ if (res.Code === 1 && res.Data.PlayAuth) {
this.getUrl(url,res.Data.PlayAuth) this.getUrl(url, res.Data.PlayAuth);
} }
});
})
}, },
getUrl(url,auth){ getUrl(url, auth) {
getVideoPlayUrl({strVid:url}).then(res=>{ getVideoPlayUrl({ strVid: url }).then(res => {
if(res.Code===1){ if (res.Code === 1) {
this.initPlayer(res.Data.URL,res.Data.VideoImg,auth) this.initPlayer(res.Data.URL, res.Data.VideoImg, auth);
} }
}) });
} }
},
} }
};
</script> </script>
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