如何使用套接字 (.io) 将音频/视频从 node.js 服务器流式传输到 html5 页面 [英] How to Stream audio/video with socket (.io) from node.js server to html5 page
问题描述
我需要从 node.js 服务器流式传输 mp3 或 mp4 并在 html5 页面上观看.我正在尝试使用 socket.io 来加速通信,我希望它会降低我使用简单 http 的延迟.我在我的项目中设置了 socket.io,在客户端(移动网络应用程序)和服务器上,但我无法弄清楚也无法在网络上找到如何正确发送数据并将其引导到标签.
I need to stream mp3 or mp4 from a node.js server and watch it on a html5 page. I am trying to use socket.io to sped up communications and i hope it will lower the latency that i have using simple http. I set up socket.io in my project, both on the client (mobile web application) and the server, but i can't figure out nor find on the web how to properly send data and lead it to a tag.
推荐答案
请看 socket.io-stream 项目 https://www.npmjs.org/package/socket.io-stream
please see socket.io-stream project https://www.npmjs.org/package/socket.io-stream
这篇关于如何使用套接字 (.io) 将音频/视频从 node.js 服务器流式传输到 html5 页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!