Edit the .m file in a Cordova plugin?

4 posts, 0 answers
  1. Jeff
    Jeff avatar
    22 posts
    Member since:
    Sep 2013

    Posted 01 Jul 2015 Link to this post

    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

  2. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 06 Jul 2015 Link to this post

    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.

     
  3. Jeff
    Jeff avatar
    22 posts
    Member since:
    Sep 2013

    Posted 06 Jul 2015 in reply to Kaloyan Link to this post

    That is fantastic - thank you!
  4. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 07 Jul 2015 Link to this post

    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.

     
Back to Top