diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/display/video_caption_spec.coffee b/common/lib/xmodule/xmodule/js/spec/videoalpha/display/video_caption_spec.coffee index 8826ff35e9..27d2ceab50 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/display/video_caption_spec.coffee +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/display/video_caption_spec.coffee @@ -337,6 +337,7 @@ describe 'VideoCaptionAlpha', -> describe 'toggle', -> beforeEach -> @player = jasmine.stubVideoPlayerAlpha @ + spyOn @video, 'log' @caption = @player.caption $('.subtitles li[data-index=1]').addClass 'current' @@ -345,6 +346,10 @@ describe 'VideoCaptionAlpha', -> @caption.el.removeClass 'closed' @caption.toggle jQuery.Event('click') + it 'log the hide_transcript event', -> + expect(@video.log).toHaveBeenCalledWith 'hide_transcript', + currentTime: @player.currentTime + it 'hide the caption', -> expect(@caption.el).toHaveClass 'closed' @@ -353,6 +358,10 @@ describe 'VideoCaptionAlpha', -> @caption.el.addClass 'closed' @caption.toggle jQuery.Event('click') + it 'log the show_transcript event', -> + expect(@video.log).toHaveBeenCalledWith 'show_transcript', + currentTime: @player.currentTime + it 'show the caption', -> expect(@caption.el).not.toHaveClass 'closed' diff --git a/common/lib/xmodule/xmodule/js/spec/videoalpha/display/video_player_spec.coffee b/common/lib/xmodule/xmodule/js/spec/videoalpha/display/video_player_spec.coffee index f105def897..e9a5ca30b4 100644 --- a/common/lib/xmodule/xmodule/js/spec/videoalpha/display/video_player_spec.coffee +++ b/common/lib/xmodule/xmodule/js/spec/videoalpha/display/video_player_spec.coffee @@ -432,9 +432,14 @@ describe 'VideoPlayerAlpha', -> describe 'when the video player is not full screen', -> beforeEach -> + spyOn @video, 'log' @player.el.removeClass 'fullscreen' @player.toggleFullScreen(jQuery.Event("click")) + it 'log the fullscreen event', -> + expect(@video.log).toHaveBeenCalledWith 'fullscreen', + currentTime: @player.currentTime + it 'replace the full screen button tooltip', -> expect($('.add-fullscreen')).toHaveAttr 'title', 'Exit fill browser' @@ -446,9 +451,14 @@ describe 'VideoPlayerAlpha', -> describe 'when the video player already full screen', -> beforeEach -> + spyOn @video, 'log' @player.el.addClass 'fullscreen' @player.toggleFullScreen(jQuery.Event("click")) + it 'log the not_fullscreen event', -> + expect(@video.log).toHaveBeenCalledWith 'not_fullscreen', + currentTime: @player.currentTime + it 'replace the full screen button tooltip', -> expect($('.add-fullscreen')).toHaveAttr 'title', 'Fill browser' diff --git a/common/lib/xmodule/xmodule/js/src/videoalpha/display/video_player.coffee b/common/lib/xmodule/xmodule/js/src/videoalpha/display/video_player.coffee index f03f474b13..7019386e04 100644 --- a/common/lib/xmodule/xmodule/js/src/videoalpha/display/video_player.coffee +++ b/common/lib/xmodule/xmodule/js/src/videoalpha/display/video_player.coffee @@ -135,8 +135,6 @@ class @VideoPlayerAlpha extends SubviewAlpha # NOTE: It is my strong belief that in the future YouTube Flash player will # not get speed changes. This is a dying technology. So we can safely use # this indirect method to determine player mode. - - availableSpeeds = @player.getAvailablePlaybackRates() prev_player_type = $.cookie('prev_player_type') if availableSpeeds.length > 1