Hello everyone.
I’m using angular $interval with cordova-media-plugin to create a seek bar with ionic range component.
It works fine. But whenever I seek to a position by dragging. The interval stops updating the value of seek_value.
####HTML Code:
<div class="item range range-positive">
<small class="light">{{ song_time }}</small>
<input type="range" name="seek-bar" min="0" max="{{ song_time_seconds }}" ng-model="seek_value" ng-change="updateSeeker({{ seek_value }})">
<small class="light">{{ position }}</small>
</div>
JS Code
(it runs when players starts)
$interval(function(){
$rootScope.track.getCurrentPosition(
function (position) {
$scope.seek_value = window.Math.floor(position);
$scope.position = convertToCorrectFormat(window.Math.floor(position));
}
);
}, 500);
And this is code for ng-change:
$scope.updateSeeker = function(val){
$rootScope.track.seekTo(val * 1000);
$scope.seek_value = val;
};