ue4-player
v0.0.1
Published
ue4-player
Downloads
2
Readme
ue4-player
这是一个vue3版本的ue4player,适用孪生可视化大屏展示。
TODO: description
链接
https://github.com/webrtcHacks/adapter.git https://github.com/Azure/Unreal-Pixel-Streaming.git
Usage
npm install ue4-player
import UEPlayer from 'ue4-player';
app.use(UEPlayer)
<template>
<UEPlayer ref="uePlayer" :showPopver="false" class="uePlayerPanel"></UEPlayer>
</template>
<script setup>
import { onMounted, nextTick, ref } from "vue";
const uePlayer = ref(null)
onMounted(() => {
initUe();
});
const initUe = () => {
nextTick(() => {
console.log("uePlayer.value is", uePlayer.value)
uePlayer.value.start('10.137.8.13');
addResponseEventListener();
intoUe();
});
}
const intoUe = () => {
uePlayer.value.sendMsg({
Function: "START",
data: {},
});
}
const outUe = () =>{
uePlayer.value.sendMsg({
Function: "EXIT",
data: {},
});
}
const addResponseEventListener = () => {
uePlayer.value.addListener(
"handle_responses",
(res) => {
let callbackData = JSON.parse(res);
const { data } = callbackData
console.log("发送给我的消息:", callbackData);
console.log(JSON.parse(data.lnglat))
}
);
}
</script>