Pixel Streaming - Packet ID is undefined

I’m trying to get pixel streaming working and keep seeing error messages on the browser’s javascript console: “unrecognized data received, packet ID undefined”

These errors occur using the out-of-the-box pixel streaming setup from UE. Everything else appears to be working correctly in firefox as I can see the game playing in the browser.

UE Version: 4.26.2
Browsers tested: Firefox + Chrome on windows and mac

1 Like

I have/had the same issue. This is because the Data Channel defaults to returning a Blob.

I believe the issue is that the blob type cannot be converted to a Uint8Array using the constructor (i.e. Uint8Array(data) as is done in the onDataChannelMessage callback), but rather the async arrayBuffer() method must be used instead, and onDataChannelMessage called by the fulfilment of the promise. (I haven’t tested this way of doing it however.)

A simpler fix is to set the data channel binary type to “arraybuffer”, which will instruct the datachannel to provide an ArrayBuffer rather than a Blob in its MessageEvent.

Add the line datachannel.binaryType = "arraybuffer"; after the datachannel is created in setupDataChannel in webRtcPlayer.js.

2 Likes

That worked like a charm, thank you!