修改根据后缀名识别信号源类型的逻辑

This commit is contained in:
fangxiang 2022-10-19 17:10:59 +08:00
parent c9659e777b
commit c1c875e537
2 changed files with 4 additions and 24 deletions

View File

@ -943,14 +943,7 @@ export default defineComponent({
if (path && file) {
const full_path = (path + "/" + file.name).replace(/\\/g, "/");
const entity: SignalSourceEntity = new SignalSourceEntity();
if (
file.name.endsWith("mp4") ||
file.name.endsWith("avi") ||
file.name.endsWith("ts") ||
file.name.endsWith("webm") ||
file.name.endsWith("flv") ||
file.name.endsWith("mkv")
) {
if (FileSuffixHelper.isVideoPath(file.name)) {
entity.window_type = "EwindowType::Multimedia";
entity.media_url = JSON.stringify([full_path]);
} else {
@ -1053,14 +1046,7 @@ export default defineComponent({
if (path && file) {
const full_path = (path + "/" + file.name).replace(/\\/g, "/");
const entity: SignalSourceEntity = new SignalSourceEntity();
if (
file.name.endsWith("mp4") ||
file.name.endsWith("avi") ||
file.name.endsWith("ts") ||
file.name.endsWith("webm") ||
file.name.endsWith("flv") ||
file.name.endsWith("mkv")
) {
if (FileSuffixHelper.isVideoPath(file.name)) {
entity.window_type = "EwindowType::Multimedia";
entity.media_url = JSON.stringify([full_path]);
} else {

View File

@ -1164,14 +1164,8 @@ export default defineComponent({
if (path && file) {
const full_path = (path + "/" + file.name).replace(/\\/g, "/");
const entity: SignalSourceEntity = new SignalSourceEntity();
if (
file.name.endsWith("mp4") ||
file.name.endsWith("avi") ||
file.name.endsWith("ts") ||
file.name.endsWith("webm") ||
file.name.endsWith("flv") ||
file.name.endsWith("mkv")
) {
if (FileSuffixHelper.isVideoPath(file.name)) {
entity.window_type = "EwindowType::Multimedia";
entity.media_url = JSON.stringify([full_path]);
} else {