use [].filter instead of Ox.getObject

This commit is contained in:
rolux 2012-05-21 09:05:35 +03:00
parent b30aff2163
commit 574e128f16

View file

@ -815,7 +815,9 @@ pandora.getVideoOptions = function(data) {
var canPlayClips = data.editable || pandora.site.capabilities.canPlayClips[pandora.user.level] >= data.rightslevel, var canPlayClips = data.editable || pandora.site.capabilities.canPlayClips[pandora.user.level] >= data.rightslevel,
canPlayVideo = data.editable || pandora.site.capabilities.canPlayVideo[pandora.user.level] >= data.rightslevel, canPlayVideo = data.editable || pandora.site.capabilities.canPlayVideo[pandora.user.level] >= data.rightslevel,
options = {}, options = {},
subtitlesLayer = Ox.getObject(pandora.site.layers, 'isSubtitles', true); subtitlesLayer = pandora.site.layers.filter(function(layer) {
return layer.isSubtitles;
})[0];
options.subtitles = subtitlesLayer ? data.layers[subtitlesLayer.id].map(function(subtitle) { options.subtitles = subtitlesLayer ? data.layers[subtitlesLayer.id].map(function(subtitle) {
return { return {
id: subtitle.id, id: subtitle.id,