I have the following problem. Sounds are hidden from the public folder, cause there are only certain Users who should have access to the sound files. So I made a certain method, which acts like a sound url, but calculates first, whether the current user is allowed to access this file.
The file gets sent by the send_data method. The problem is just, that I it works quite slow if it works even… The developer of the jplayer plugin, which I use to play the sound, told me that I should be able to accept byte range requests to make it work properly…
How can I do this within a rails controller by sending the file with send_data or send_file?
Thanks,
Markus
I’ve been able to serve up the files with some success using send_file. Although I have one hitch, seeking to an earlier part of the song causes a new request which makes the song restart from 0:00 instead of the true location from the seekbar. This is what I have working for me so far: