summaryrefslogtreecommitdiffstats
path: root/js/app
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-04-18 17:47:42 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-04-18 17:47:50 +0200
commit1ca71fccb13b726ae47f861a4678431bd7c51ed6 (patch)
tree6fd3f3b8b161d1b1fca470689b7e23df3149a098 /js/app
parent8eaeb793617076475a6851e1f0cc74e53a1f2f96 (diff)
fix broken audio feeds, fix #508
Diffstat (limited to 'js/app')
-rw-r--r--js/app/directives/audio.coffee4
-rw-r--r--js/app/filters/trusturl.coffee25
2 files changed, 27 insertions, 2 deletions
diff --git a/js/app/directives/audio.coffee b/js/app/directives/audio.coffee
index f180cfbeb..3d6d94062 100644
--- a/js/app/directives/audio.coffee
+++ b/js/app/directives/audio.coffee
@@ -29,9 +29,9 @@ angular.module('News').directive 'newsAudio', ->
transclude: true
template: '' +
'<audio controls="controls" preload="none" ng-hide="cantPlay()">' +
- '<source src="{{ src }}">' +
+ '<source ng-src="{{ src|trustUrl }}">' +
'</audio>' +
- '<a href="{{ src }}" class="button" ng-show="cantPlay()" ' +
+ '<a ng-href="{{ src|trustUrl }}" class="button" ng-show="cantPlay()" ' +
'ng-transclude></a>'
link: (scope, elm, attrs) ->
source = elm.children().children('source')[0]
diff --git a/js/app/filters/trusturl.coffee b/js/app/filters/trusturl.coffee
new file mode 100644
index 000000000..d63eafd28
--- /dev/null
+++ b/js/app/filters/trusturl.coffee
@@ -0,0 +1,25 @@
+###
+
+ownCloud - News
+
+@author Bernhard Posselt
+@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+License as published by the Free Software Foundation; either
+version 3 of the License, or any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+
+You should have received a copy of the GNU Affero General Public
+License along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+###
+
+angular.module('News').filter 'trustUrl', ['$sce', ($sce) ->
+ return (url) -> $sce.trustAsResourceUrl(url)
+]