Quantcast
Viewing all articles
Browse latest Browse all 229967

How do you load and use the Media plugin in Ionic 2

I'm trying to use the cordova media plugin in Ionic 2 but can't figure out how to do it.

I've tried every form of import {...} from '...' I can think of nothing.

I've tried to include it by just using globals like: $Media, $cordovaMedia $window.Media etc.

I dug through the ionic-native package, but found nothing.

What am I doing wrong?

From the command line, I've done this:
ionic plugin add org.apache.cordova.media

How do I make this thing load so I can call something like this:
let media = new Media('blah.mp3');
media.play();


Viewing all articles
Browse latest Browse all 229967

Trending Articles