From b883d5272213fda5a98bf23205820bab4a09e535 Mon Sep 17 00:00:00 2001 From: Chris Rodriguez Date: Tue, 13 Oct 2015 13:51:19 -0400 Subject: [PATCH] Adding closed captions (not draggable) --- cms/static/cms/js/require-config.js | 2 +- .../xmodule/xmodule/css/video/display.scss | 65 ++++-- .../xmodule/js/fixtures/video_all.html | 1 + .../js/spec/video/video_caption_spec.js | 90 ++++++-- .../js/spec/video/video_player_spec.js | 6 +- .../xmodule/js/src/video/03_video_player.js | 3 +- .../xmodule/js/src/video/09_video_caption.js | 195 ++++++++++++++---- .../test/acceptance/pages/lms/video/video.py | 99 ++++++++- .../acceptance/pages/studio/video/video.py | 10 +- .../tests/video/test_studio_video_editor.py | 2 +- .../tests/video/test_studio_video_module.py | 1 - .../tests/video/test_video_module.py | 88 +++++++- lms/envs/common.py | 2 +- lms/templates/video.html | 1 + 14 files changed, 462 insertions(+), 103 deletions(-) diff --git a/cms/static/cms/js/require-config.js b/cms/static/cms/js/require-config.js index 8139da6206..ee4ca7dad0 100644 --- a/cms/static/cms/js/require-config.js +++ b/cms/static/cms/js/require-config.js @@ -283,7 +283,7 @@ require.config({ "osda":{ exports: "osda", deps: ["annotator", "annotator-harvardx", "video.dev", "vjs.youtube", "rangeslider", "share-annotator", "richText-annotator", "reply-annotator", "tags-annotator", "flagging-annotator", "grouping-annotator", "diacritic-annotator", "openseadragon", "jquery-Watch", "catch", "handlebars", "URI"] - }, + } // end of annotation tool files } }); diff --git a/common/lib/xmodule/xmodule/css/video/display.scss b/common/lib/xmodule/xmodule/css/video/display.scss index c54591a7ff..a0ac08bf06 100644 --- a/common/lib/xmodule/xmodule/css/video/display.scss +++ b/common/lib/xmodule/xmodule/css/video/display.scss @@ -247,6 +247,22 @@ html:not('.afontgarde') .icon-fallback-img { } } + .closed-captions { + position: absolute; + width: 85%; + left: 5%; + top: 70%; + text-align: center; + } + + .closed-captions.is-visible { + max-height: ($baseline * 3); + border-radius: ($baseline / 5); + padding: 8px ($baseline / 2) 8px ($baseline * 1.5); + background: rgba(0, 0, 0, .75); + color: $yellow; + } + .video-player { overflow: hidden; min-height: 300px; @@ -701,39 +717,44 @@ html:not('.afontgarde') .icon-fallback-img { .subtitles { @include float(left); overflow: auto; - margin: 0; max-height: 460px; width: flex-grid(3, 9); padding: 0; font-size: 14px; - list-style: none; visibility: visible; - li { - @extend %ui-fake-link; - margin-bottom: 8px; - border: 0; + .subtitles-menu { + height: 100%; + margin: 0; padding: 0; - color: #0074b5; // AA compliant - line-height: lh(); + list-style: none; - &.current { - color: #333; - font-weight: 700; - } + li { + @extend %ui-fake-link; + margin-bottom: 8px; + border: 0; + padding: 0; + color: #0074b5; // AA compliant + line-height: lh(); - &.focused { - outline: #000 dotted thin; - outline-offset: -1px; - } + &.current { + color: #333; + font-weight: 700; + } - &:hover, - &:focus { - text-decoration: underline; - } + &.focused { + outline: #000 dotted thin; + outline-offset: -1px; + } - &:empty { - margin-bottom: 0; + &:hover, + &:focus { + text-decoration: underline; + } + + &:empty { + margin-bottom: 0; + } } } } diff --git a/common/lib/xmodule/xmodule/js/fixtures/video_all.html b/common/lib/xmodule/xmodule/js/fixtures/video_all.html index 5b20840630..40fe28548e 100644 --- a/common/lib/xmodule/xmodule/js/fixtures/video_all.html +++ b/common/lib/xmodule/xmodule/js/fixtures/video_all.html @@ -17,6 +17,7 @@
+
+