From 94ac7fba31c93361596aebd9c15d20effb97b294 Mon Sep 17 00:00:00 2001 From: Peter Fogg Date: Tue, 11 Jun 2013 16:12:58 -0400 Subject: [PATCH] Prevent showing video speeds that aren't set by course author. --- .../xmodule/xmodule/js/src/video/display.coffee | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/video/display.coffee b/common/lib/xmodule/xmodule/js/src/video/display.coffee index ef5d9bf924..582188f752 100644 --- a/common/lib/xmodule/xmodule/js/src/video/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/video/display.coffee @@ -26,11 +26,15 @@ class @Video @videos[speed || @speed] parseVideos: (videos) -> - @videos = - '0.75': @el.data('youtube-id-0-75') - '1.0': @el.data('normal-speed-video-id') - '1.25': @el.data('youtube-id-1-25') - '1.50': @el.data('youtube-id-1-5') + @videos = {} + if @el.data('youtube-id-0-75') + @videos['0.75'] = @el.data('youtube-id-0-75') + if @el.data('normal-speed-video-id') + @videos['1.0'] = @el.data('normal-speed-video-id') + if @el.data('youtube-id-1-25') + @videos['1.25'] = @el.data('youtube-id-1-25') + if @el.data('youtube-id-1-5') + @videos['1.50'] = @el.data('youtube-id-1-5') parseSpeed: -> @setSpeed($.cookie('video_speed'))