najamelan / ws_stream_wasm

Wasm convenience API for WebSockets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

websocket服务器推送二进制数据->浏览器中,js收流,怎么解析Blob对象?

Qianxunha opened this issue · comments

websocket服务器推送二进制数据->浏览器中,js收流,怎么解析Blob对象?
在js中接收服务器传输过来的数据,变成了Blob对象,现在想把数据取出来,请问怎么取,
可以解答下博主,感谢

Hi, I don't speak chinese, but from what I can make out with google translate...

ws_stream_wasm is meant to use websockets in wasm, not in Js. So it will return to you a WsMessage which holds a Vec<u8>. You will never get a Blob.

@najamelan Hi, my problem solved , thank you for much , var buff= new UintArray(Blob.data);
this buff is raw data