Sending messages to Unreal
Overview
Sending messages from webpage
function sendPixelStreamMessage(psKey: string, psValue: any) {
// stringify and send data
if (channel ) {
const data = { type: 'ps', psKey, psValue }
const jsonString = JSON.stringify(data)
channel.port2.postMessage(jsonString)
} else {
console.error('Message channel not established.')
}
}Example payload
{
"type": "ps",
"psKey": "SpawnCube",
"psValue": "0.863,0.208,0.271"
}Receiving Pixel Streaming messages in UE
Last updated