forked from eee555/saolei_website
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eee555#64 from putianyi889/patch-49
全局共享录像播放器
- Loading branch information
Showing
9 changed files
with
112 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<template> | ||
<el-dialog v-model="videoplayerstore.visible" style="backdrop-filter: blur(1px);" draggable align-center destroy-on-close | ||
:modal="false" :lock-scroll="false"> | ||
<iframe class="flop-player-iframe flop-player-display-none" style="width: 100%; height: 500px; border: 0px" | ||
src="/flop/index.html" ref="video_iframe"></iframe> | ||
</el-dialog> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useVideoPlayerStore } from '@/store'; | ||
import useCurrentInstance from '@/utils/common/useCurrentInstance'; | ||
import { watch } from 'vue'; | ||
import { generalNotification } from '@/utils/system/status'; | ||
import { useI18n } from 'vue-i18n'; | ||
const { proxy } = useCurrentInstance(); | ||
const videoplayerstore = useVideoPlayerStore(); | ||
const t = useI18n(); | ||
watch(videoplayerstore, () => { | ||
if (videoplayerstore.visible) { | ||
preview(videoplayerstore.id) | ||
} | ||
}) | ||
const preview = (id: Number | undefined) => { | ||
if (!id) { | ||
return | ||
} | ||
(window as any).flop = null; | ||
proxy.$axios.get('/video/get_software/', | ||
{ | ||
params: { | ||
id, | ||
} | ||
} | ||
).then(function (response) { | ||
let url = import.meta.env.VITE_BASE_API + "/video/preview/?id=" + id; | ||
// console.log(url); | ||
if (response.data.msg == "a") { | ||
url += ".avf"; | ||
} else if (response.data.msg == "e") { | ||
url += ".evf"; | ||
} | ||
if ((window as any).flop) { | ||
playVideo(url); | ||
} else { | ||
(window as any).flop = { | ||
onload: async function () { | ||
playVideo(url); | ||
}, | ||
} | ||
} | ||
}).catch((error: any) => { | ||
generalNotification(t, error.response.status, t.t('common.action.getSoftware')) | ||
}) | ||
} | ||
const playVideo = function (url: string) { | ||
(window as any).flop.playVideo(url, { | ||
share: { | ||
uri: url, | ||
pathname: "/flop-player/player", | ||
anonymous: false, | ||
background: "rgba(100, 100, 100, 0.05)", | ||
title: "Flop Player Share", | ||
favicon: "https://avatars.githubusercontent.com/u/38378650?s=32", // 胡帝的头像 | ||
}, | ||
anonymous: false, | ||
background: "rgba(0, 0, 0, 0)", | ||
listener: function () { | ||
videoplayerstore.visible = false; | ||
(window as any).flop = null; | ||
}, | ||
}); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.