From 27fa9a38d8486b59cdb4fc7a9b49229aed1c3401 Mon Sep 17 00:00:00 2001 From: "Carlos A. Rocha" Date: Wed, 12 Sep 2012 23:56:05 -0400 Subject: [PATCH 1/5] Temporary fix for youTube iframe player issues --- .../js/src/video/display/video_player.coffee | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee index 4b265d20c8..0a387ea52e 100644 --- a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee +++ b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee @@ -34,17 +34,17 @@ class @VideoPlayer extends Subview @volumeControl = new VideoVolumeControl el: @$('.secondary-controls') @speedControl = new VideoSpeedControl el: @$('.secondary-controls'), speeds: @video.speeds, currentSpeed: @currentSpeed() @progressSlider = new VideoProgressSlider el: @$('.slider') - @player = new YT.Player @video.id, - playerVars: - controls: 0 - wmode: 'transparent' - rel: 0 - showinfo: 0 - enablejsapi: 1 - videoId: @video.youtubeId() - events: - onReady: @onReady - onStateChange: @onStateChange + + params = { allowScriptAccess: "always" }; + atts = { id: @videoid }; + youtubeId = @video.youtubeId() + + window.onYouTubePlayerReady = (e) => + @player = document.getElementById("#{@video.id}") + + swfobject.embedSWF("http://www.youtube.com/apiplayer?video_id=#{youtubeId}&enablejsapi=1&version=3&playerapiid=ytplayer&controls=0", + @video.id, "425", "356", "9", null, null, params, atts ) + addToolTip: -> @$('.add-fullscreen, .hide-subtitles').qtip From 11d0c0d4b63705455b206b333a387551d336fd2e Mon Sep 17 00:00:00 2001 From: "Carlos A. Rocha" Date: Thu, 13 Sep 2012 00:10:20 -0400 Subject: [PATCH 2/5] Remove video controls, use default youTube controls instead --- .../js/src/video/display/video_player.coffee | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee index 0a387ea52e..45d0ed4d50 100644 --- a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee +++ b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee @@ -24,26 +24,12 @@ class @VideoPlayer extends Subview @toggleFullScreen(event) render: -> - @control = new VideoControl el: @$('.video-controls') - @caption = new VideoCaption - el: @el - youtubeId: @video.youtubeId('1.0') - currentSpeed: @currentSpeed() - captionDataDir: @video.caption_data_dir - unless onTouchBasedDevice() - @volumeControl = new VideoVolumeControl el: @$('.secondary-controls') - @speedControl = new VideoSpeedControl el: @$('.secondary-controls'), speeds: @video.speeds, currentSpeed: @currentSpeed() - @progressSlider = new VideoProgressSlider el: @$('.slider') - params = { allowScriptAccess: "always" }; atts = { id: @videoid }; youtubeId = @video.youtubeId() - window.onYouTubePlayerReady = (e) => - @player = document.getElementById("#{@video.id}") - - swfobject.embedSWF("http://www.youtube.com/apiplayer?video_id=#{youtubeId}&enablejsapi=1&version=3&playerapiid=ytplayer&controls=0", - @video.id, "425", "356", "9", null, null, params, atts ) + swfobject.embedSWF("http://www.youtube.com/v/#{youtubeId}?enablejsapi=1&version=3&playerapiid=ytplayer", + @video.id, "425", "356", "9", null, null, params, atts ) addToolTip: -> From df5e6d68608e4d529e6c65a789c4a6144a4ae231 Mon Sep 17 00:00:00 2001 From: "Carlos A. Rocha" Date: Thu, 13 Sep 2012 00:16:13 -0400 Subject: [PATCH 3/5] Replace http with https for embedder youTube --- .../xmodule/xmodule/js/src/video/display/video_player.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee index 45d0ed4d50..fed4a0b672 100644 --- a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee +++ b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee @@ -28,7 +28,7 @@ class @VideoPlayer extends Subview atts = { id: @videoid }; youtubeId = @video.youtubeId() - swfobject.embedSWF("http://www.youtube.com/v/#{youtubeId}?enablejsapi=1&version=3&playerapiid=ytplayer", + swfobject.embedSWF("https://www.youtube.com/v/#{youtubeId}?enablejsapi=1&version=3&playerapiid=ytplayer", @video.id, "425", "356", "9", null, null, params, atts ) From 67cbf50b839b7feb54b8b0c69572040a37000853 Mon Sep 17 00:00:00 2001 From: "Carlos A. Rocha" Date: Thu, 13 Sep 2012 01:08:59 -0400 Subject: [PATCH 4/5] Fix swfobject and django-pipeline - Cosmetic fix for youtube player --- .../xmodule/xmodule/js/src/video/display/video_player.coffee | 2 +- lms/envs/common.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee index fed4a0b672..b83cda80d6 100644 --- a/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee +++ b/common/lib/xmodule/xmodule/js/src/video/display/video_player.coffee @@ -28,7 +28,7 @@ class @VideoPlayer extends Subview atts = { id: @videoid }; youtubeId = @video.youtubeId() - swfobject.embedSWF("https://www.youtube.com/v/#{youtubeId}?enablejsapi=1&version=3&playerapiid=ytplayer", + swfobject.embedSWF("https://www.youtube.com/v/#{youtubeId}?enablejsapi=1&version=3&playerapiid=ytplayer&rel=0&modestbranding=1&showsearch=0&showinfo=0", @video.id, "425", "356", "9", null, null, params, atts ) diff --git a/lms/envs/common.py b/lms/envs/common.py index 3cfaae940d..f4e007d926 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -443,9 +443,9 @@ courseware_only_js += [ main_vendor_js = [ 'js/vendor/jquery.min.js', 'js/vendor/jquery-ui.min.js', - 'js/vendor/swfobject/swfobject.js', 'js/vendor/jquery.cookie.js', 'js/vendor/jquery.qtip.min.js', + 'js/vendor/swfobject/swfobject.js', ] discussion_js = sorted(glob2.glob(PROJECT_ROOT / 'static/coffee/src/discussion/*.coffee')) From e0c7cef65fe245b9d9be7e413014805a9c039636 Mon Sep 17 00:00:00 2001 From: "Carlos A. Rocha" Date: Thu, 13 Sep 2012 01:35:25 -0400 Subject: [PATCH 5/5] Workaround for swfobject - pipeline problems --- lms/templates/video.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lms/templates/video.html b/lms/templates/video.html index bd3ec77fbe..25652e51fa 100644 --- a/lms/templates/video.html +++ b/lms/templates/video.html @@ -2,6 +2,8 @@

${display_name}

% endif + +