feat: 使用DDR读取Hdmi视频流
This commit is contained in:
@@ -81,7 +81,12 @@
|
||||
import { ref, onMounted, onUnmounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { AuthManager } from "@/utils/AuthManager";
|
||||
import { ExamClient, ResourceClient, type ExamInfo } from "@/APIClient";
|
||||
import {
|
||||
ExamClient,
|
||||
ResourceClient,
|
||||
ResourcePurpose,
|
||||
type ExamInfo,
|
||||
} from "@/APIClient";
|
||||
|
||||
// 接口定义
|
||||
interface Tutorial {
|
||||
@@ -146,7 +151,7 @@ onMounted(async () => {
|
||||
const resourceList = await resourceClient.getResourceList(
|
||||
exam.id,
|
||||
"cover",
|
||||
"template",
|
||||
ResourcePurpose.Template,
|
||||
);
|
||||
if (resourceList && resourceList.length > 0) {
|
||||
// 使用第一个封面资源
|
||||
|
||||
@@ -430,13 +430,13 @@ function startStream() {
|
||||
}
|
||||
|
||||
// 停止播放视频流
|
||||
function stopStream() {
|
||||
async function stopStream() {
|
||||
isPlaying.value = false;
|
||||
currentVideoSource.value = "";
|
||||
videoStatus.value = "已停止播放";
|
||||
|
||||
const client = AuthManager.createClient(HdmiVideoStreamClient);
|
||||
client.disableHdmiTransmission();
|
||||
await client.disableHdmiTransmission();
|
||||
|
||||
addLog("info", "停止播放HDMI视频流");
|
||||
alert?.info("已停止播放HDMI视频流");
|
||||
@@ -467,8 +467,9 @@ function handleVideoClick() {
|
||||
}
|
||||
|
||||
// 重试连接
|
||||
function tryReconnect() {
|
||||
async function tryReconnect() {
|
||||
hasVideoError.value = false;
|
||||
await stopStream();
|
||||
if (endpoint.value) {
|
||||
startStream();
|
||||
}
|
||||
|
||||
@@ -171,7 +171,12 @@ import { useProvideComponentManager } from "@/components/LabCanvas";
|
||||
import { useAlertStore } from "@/components/Alert";
|
||||
import { AuthManager } from "@/utils/AuthManager";
|
||||
import { useEquipments } from "@/stores/equipments";
|
||||
import { DataClient, ResourceClient, type Board } from "@/APIClient";
|
||||
import {
|
||||
DataClient,
|
||||
ResourceClient,
|
||||
ResourcePurpose,
|
||||
type Board,
|
||||
} from "@/APIClient";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
const route = useRoute();
|
||||
@@ -257,7 +262,11 @@ async function loadDocumentContent() {
|
||||
const client = AuthManager.createClient(ResourceClient);
|
||||
|
||||
// 获取markdown类型的模板资源列表
|
||||
const resources = await client.getResourceList(examId, "doc", "template");
|
||||
const resources = await client.getResourceList(
|
||||
examId,
|
||||
"doc",
|
||||
ResourcePurpose.Template,
|
||||
);
|
||||
|
||||
if (resources && resources.length > 0) {
|
||||
// 获取第一个markdown资源
|
||||
|
||||
Reference in New Issue
Block a user