Browse Source

Added unsupported media for Safari

OPUS is not supported there yet
master
Igor Zhukov 10 years ago
parent
commit
7f5c67cb18
  1. 14
      app/js/directives.js

14
app/js/directives.js

@ -2441,8 +2441,8 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2441,8 +2441,8 @@ angular.module('myApp.directives', ['myApp.filters'])
downloadPromise.then(function () {
onContentLoaded(function () {
var audioEl = $('audio', element)[0];
if (audioEl) {
var errorListenerEl = $('audio', element)[0] || element[0];
if (errorListenerEl) {
var errorAlready = false;
var onAudioError = function (event) {
if (errorAlready) {
@ -2462,16 +2462,18 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -2462,16 +2462,18 @@ angular.module('myApp.directives', ['myApp.filters'])
}
};
audioEl.addEventListener('error', onAudioError, true);
$(audioEl).on('$destroy', function () {
errorListenerEl.addEventListener('error', onAudioError, true);
$scope.$on('$destroy', function () {
errorAlready = true;
audioEl.removeEventListener('error', onAudioError);
errorListenerEl.removeEventListener('error', onAudioError);
});
}
setTimeout(function () {
checkPlayer($scope.mediaPlayer.player);
$scope.mediaPlayer.player.setVolume(audioVolume);
$scope.mediaPlayer.player.play();
})
}, 300);
});
})
}
};

Loading…
Cancel
Save