Commit 77c3233f by Anton Stupak

Merge pull request #3824 from edx/anton/fix-transcript-on-ipad

Video: Fix transcript displaying on iPad.
parents b6f933a1 2133ebd0
...@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes, ...@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes,
in roughly chronological order, most recent first. Add your entries at or near in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected. the top. Include a label indicating the component affected.
Blades: Fix displaying transcripts on touch devices. BLD-1033.
Blades: Tolerance expressed in percentage now computes correctly. BLD-522. Blades: Tolerance expressed in percentage now computes correctly. BLD-522.
Studio: Support add, delete and duplicate on the container page. STUD-1490. Studio: Support add, delete and duplicate on the container page. STUD-1490.
......
...@@ -236,18 +236,18 @@ ...@@ -236,18 +236,18 @@
it('render the caption', function () { it('render the caption', function () {
runs(function () { runs(function () {
var captionsData; var captionsData = jasmine.stubbedCaption,
items = $('.subtitles li[data-index]');
captionsData = jasmine.stubbedCaption; _.each(captionsData.text, function (text, index) {
$('.subtitles li[data-index]').each( var item = items.eq(index);
function (index, link) {
expect($(link)).toHaveData('index', index); expect(item).toHaveData('index', index);
expect($(link)).toHaveData( expect(item).toHaveData(
'start', captionsData.start[index] 'start', captionsData.start[index]
); );
expect($(link)).toHaveAttr('tabindex', 0); expect(item).toHaveAttr('tabindex', 0);
expect($(link)).toHaveText(captionsData.text[index]); expect(item).toHaveText(text);
}); });
}); });
}); });
...@@ -324,13 +324,39 @@ ...@@ -324,13 +324,39 @@
$.fn.scrollTo.reset(); $.fn.scrollTo.reset();
}); });
it('show explaination message', function () { it('show explanation message', function () {
expect($('.subtitles li')).toHaveHtml( expect($('.subtitles li')).toHaveHtml(
'Caption will be displayed when you start playing ' + 'Caption will be displayed when you start playing ' +
'the video.' 'the video.'
); );
}); });
it('show captions on play', function () {
runs(function () {
state.el.trigger('play');
});
waitsFor(function () {
return state.videoCaption.rendered;
}, 'Captions are not rendered', WAIT_TIMEOUT);
runs(function () {
var captionsData = jasmine.stubbedCaption,
items = $('.subtitles li[data-index]');
_.each(captionsData.text, function (text, index) {
var item = items.eq(index);
expect(item).toHaveData('index', index);
expect(item).toHaveData(
'start', captionsData.start[index]
);
expect(item).toHaveAttr('tabindex', 0);
expect(item).toHaveText(text);
});
});
});
it('does not set rendered to true', function () { it('does not set rendered to true', function () {
expect(state.videoCaption.rendered).toBeFalsy(); expect(state.videoCaption.rendered).toBeFalsy();
}); });
......
...@@ -119,10 +119,10 @@ function (Sjson, AsyncProcess) { ...@@ -119,10 +119,10 @@ function (Sjson, AsyncProcess) {
'caption:update': function (event, time) { 'caption:update': function (event, time) {
self.updatePlayTime(time); self.updatePlayTime(time);
}, },
'ended': this.pause, 'ended': this.pause.bind(this),
'fullscreen': this.onResize.bind(this), 'fullscreen': this.onResize.bind(this),
'pause': this.pause, 'pause': this.pause.bind(this),
'play': this.play, 'play': this.play.bind(this)
}); });
if ((state.videoType === 'html5') && (state.config.autohideHtml5)) { if ((state.videoType === 'html5') && (state.config.autohideHtml5)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment