Music Controls plugin not working (typescript)


#1

Hello I am just trying to implement the Music Controls plugin in my application.
I cannot get it to work.

For now all I try to do is import it in my app.module.ts file.

so the only line I have added so far is

import { MusicControls } from '@ionic-native/music-controls';

But this make my application crash.
Here is the error show on ionic:serve

It crashes on browser but on mobile as well


#2

DId you follow the other steps of installing Ionic Native and the other things you have to do before being able to use a Ionic Native plugin?


#3

Yes i did both commands to install the cordova and the ionic 2 plugin

$ ionic cordova plugin add cordova-plugin-music-controls
$ npm install --save @ionic-native/music-controls

#4

And the rest of the instructions?


#5

Well it starts with the code line I have added. And this should not crash the application.


#6

I meant the “Add this plugin to your app’s module” part that links here: https://ionicframework.com/docs/native/#Add_Plugins_to_Your_App_Module


#7

This is exactly what I am trying to do.
Import the module in my AppModule. And this does not work