Skip to content

Commit 9338b45

Browse files
author
Ariel Faur
committed
initial commit
1 parent d0a977a commit 9338b45

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
# cordovaMedia2
22

3-
This module is a rewrite of the $cordovaMedia class from ngCordova that takes advantage of Promises to fix the issue with
3+
This module is a rewrite of the `$cordovaMedia` class from ngCordova that takes advantage of Promises to fix the issue with
44
media duration and position. It does so by using the `notify` method of the Deferred API.
55

66
# Usage
7-
Assuming you are already using ngCordova, simply include the `cordovaMedia2.js` file after `ngCordova.js`
87

9-
````
8+
## Simply include the `cordovaMedia2.js` file after `ngCordova.js`
9+
10+
```
1011
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
12+
```
13+
14+
```
1115
<script src="js/cordovaMedia2.js"></script>
12-
````
16+
```
17+
18+
## Inject `ngCordova` in your app's module
1319

14-
Then inject `$cordovaMedia2` in your controller:
20+
`angular.module('app', ['ionic', 'ngCordova'])`
1521

16-
````
17-
.controller('MusicCtrl', ['$scope', '$cordovaMedia2', function($scope, $cordovaMedia2) {
22+
## Inject `$cordovaMedia2` in your controller:
23+
24+
```
25+
controller('MusicCtrl', ['$scope', '$cordovaMedia2', function($scope, $cordovaMedia2) {
1826
$scope.playSomething = function() {
1927
var url = 'song.mp3';
2028
var media = $cordovaMedia2.newMedia(url);
@@ -32,7 +40,6 @@ Then inject `$cordovaMedia2` in your controller:
3240
3341
console.log(JSON.stringify(data));
3442
});
35-
3643
}
3744
}])
38-
````
45+
```

0 commit comments

Comments
 (0)