illuspas / Node-Media-Server

A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH/MP4 Media Server
https://www.npmjs.com/package/node-media-server
MIT License
5.89k stars 1.51k forks source link

How access HLS streaming source? #549

Open thedarkknight197 opened 1 year ago

thedarkknight197 commented 1 year ago

I am using server running on port 80, but if i try to access to: http://localhost/live/STREAM_NAME/index.m3u8 also from browser it return to me 404 not found.

What is the problem?

KyalSinLinLett commented 1 year ago

@thedarkknight197 AFAIK there is no desktop browser support for HLS other than on Safari because HLS was developed by Apple Inc. back in 2009. So, the usual common browsers like desktop Chrome and desktop Firefox will not have support for the HLS protocol. But mobile Chrome does have support for HLS. You can check the exact browser compatibilities here. If you wish to test it out with your mobile, you would have to make sure that localhost is replaced with the local IP address that is assigned to your computer that is currently running the node-media-server. I hope this cleared any doubts you may have.

hthetiot commented 1 year ago

You can play HLS stream using hls.js on any non safari browser.

eric-eye commented 1 year ago

@thedarkknight197 I just ran into this myself, and I realized I was missing transcoding settings: https://github.com/illuspas/Node-Media-Server#remux-to-rtmphlsdash-live-stream-with-audio-transcode -- I don't think you would receive a 404 unless the HLS file was absent from the filesystem ./media/live/STREAM_NAME/

lonasozo commented 1 year ago

There is video.js too to play HLS: