File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,19 @@ media duration and position. It does so by using the `notify` method of the Defe
30
30
}, false);
31
31
32
32
$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
+ });
47
46
};
48
47
49
48
$scope.pauseSomething = function() {
You can’t perform that action at this time.
0 commit comments