I'm just getting started with Meteor and I want to play a static audio file, either MP3 or M4A. I can't seem to find the right place to put such a file. I created a public/ directory and put my audio files in there, but then when I try to load http://localhost:3000/public/myfile.mp3
, it just loads my Meteor home page again (i.e., a regular HTML page, not the audio file). It's like the server isn't seeing the file. Is there some way I have to register the file with Meteor, or should it be in a different location? Thanks.
Asked
Active
Viewed 1,066 times
2

Sarah Vessels
- 30,930
- 33
- 155
- 222
3 Answers
9
Okay, it was there, you just don't access it via /public/myfile.mp3
, but rather through /myfile.mp3
.

Sarah Vessels
- 30,930
- 33
- 155
- 222
0
Yes, you can access all public files that way. You can also place files in subfolders. For example if your file is in ./public/mp3z/myfile.mp3
it can be accessed via Meteor like /mp3z/myfile.mp3
.

Bali C
- 30,582
- 35
- 123
- 152

James G Schneider
- 11
- 1
0
Yes, when you put it on public folder you could play that file by adding domain/your.mp3 to your audio src.

gone43v3r
- 397
- 1
- 6