From feb102251e6bb74ef8b162ffd9b8de20ffa1c5af Mon Sep 17 00:00:00 2001 From: Colin Frei Date: Tue, 6 Aug 2013 08:13:51 +0200 Subject: [PATCH] change how updateDuration happens --- js/models.js | 2 +- js/services.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js/models.js b/js/models.js index 5a82193..4686d41 100644 --- a/js/models.js +++ b/js/models.js @@ -275,7 +275,7 @@ angular.module('podcasts.models', ['podcasts.database', 'podcasts.utilities']) var feedItem = _get(feedItemId, function(feedItem) { feedItem.queued = 0; - var promise = db.put("feedItem", feedItem); + var promise = db.put("feedItem", feedItem) .then(function() { $rootScope.$broadcast('queueListRefresh'); }); diff --git a/js/services.js b/js/services.js index 39d9f51..6aca394 100644 --- a/js/services.js +++ b/js/services.js @@ -110,9 +110,6 @@ angular.module('podcasts.services', ['podcasts.utilities', 'podcasts.queueList', function updateSong(feedItem, $scope) { nowPlaying.title = feedItem.title; - /*$timeout(function() { - player.nowPlaying.duration = audio.duration; - }, 100);*/ nowPlaying.currentFeedItem = feedItem; nowPlaying.description = feedItem.description; nowPlaying.feed = feedItem.feed; @@ -122,6 +119,10 @@ angular.module('podcasts.services', ['podcasts.utilities', 'podcasts.queueList', function updatePosition($scope) { + $timeout(function() { + nowPlaying.duration = audio.duration; + }, 500); + setInterval(function() { nowPlaying.position = audio.currentTime; $scope.$apply();