How to Stream audio/video with socket (.io) from node.js server to html5 page

54,609

Solution 1

please see socket.io-stream project https://www.npmjs.org/package/socket.io-stream

Solution 2

Try ffmpeg to make sync audio/video streaming. In HTML5 audio and video tag automatically play it when you give source address of server in src element of audio/video tag.

Share:
54,609
Alessandro Annini
Author by

Alessandro Annini

I'm a software developer, employed since 2009, founder of Scriby, a technology startup making a cloud solution for small companies and freelances who need to deal with the glorious Italian electronic invoicing system and every sales and purchase document in general. During my career I worked on automotive devices for bus fleets, avionic in-flight entertainment systems for helicopters, mobile electronic parking systems, and more. I love taking care of a few side projects where I can experiment new languages, new ideas and find the next technology to use @work. When I feel I'm missing something or I am just curious about the latest trending tech around I go shopping for courses online and I prepare popcorn for the night.

Updated on September 18, 2020

Comments

  • Alessandro Annini
    Alessandro Annini over 3 years

    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.

  • Alessandro Annini
    Alessandro Annini almost 10 years
    i have implemented it but i don't know how to make it in a video tag.. how do i pass the data stream to html?
  • TheEnvironmentalist
    TheEnvironmentalist almost 10 years
    I have a similar problem. How did you pass the stream to the video tag?
  • Coderji
    Coderji over 9 years
    was anyone capable of streaming a video tag stream to another video tag stream using the provided project?
  • Siddharth
    Siddharth over 8 years
    use binaryjs . it m ight help
  • DeDenker
    DeDenker almost 5 years
    This is not an example on how to use with video stream. The link gives example(s) on file transfer.