This is a migrated thread and some comments may be shown as answers.

Edit the .m file in a Cordova plugin?

3 Answers 101 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jeff
Top achievements
Rank 1
Jeff asked on 01 Jul 2015, 03:54 PM

I'm trying to solve a problem where I have background music playing and when another short sound effect plays, the background music fades out.

An article on stackoverflow implies that I might be able to fix this by modifying a setting in the file CDVSound.m, part of the Cordova Media plugin.  I am unable to find that file much less find a way to edit it, however.  I am on a Windows machine using the AppBuilder web interface.  Can someone help me understand how to tweak settings that may be encapsulated in a plugin's ".m" file?

http://stackoverflow.com/questions/26549298/xcode-play-an-audio-file-with-music-on-the-background

3 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 06 Jul 2015, 12:22 PM
Hi Jeff,

You will be able to edit the CDVSound.m file of the Cordova Media plugin only if you import that plugin as a custom Cordova plugin inside your project. Here are the steps you will need to perform:
  1. Open your project in the preferred AppBuilder client.
  2. Download the Cordova Media plugin as a zip file, from here.
  3. Import the Cordova Media plugin archive inside your project, as explained here.
  4. Disable the integrated inside AppBuilder Media plugin from your project's Properties page. In the Plugins tab.
  5. Open the CDVSound.m file and apply the desired changes.

Finally, you will have to build the app as an application package and deploy it on device in order to see if the issues is fixed, as custom Cordova plugins are not supported in the AppBuilder Simulator and the Companion apps.

Further, you will also need to change the ID of the dependent Cordova File plugin inside the Media plugin's plugin.xml file. You will notice the following line there:
<dependency id="cordova-plugin-file" version=">=2.0.0" />
Change it to:
<dependency id="org.apache.cordova.file" version=">=2.0.0" />

I hope this helps.

Regards,
Kaloyan
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Jeff
Top achievements
Rank 1
answered on 06 Jul 2015, 06:32 PM
That is fantastic - thank you!
0
Kaloyan
Telerik team
answered on 07 Jul 2015, 12:40 PM
Hi Jeff,

I am happy this had helped.

Please, let me know if I can be of further assistance.

Regards,
Kaloyan
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
General Discussion
Asked by
Jeff
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or