Browse Source

Added unsupported media for Safari

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

20
app/js/directives.js

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

Loading…
Cancel
Save