Skip to content

Commit 788e75a

Browse files
author
Ariel Faur
committed
update documentation
1 parent 1bddbad commit 788e75a

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,19 @@ media duration and position. It does so by using the `notify` method of the Defe
3030
}, false);
3131
3232
$scope.playSomething = function() {
33-
media.getDuration().then(function(duration) {
34-
console.log('media duration: ' + duration);
35-
});
36-
37-
media.getCurrentPosition().then(null, null, function(position) {
38-
console.log('position ' + position)
39-
});
40-
41-
media.play().then(function() {
42-
// success
43-
console.log('finished playback');
44-
}, null, function(status) {
45-
console.log('status: ' + status);
46-
});
33+
media.play().then(function() {
34+
// success
35+
console.log('finished playback');
36+
}, null, function(data) {
37+
console.log('track progress: ' + data.position);
38+
39+
if (data.status) {
40+
console.log('track status change: ' + data.status);
41+
}
42+
if (data.duration) {
43+
console.log('track duration: ' + data.duration);
44+
}
45+
});
4746
};
4847
4948
$scope.pauseSomething = function() {

0 commit comments

Comments
 (0)