Closed SamuelM333 closed 6 years ago
Sorry, I haven't done much with webpack and NS. You might have some better luck on the NS Slack, I see lots of people are using webpack and someone might be more familiar than I am with what's happening.
Ok, I'll give it a try on NS Slack. If I find anything I'll post it here. Thanks.
I got help from the NS Slack. You just need to add the audio files to your webpack.config.js
file, like this:
// inside the plugins array
new CopyWebpackPlugin([
{ from: "App_Resources/**" },
{ from: "fonts/**" },
{ from: "**/*.jpg" },
{ from: "**/*.png" },
{ from: "**/*.xml" },
{ from: "audio/*.mp3" }, // add this line (or the directory where the audio files are)
]),
Here's a full example: https://github.com/EddyVerbruggen/nativescript-pluginshowcase/blob/6d5bde22cd9b50e8ca6872c9d89788d4f682100a/webpack.config.js#L107
I went through the same problem with webpack enabled and the solution worked for me either. Thank you
I have webpack enabled on my project and I cannot init a player from a file. I guess webpack is changing the location of the file.
I'm writing the directory like the readme says:
~/audio/song.mp3
I ran the app without webpack and works just fine.
I'm using
nativescript-audio@4.3.3
andnativescript-dev-webpack@0.9.1
Any ideas? Thanks.