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

匹配教室终端

parent 5b763858
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<div class="col q-pt-md q-pr-md"> <div class="col q-pt-md q-pr-md">
<!-- <div class="row work_Top"> <!-- <div class="row work_Top">
<div class="text-h6 col"></div> <div class="text-h6 col"></div>
</div> --> </div> -->
<q-btn-group <q-btn-group
outline outline
......
...@@ -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>
This diff is collapsed.
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