\n"); //toContain("
");
+ expect(videoControl.secondaryControlsEl.html()).toContain("
\n");
});
it('create the slider', function() {
@@ -29,7 +29,7 @@
range: "min",
min: 0,
max: 100,
- value: 100,
+ /* value: 100, */
value: videoVolumeControl.currentVolume,
change: videoVolumeControl.onChange,
slide: videoVolumeControl.onChange
@@ -83,7 +83,7 @@
});
});
});
-
+
describe('toggleMute', function() {
beforeEach(function() {
initialize();
@@ -103,14 +103,14 @@
expect(videoVolumeControl.currentVolume).toEqual(0);
});
});
-
+
describe('when the current volume is 0', function() {
beforeEach(function() {
videoVolumeControl.currentVolume = 0;
videoVolumeControl.previousVolume = 60;
videoVolumeControl.buttonEl.trigger('click');
});
-
+
it('set the player volume to previous volume', function() {
expect(videoVolumeControl.currentVolume).toEqual(60);
});
diff --git a/common/lib/xmodule/xmodule/js/src/videoalpha/01_helper_utils.js b/common/lib/xmodule/xmodule/js/src/videoalpha/01_helper_utils.js
index 451fc5e45d..1632ba9e5c 100644
--- a/common/lib/xmodule/xmodule/js/src/videoalpha/01_helper_utils.js
+++ b/common/lib/xmodule/xmodule/js/src/videoalpha/01_helper_utils.js
@@ -72,3 +72,9 @@ if (!Array.prototype.indexOf) {
return -1;
}
}
+
+if (!window.onTouchBasedDevice) {
+ window.onTouchBasedDevice = function() {
+ return navigator.userAgent.match(/iPhone|iPod|iPad/i);
+ };
+}
diff --git a/common/lib/xmodule/xmodule/js/src/videoalpha/04_video_player.js b/common/lib/xmodule/xmodule/js/src/videoalpha/04_video_player.js
index 1682ce8ad1..b37f3f9042 100644
--- a/common/lib/xmodule/xmodule/js/src/videoalpha/04_video_player.js
+++ b/common/lib/xmodule/xmodule/js/src/videoalpha/04_video_player.js
@@ -253,6 +253,10 @@ function (HTML5Video) {
function onEnded() {
this.trigger(['videoControl','pause'], null);
+
+ if (this.config.show_captions) {
+ this.trigger(['videoCaption','pause'], null);
+ }
}
function onPause() {
@@ -267,6 +271,10 @@ function (HTML5Video) {
delete this.videoPlayer.updateInterval;
this.trigger(['videoControl','pause'], null);
+
+ if (this.config.show_captions) {
+ this.trigger(['videoCaption','pause'], null);
+ }
}
function onPlay() {
@@ -282,6 +290,10 @@ function (HTML5Video) {
}
this.trigger(['videoControl','play'], null);
+
+ if (this.config.show_captions) {
+ this.trigger(['videoCaption','play'], null);
+ }
}
function onUnstarted() { }
@@ -334,7 +346,7 @@ function (HTML5Video) {
this.videoPlayer.player.setPlaybackRate(this.speed);
}
- if (!onTouchBasedDevice() && $('.video:first').data('autoplay') === 'True') {
+ if (!onTouchBasedDevice() && $('.videoalpha:first').data('autoplay') === 'True') {
this.videoPlayer.play();
}
}
diff --git a/common/lib/xmodule/xmodule/tests/test_videoalpha.py b/common/lib/xmodule/xmodule/tests/test_videoalpha.py
index 909b273104..f2258d1b55 100644
--- a/common/lib/xmodule/xmodule/tests/test_videoalpha.py
+++ b/common/lib/xmodule/xmodule/tests/test_videoalpha.py
@@ -13,7 +13,8 @@ the course, section, subsection, unit, etc.
"""
from xmodule.videoalpha_module import VideoAlphaDescriptor
-from . import LogicTest, etree
+from . import LogicTest
+from lxml import etree
class VideoAlphaModuleTest(LogicTest):