# Media Undefined

**URL:** <https://forum.ionicframework.com/t/media-undefined/39380>\
**Category:** ionic-v1\
**Created:** [December 17, 2015, 6:06am UTC](https://forum.ionicframework.com/t/media-undefined/39380 "2015-12-17T06:06:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kennedymca](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kennedymca](https://forum.ionicframework.com/u/kennedymca)\
**Post date:** [December 17, 2015, 6:06am UTC](https://forum.ionicframework.com/t/media-undefined/39380/1 "2015-12-17T06:06:11Z")

</div>

I am try to use cordova media plugin but the Ionic.bundle.js says media Undefined error.  
pls give any solution, how to solve this.

This is my code:

var src = “/src/audio.mp3”;  
var media = $cordovaMedia.newMedia(src);

var iOSPlayOptions = {  
numberOfLoops: 2,  
playAudioWhenScreenIsLocked : false  
}

media.play(options); // iOS only!  
media.play(); // Android

media.pause();

media.stop();

media.release();

media.seekTo(5000); // milliseconds value

media.setVolume(0.5);

media.startRecord();

media.stopRecord();
