[英]There is some way to stream a photo with Node JS?
我正在創建一個網絡聊天,我想向用戶提供從文件系統中選擇圖像的選項,並通過流技術將其共享給聊天室的其他成員。
有一些方法可以做到嗎?
謝謝!
看看BinaryJS
// Incoming stream from browsers
client.on('stream', function(stream, meta){
// broadcast to all other clients
for(var id in bs.clients){
if(bs.clients.hasOwnProperty(id)){
var otherClient = bs.clients[id];
if(otherClient != client){
var send = otherClient.createStream(meta); // create writable stream
stream.pipe(send); //pipe data to otherClient
}
}
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.