装备列表设备播放器兼容webrtc
This commit is contained in:
@@ -16,12 +16,12 @@
|
|||||||
<a-spin size="large" v-if="loading" />
|
<a-spin size="large" v-if="loading" />
|
||||||
<!-- <div id="player" v-else></div> -->
|
<!-- <div id="player" v-else></div> -->
|
||||||
<div class="player" :id="'player_' + sn" v-else>
|
<div class="player" :id="'player_' + sn" v-else>
|
||||||
<jessibuca
|
<stream-player
|
||||||
ref="jessibucaVideo"
|
ref="jessibucaVideo"
|
||||||
style="width: 100%; height: 100%"
|
style="width: 100%; height: 100%"
|
||||||
:videoUrl="flvUrl"
|
:videoUrl="flvUrl"
|
||||||
:showQu="false"
|
:showQu="false"
|
||||||
></jessibuca>
|
></stream-player>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -35,7 +35,7 @@ import { message } from 'ant-design-vue';
|
|||||||
import jswebrtc from '/@/vendors/jswebrtc.js';
|
import jswebrtc from '/@/vendors/jswebrtc.js';
|
||||||
import FlvExtend from 'flv-extend';
|
import FlvExtend from 'flv-extend';
|
||||||
import { useUserAuthor } from '/@/hooks/use-g-author';
|
import { useUserAuthor } from '/@/hooks/use-g-author';
|
||||||
import jessibuca from './live/jessibuca.vue';
|
import streamPlayer from './live/stream-player.vue';
|
||||||
import { getAiLive } from '/@/api/daping';
|
import { getAiLive } from '/@/api/daping';
|
||||||
const { getAiAuthor } = useUserAuthor();
|
const { getAiAuthor } = useUserAuthor();
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -289,7 +289,8 @@ const createRtmpVideo = async (url: string) => {
|
|||||||
// 将video加入到 dom中
|
// 将video加入到 dom中
|
||||||
// remotePlay?.appendChild(link);
|
// remotePlay?.appendChild(link);
|
||||||
await nextTick(async () => {
|
await nextTick(async () => {
|
||||||
await rtmpVideoData(url, 'player_'+props.sn);
|
flvUrl.value = url;
|
||||||
|
await jessibucaVideo.value?.play?.(url);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
let videoPalyer = null;
|
let videoPalyer = null;
|
||||||
@@ -429,16 +430,15 @@ watch(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
||||||
// console.log('ckckckckk----',props)
|
// console.log('ckckckckk----',props)
|
||||||
// onloadCamera();
|
// onloadCamera();
|
||||||
createRtmpVideo(props.flvUrl)
|
createRtmpVideo(props.flvUrl)
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['close']);
|
const emit = defineEmits(['close']);
|
||||||
const closeVideo = () => {
|
const closeVideo = () => {
|
||||||
if (!videoPalyer) return;
|
|
||||||
videoPalyer.close();
|
|
||||||
videoPalyer = null;
|
videoPalyer = null;
|
||||||
|
flvUrl.value = '';
|
||||||
|
jessibucaVideo.value?.destroy?.();
|
||||||
};
|
};
|
||||||
const closeMoadl = () => {
|
const closeMoadl = () => {
|
||||||
closeVideo();
|
closeVideo();
|
||||||
|
|||||||
@@ -349,6 +349,11 @@ const pause = () => {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
#jessibuca {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.buttons-box {
|
.buttons-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<jessibuca
|
<jessibuca
|
||||||
v-show="!isWebrtcMode"
|
v-show="!isWebrtcMode"
|
||||||
ref="flvPlayerRef"
|
ref="flvPlayerRef"
|
||||||
|
style="width: 100%; height: 100%;"
|
||||||
:currentVedioDatas="currentVedioDatas"
|
:currentVedioDatas="currentVedioDatas"
|
||||||
:videoUrl="videoUrl"
|
:videoUrl="videoUrl"
|
||||||
:error="error"
|
:error="error"
|
||||||
|
|||||||
Reference in New Issue
Block a user