"...one key functionality is not working..."
What functionality, then?
Thanks for your reply. Audio is not working. Audio is called using js.
Are you using the Media plugin to play your audio?
If not, your CSP (or lack thereof) might prevent the inline script to be used.
Please share some code so we can see exactly how you're trying to generate audio. Also share where your audio assets are located in your project.
Also -- IIRC, hydration is going to be placing files in a different location, so it's possible that how you're using audio is taking advantage of something hydration was doing. Without seeing your code, it's hard to say.
No, I am not using any Media plugin.
I have added
2) I have also added required information in allow-navigation, allow-intent & access origin.
3) Have added below line in html header.
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' media-src * "/>
Not sure if this is a permission issue or any other issue.
You are quite sparse when it comes to supplying information:
- in the thread title, you say "Phonegap Build App not working" (without saying what it is that is 'not working' and how you think it should 'work')
- then it's "one key functionality" that "doesn't work", without mentioning the functionality itself
- now you say you have "added required information in allow-navigation, allow-intent & access origin", without mentioning any code, so nobody here can check whether or not that piece contains any errors.
- Kerri asked: Please share some code so we can see exactly how you're trying to generate audio. Also share where your audio assets are located in your project., but no reply yet.
How can we possibly be of any help?
Sorry about that, I have message you everything in detail, hope it help to know more about the issue or identify root cause of this issue. Once again thanks for your time and reply Vector! !
By sending your reply privately, you are defeating the purpose of this public forum and you are limiting the number of useful reply from others. The purpose is to make everyone participate, so:
- you receive the best possible ideas
- others can learn or find this thread later on
Anyway, there are a couple of strange things in your package. These may not be relevant for the current audio problem, though:
a. You have included the whitelist plugin twice
b. You are using old, deprecated plugins from the pgb repo. Use the latest versions from npm instead
c. You specify a non-existing path for icons and splashes
d. Many icon/splash dimensions for iOS and Android are missing
e. You are including references to both cordova.js and phonegap.js
Remove the reference to phonegap.js
In your function 'play_audio' you have:
Have you checked whether $(audio_selector), $(audio_selector) and $(audio_selector).play(); exist at that time?
In other words: you said your issue is that the sound doesn't play. Most likely, yu just tested as a user would: click the button and hope for the best. However, as a developer, you need to debug: find the code line that fails! Put checkpoints (or, if nothing else helps, put alerts) at relevant points in your code and see whether or not those pieces are correctly executed. That way, you can isolate the issue to (hopefully) one single code line, which in turn will make you realize the cause of the problem.
What devices & platforms (and OS versions) is the audio failing on? Please be specific -- sometimes device/platform-specific stuff gets in the way and mucks up all of our best intentions! ;-)
Also do you get the initial sound when you start the app on the device? Do later sounds play or fail to play? I'm assuming no sounds what-so-ever, but when debugging, one needs to be certain of the specifics.