I'm building an application that is focused on streaming audio to my users. I've never actually built something of this liking so I was wondering if I could get some advice on how to serve the actual files. I'm using MediaElement.js to play the files, but how would you go about serving them to the frontend?
P.s. sorry If I'm not supposed to post problems on here. I wasn't sure where to put this.
Depends how secure and non-hotlinking you want it to be. Obviously if you supply an audio file, people will be able to see the stream URL and just download it. Take a look at how SoundCloud and other audio services do theirs.
It's fine to post it here, main reason for the "forums".
Yeah thats always the problem with supplying the audio. I'm going to be a little lax with it because users will have the ability to download the audio as well. I'm not even sure where to start looking with SoundCloud.
Yeah although, looking at SoundCloud, it displays a link via JSON so that the SWF can play it. If you look at the network tab in Chrome or FireFox, it'll have a link like the one below
You'll see direct .mp3 files (with authorisation keys of course)
Hello,
I would love to see something about multimedia management and best practices for upload and display, eventually how you deal with file conversions, if it is worth the effort of converting user files, considering is a processor intensive task... I need to create a video gallery with user generated content. I am still researching how I should go about it... For now, I decided against converting the uploaded files, but this may hurt the usability of the website in ways I do not understand yet...
@carios1 : I'm working on a similar project as yours and I have an issue with serving mp3 file from Laravel. Did you find a solution ?
My problem is that duration is shown as NaN:NaN in the MediaElement audio player.
The problem is when serving file from Laravel. If I directly use a file in public folder, it is working great.