yeah, 100%, I played a while with webtorrent but (from the very limited time I spent looking at it) I think webtorrents might be insufficient for this, but yeah, definitely want it to support a whole array of media sources
Discussion
🔥 we implemented HLS for streaming audio in #[7]​ for a couple reasons:
- chunked audio encoding doesnt send full sourcefile to browser. enables monetization (no right click save)
- works across devices and browsers
- same protocol used by e.g. soundcloud
- open standard
- scales extremely well, just static files
- also supports video
would love if the eventual NIP for audio had support for robust streaming like this. I’m no expert but I’ve spent a good amount of time on our HLS implementation - happy to answer questions or contribute!
this sounds great!
what are you using on the server to serve the chunks?
just a basic fileserver, in our case it’s implemented in Go but you could use an S3 bucket or whatever. just needs to be accessible over http
end to end it goes roughly like this:
1. user uploads an audio file
2. backend uses ffmpeg to convert it into HLS files (chunked mp3s + text manifest)
3. HLS files made available on basic fileserver over http
4. HLS manifest url goes into note metadata
5. client gets note, fetches manifest, (manifest includes time markers + mp3 chunk urls) and JIT loads chunks into player