Play Audio file in writable folder |
Is it possible to play audio files that are inside the writable folder?
Code: <audio controls=""> I have this code on the front end, but the audio doesn't play. Thank you all!
premise : the public is the webroot
two ways 1, add new folder example 'uploads' in public/ . then upload files in it (public/uploads) 2, make the (your writable/uploads full path) softlink to public/uploads . then upload filed in (writable/uploads full path)
Try this, not tested.
Code: <audio controls=""> See if that will work for you. UPDATE: I found out that chrome and any web browsers using the chrome engine will give the error. What I did to get it to work was to play the audio files from my live server then it worked. Could be public_html or public depends on the server mine is public_html Code: <audio controls autoplay> Set audio folder permissions to 755 All have only read access owner has read/write/execute permissions. Worked like a charm. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I tried as follows, but to no avail.
moved files from writable to public/assets/audios PHP Code: <audio controls> base_url('assets/audios/'.$line["audiofile"]) print: http://cdr.local/assets/audios/2021/08/1...07m29s.WAV directly accessing the url in browser
Upload your file to public /upload
You cannot read file from writable folder
Enlightenment Is Freedom
(08-10-2021, 08:13 AM)paliz Wrote: Upload your file to public /upload Yes! i moved files from folder writable to public/assets/audios I found the problem was the file's codec Code: Input File : 'public/assets/audios/2021/08/10/1628601745.4-FX0-atendimento-10:22:32.WAV' I did the test with another file and everything worked Code: Input File : 'public/assets/audios/2021/04/06/1617722381.169-221-20523678-12:19:41.wav' Thanks to everyone who helped! |
Welcome Guest, Not a member yet? Register Sign In |