|
|
@ -2,7 +2,7 @@
|
|
|
|
* @Author: donghao donghao@supervision.ltd
|
|
|
|
* @Author: donghao donghao@supervision.ltd
|
|
|
|
* @Date: 2025-03-12 13:48:53
|
|
|
|
* @Date: 2025-03-12 13:48:53
|
|
|
|
* @LastEditors: donghao donghao@supervision.ltd
|
|
|
|
* @LastEditors: donghao donghao@supervision.ltd
|
|
|
|
* @LastEditTime: 2025-03-17 14:10:46
|
|
|
|
* @LastEditTime: 2025-03-18 14:38:33
|
|
|
|
* @FilePath: \5G-Loading-Bay-Web\src\components\videoPlayer\RealPlayer.vue
|
|
|
|
* @FilePath: \5G-Loading-Bay-Web\src\components\videoPlayer\RealPlayer.vue
|
|
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
|
-->
|
|
|
|
-->
|
|
|
@ -11,17 +11,19 @@
|
|
|
|
<video ref="refPlayer" autoplay controls muted width="100%" height="100%" style="object-fit: fill;"></video>
|
|
|
|
<video ref="refPlayer" autoplay controls muted width="100%" height="100%" style="object-fit: fill;"></video>
|
|
|
|
<!-- <iframe src="http://192.168.10.113:8889/cam/" frameborder="0"></iframe> -->
|
|
|
|
<!-- <iframe src="http://192.168.10.113:8889/cam/" frameborder="0"></iframe> -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="flex items-center justify-center bg-black before-open-video" v-show="!isPlaying" @click.stop="openReal()">
|
|
|
|
<div class="flex items-center justify-center bg-black before-open-video" v-show="!isPlaying" @click.stop="handleOpen()">
|
|
|
|
<img src="@/assets/common/player_icon_1.png" alt="">
|
|
|
|
<img src="@/assets/common/player_icon_1.png" alt="">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- http://192.168.10.113:8889/cam/ -->
|
|
|
|
<!-- http://192.168.10.113:8889/cam/ -->
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { playRtspApi, stopRtspApi } from '@/api/dashboard';
|
|
|
|
import { playRtspApi, stopRtspApi } from '@/api/dashboard';
|
|
|
|
import { isSuccessApi } from "@/utils/forApi";
|
|
|
|
import { isSuccessApi } from "@/utils/forApi";
|
|
|
|
import { nextTick } from 'vue';
|
|
|
|
import { throttle } from 'lodash';
|
|
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
interface Props {
|
|
|
|
show: boolean; // 是否关闭
|
|
|
|
show: boolean; // 是否关闭
|
|
|
@ -84,6 +86,8 @@ async function stopPlayer() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch(() => props.show, (newVal) => {
|
|
|
|
watch(() => props.show, (newVal) => {
|
|
|
|
if (!newVal) {
|
|
|
|
if (!newVal) {
|
|
|
|
stopPlayer()
|
|
|
|
stopPlayer()
|
|
|
@ -106,6 +110,11 @@ function openReal() {
|
|
|
|
console.log("开启")
|
|
|
|
console.log("开启")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 使用 throttle 函数创建节流函数
|
|
|
|
|
|
|
|
const handleOpen = throttle(() => {
|
|
|
|
|
|
|
|
openReal();
|
|
|
|
|
|
|
|
}, 1000); // 节流时间为 1000 毫秒(即 1 秒)
|
|
|
|
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
defineExpose({
|
|
|
|
initPlayer
|
|
|
|
initPlayer
|
|
|
|
})
|
|
|
|
})
|
|
|
|