diff --git a/cms/static/sass/elements/_xmodules.scss b/cms/static/sass/elements/_xmodules.scss index a8ec208b02..db1a50b40c 100644 --- a/cms/static/sass/elements/_xmodules.scss +++ b/cms/static/sass/elements/_xmodules.scss @@ -2,7 +2,7 @@ // ==================== // Video Alpha -.xmodule_VideoAlphaModule { +.xmodule_VideoModule { // display mode &.xmodule_display { diff --git a/cms/templates/widgets/videoalpha/codemirror-edit.html b/cms/templates/widgets/video/codemirror-edit.html similarity index 100% rename from cms/templates/widgets/videoalpha/codemirror-edit.html rename to cms/templates/widgets/video/codemirror-edit.html diff --git a/cms/templates/widgets/videoalpha/subtitles.html b/cms/templates/widgets/video/subtitles.html similarity index 100% rename from cms/templates/widgets/videoalpha/subtitles.html rename to cms/templates/widgets/video/subtitles.html diff --git a/common/lib/xmodule/xmodule/css/video/display.scss b/common/lib/xmodule/xmodule/css/video/display.scss index 879aee3f72..533ab2aec0 100644 --- a/common/lib/xmodule/xmodule/css/video/display.scss +++ b/common/lib/xmodule/xmodule/css/video/display.scss @@ -10,11 +10,30 @@ div.video { padding: 12px; border-radius: 5px; + div.tc-wrapper { + position: relative; + @include clearfix; + } + article.video-wrapper { float: left; margin-right: flex-gutter(9); width: flex-grid(6, 9); + background-color: black; + + position: relative; + + div.video-player-pre { + height: 50px; + background-color: black; + } + + div.video-player-post { + height: 50px; + background-color: black; + } + section.video-player { height: 0; overflow: hidden; @@ -52,10 +71,19 @@ div.video { border-radius: 0; border-top: 1px solid #000; box-shadow: inset 0 1px 0 #eee, 0 1px 0 #555; - height: 7px; + position: absolute; + z-index: 1; + bottom: 100%; + left: 0; + right: 0; + height: 14px; margin-left: -1px; margin-right: -1px; - @include transition(height 2.0s ease-in-out 0s); + -webkit-transition: -webkit-transform 0.7s ease-in-out; + -moz-transition: -moz-transform 0.7s ease-in-out; + -ms-transition: -ms-transform 0.7s ease-in-out; + transition: transform 0.7s ease-in-out; + @include transform(scaleY(0.5) translate3d(0, 50%, 0)); div.ui-widget-header { background: #777; @@ -66,14 +94,18 @@ div.video { background: $pink url(../images/slider-handle.png) center center no-repeat; background-size: 50%; border: 1px solid darken($pink, 20%); - border-radius: 15px; + border-radius: 50%; box-shadow: inset 0 1px 0 lighten($pink, 10%); cursor: pointer; - height: 15px; - margin-left: -7px; - top: -4px; - @include transition(height 2.0s ease-in-out 0s, width 2.0s ease-in-out 0s); - width: 15px; + height: 20px; + margin-left: 0; + top: 0; + -webkit-transition: -webkit-transform 0.7s ease-in-out; + -moz-transition: -moz-transform 0.7s ease-in-out; + -ms-transition: -ms-transform 0.7s ease-in-out; + transition: transform 0.7s ease-in-out; + @include transform(scale(.7, 1.3) translate3d(-80%, -15%, 0)); + width: 20px; &:focus, &:hover { background-color: lighten($pink, 10%); @@ -101,7 +133,6 @@ div.video { line-height: 46px; padding: 0 lh(.75); text-indent: -9999px; - @include transition(background-color 0.75s linear 0s, opacity 0.75s linear 0s); width: 14px; background: url('../images/vcr.png') 15px 15px no-repeat; outline: 0; @@ -118,7 +149,7 @@ div.video { &.play { background-position: 17px -114px; - &:hover { + &:hover, &:focus { background-color: #444; } } @@ -126,7 +157,7 @@ div.video { &.pause { background-position: 16px -50px; - &:hover { + &:hover, &:focus { background-color: #444; } } @@ -213,7 +244,7 @@ div.video { // fix for now ol.video_speeds { - box-shadow: inset 1px 0 0 #555, 0 3px 0 #444; + box-shadow: inset 1px 0 0 #555, 0 4px 0 #444; @include transition(none); background-color: #444; border: 1px solid #000; @@ -221,7 +252,7 @@ div.video { display: none; opacity: 0.0; position: absolute; - width: 133px; + width: 131px; z-index: 10; li { @@ -268,12 +299,15 @@ div.video { &.muted { &>a { - background: url('../images/mute.png') 10px center no-repeat; + background-image: url('../images/mute.png'); } } > a { - background: url('../images/volume.png') 10px center no-repeat; + background-image: url('../images/volume.png'); + background-position: 10px center; + background-repeat: no-repeat; + border-right: 1px solid #000; box-shadow: 1px 0 0 #555, inset 1px 0 0 #555; @include clearfix(); @@ -350,7 +384,7 @@ div.video { @include transition(none); width: 30px; - &:hover { + &:hover, &:active, &:focus { background-color: #444; color: #fff; text-decoration: none; @@ -362,7 +396,7 @@ div.video { border-right: 1px solid #000; box-shadow: 1px 0 0 #555, inset 1px 0 0 #555; color: #797979; - display: block; + display: none; float: left; line-height: 46px; //height of play pause buttons margin-left: 0; @@ -371,7 +405,7 @@ div.video { @include transition(none); width: 30px; - &:hover { + &:hover, &:focus { background-color: #444; color: #fff; text-decoration: none; @@ -387,8 +421,6 @@ div.video { a.hide-subtitles { background: url('../images/cc.png') center no-repeat; - color: #797979; - display: block; float: left; font-weight: 800; line-height: 46px; //height of play pause buttons @@ -401,7 +433,7 @@ div.video { -webkit-font-smoothing: antialiased; width: 30px; - &:hover { + &:hover, &:focus { background-color: #444; color: #fff; text-decoration: none; @@ -410,6 +442,8 @@ div.video { &.off { opacity: 0.7; } + + color: #797979; } } } @@ -420,15 +454,10 @@ div.video { } div.slider { - height: 14px; - margin-top: -7px; + @include transform(scaleY(1) translate3d(0, 0, 0)); a.ui-slider-handle { - border-radius: 20px; - height: 20px; - margin-left: -10px; - top: -4px; - width: 20px; + @include transform(scale(1) translate3d(-50%, -15%, 0)); } } } @@ -471,22 +500,47 @@ div.video { article.video-wrapper { width: flex-grid(9,9); + + background-color: inherit; + } + + article.video-wrapper section.video-controls.html5 { + bottom: 0px; + left: 0px; + right: 0px; + position: absolute; + z-index: 1; + } + + article.video-wrapper div.video-player-pre, article.video-wrapper div.video-player-post { + height: 0px; } ol.subtitles { - width: 0; - height: 0; + width: 0; + height: 0; + } + + ol.subtitles.html5 { + background-color: rgba(243, 243, 243, 0.8); + height: 100%; + position: absolute; + right: 0; + bottom: 0; + top: 0; + width: 275px; + padding: 0 20px; + z-index: 0; } } - &.fullscreen { + &.video-fullscreen { background: rgba(#000, .95); border: 0; bottom: 0; height: 100%; left: 0; margin: 0; - overflow: hidden; padding: 0; position: fixed; top: 0; @@ -501,12 +555,22 @@ div.video { } } + article.video-wrapper div.video-player-pre, article.video-wrapper div.video-player-post { + height: 0px; + } + + article.video-wrapper { + position: static; + } + div.tc-wrapper { @include clearfix; display: table; width: 100%; height: 100%; + position: static; + article.video-wrapper { width: 100%; display: table-cell; @@ -536,7 +600,7 @@ div.video { background: rgba(#000, .8); bottom: 0; height: 100%; - max-height: 100%; + max-height: 460px; max-width: flex-grid(3); padding: lh(); position: fixed; diff --git a/common/lib/xmodule/xmodule/css/videoalpha/common_tabs_edit.scss b/common/lib/xmodule/xmodule/css/videoalpha/common_tabs_edit.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/common/lib/xmodule/xmodule/css/videoalpha/display.scss b/common/lib/xmodule/xmodule/css/videoalpha/display.scss deleted file mode 100644 index 93c387315a..0000000000 --- a/common/lib/xmodule/xmodule/css/videoalpha/display.scss +++ /dev/null @@ -1,620 +0,0 @@ -& { - margin-bottom: 30px; -} - -div.videoalpha { - @include clearfix(); - background: #f3f3f3; - display: block; - margin: 0 -12px; - padding: 12px; - border-radius: 5px; - - div.tc-wrapper { - position: relative; - @include clearfix; - } - - article.video-wrapper { - float: left; - margin-right: flex-gutter(9); - width: flex-grid(6, 9); - - background-color: black; - - position: relative; - - div.video-player-pre { - height: 50px; - background-color: black; - } - - div.video-player-post { - height: 50px; - background-color: black; - } - - section.video-player { - height: 0; - overflow: hidden; - padding-bottom: 56.25%; - position: relative; - - object, iframe { - border: none; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; - } - } - - section.video-controls { - @include clearfix(); - background: #333; - border: 1px solid #000; - border-top: 0; - color: #ccc; - position: relative; - - &:hover { - ul, div { - opacity: 1.0; - } - } - - div.slider { - @include clearfix(); - background: #c2c2c2; - border: 1px solid #000; - border-radius: 0; - border-top: 1px solid #000; - box-shadow: inset 0 1px 0 #eee, 0 1px 0 #555; - position: absolute; - z-index: 1; - bottom: 100%; - left: 0; - right: 0; - height: 14px; - margin-left: -1px; - margin-right: -1px; - -webkit-transition: -webkit-transform 0.7s ease-in-out; - -moz-transition: -moz-transform 0.7s ease-in-out; - -ms-transition: -ms-transform 0.7s ease-in-out; - transition: transform 0.7s ease-in-out; - @include transform(scaleY(0.5) translate3d(0, 50%, 0)); - - div.ui-widget-header { - background: #777; - box-shadow: inset 0 1px 0 #999; - } - - a.ui-slider-handle { - background: $pink url(../images/slider-handle.png) center center no-repeat; - background-size: 50%; - border: 1px solid darken($pink, 20%); - border-radius: 50%; - box-shadow: inset 0 1px 0 lighten($pink, 10%); - cursor: pointer; - height: 20px; - margin-left: 0; - top: 0; - -webkit-transition: -webkit-transform 0.7s ease-in-out; - -moz-transition: -moz-transform 0.7s ease-in-out; - -ms-transition: -ms-transform 0.7s ease-in-out; - transition: transform 0.7s ease-in-out; - @include transform(scale(.7, 1.3) translate3d(-80%, -15%, 0)); - width: 20px; - - &:focus, &:hover { - background-color: lighten($pink, 10%); - outline: none; - } - } - } - - ul.vcr { - float: left; - list-style: none; - margin: 0 lh() 0 0; - padding: 0; - - li { - float: left; - margin-bottom: 0; - - a { - border-bottom: none; - border-right: 1px solid #000; - box-shadow: 1px 0 0 #555; - cursor: pointer; - display: block; - line-height: 46px; - padding: 0 lh(.75); - text-indent: -9999px; - width: 14px; - background: url('../images/vcr.png') 15px 15px no-repeat; - outline: 0; - - &:focus { - outline: 0; - } - - &:empty { - height: 46px; - background: url('../images/vcr.png') 15px 15px no-repeat; - } - - &.play { - background-position: 17px -114px; - - &:hover, &:focus { - background-color: #444; - } - } - - &.pause { - background-position: 16px -50px; - - &:hover, &:focus { - background-color: #444; - } - } - } - - div.vidtime { - padding-left: lh(.75); - font-weight: bold; - line-height: 46px; //height of play pause buttons - padding-left: lh(.75); - -webkit-font-smoothing: antialiased; - } - } - } - - div.secondary-controls { - float: right; - - div.speeds { - float: left; - position: relative; - - &.open { - &>a { - background: url('../images/open-arrow.png') 10px center no-repeat; - } - - ol.video_speeds { - display: block; - opacity: 1.0; - padding: 0; - margin: 0; - list-style: none; - } - } - - &>a { - background: url('../images/closed-arrow.png') 10px center no-repeat; - border-left: 1px solid #000; - border-right: 1px solid #000; - box-shadow: 1px 0 0 #555, inset 1px 0 0 #555; - @include clearfix(); - color: #fff; - cursor: pointer; - display: block; - line-height: 46px; //height of play pause buttons - margin-right: 0; - padding-left: 15px; - position: relative; - @include transition(none); - -webkit-font-smoothing: antialiased; - width: 116px; - outline: 0; - - &:focus { - outline: 0; - } - - h3 { - color: #999; - float: left; - font-size: em(14); - font-weight: normal; - letter-spacing: 1px; - padding: 0 lh(.25) 0 lh(.5); - line-height: 46px; - text-transform: uppercase; - } - - p.active { - float: left; - font-weight: bold; - margin-bottom: 0; - padding: 0 lh(.5) 0 0; - line-height: 46px; - color: #fff; - } - - &:hover, &:active, &:focus { - opacity: 1.0; - background-color: #444; - } - } - - // fix for now - ol.video_speeds { - box-shadow: inset 1px 0 0 #555, 0 4px 0 #444; - @include transition(none); - background-color: #444; - border: 1px solid #000; - bottom: 46px; - display: none; - opacity: 0.0; - position: absolute; - width: 131px; - z-index: 10; - - li { - box-shadow: 0 1px 0 #555; - border-bottom: 1px solid #000; - color: #fff; - cursor: pointer; - - a { - border: 0; - color: #fff; - display: block; - padding: lh(.5); - - &:hover { - background-color: #666; - color: #aaa; - } - } - - &.active { - font-weight: bold; - } - - &:last-child { - box-shadow: none; - border-bottom: 0; - margin-top: 0; - } - } - } - } - - div.volume { - float: left; - position: relative; - - &.open { - .volume-slider-container { - display: block; - opacity: 1.0; - } - } - - &.muted { - &>a { - background-image: url('../images/mute.png'); - } - } - - > a { - background-image: url('../images/volume.png'); - background-position: 10px center; - background-repeat: no-repeat; - - border-right: 1px solid #000; - box-shadow: 1px 0 0 #555, inset 1px 0 0 #555; - @include clearfix(); - color: #fff; - cursor: pointer; - display: block; - height: 46px; - margin-right: 0; - padding-left: 15px; - position: relative; - @include transition(none); - -webkit-font-smoothing: antialiased; - width: 30px; - - &:hover, &:active, &:focus { - background-color: #444; - } - } - - .volume-slider-container { - box-shadow: inset 1px 0 0 #555, 0 3px 0 #444; - @include transition(none); - background-color: #444; - border: 1px solid #000; - bottom: 46px; - display: none; - opacity: 0.0; - position: absolute; - width: 45px; - height: 125px; - margin-left: -1px; - z-index: 10; - - .volume-slider { - height: 100px; - border: 0; - width: 5px; - margin: 14px auto; - background: #666; - border: 1px solid #000; - box-shadow: 0 1px 0 #333; - - a.ui-slider-handle { - background: $pink url(../images/slider-handle.png) center center no-repeat; - background-size: 50%; - border: 1px solid darken($pink, 20%); - border-radius: 15px; - box-shadow: inset 0 1px 0 lighten($pink, 10%); - cursor: pointer; - height: 15px; - left: -6px; - @include transition(height 2.0s ease-in-out 0s, width 2.0s ease-in-out 0s); - width: 15px; - } - - .ui-slider-range { - background: #ddd; - } - } - } - } - - a.add-fullscreen { - background: url(../images/fullscreen.png) center no-repeat; - border-right: 1px solid #000; - box-shadow: 1px 0 0 #555, inset 1px 0 0 #555; - color: #797979; - display: block; - float: left; - line-height: 46px; //height of play pause buttons - margin-left: 0; - padding: 0 lh(.5); - text-indent: -9999px; - @include transition(none); - width: 30px; - - &:hover, &:active, &:focus { - background-color: #444; - color: #fff; - text-decoration: none; - } - } - - a.quality_control { - background: url(../images/hd.png) center no-repeat; - border-right: 1px solid #000; - box-shadow: 1px 0 0 #555, inset 1px 0 0 #555; - color: #797979; - display: none; - float: left; - line-height: 46px; //height of play pause buttons - margin-left: 0; - padding: 0 lh(.5); - text-indent: -9999px; - @include transition(none); - width: 30px; - - &:hover, &:focus { - background-color: #444; - color: #fff; - text-decoration: none; - } - - &.active { - background-color: #F44; - color: #0ff; - text-decoration: none; - } - } - - - a.hide-subtitles { - background: url('../images/cc.png') center no-repeat; - float: left; - font-weight: 800; - line-height: 46px; //height of play pause buttons - margin-left: 0; - opacity: 1.0; - padding: 0 lh(.5); - position: relative; - text-indent: -9999px; - @include transition(none); - -webkit-font-smoothing: antialiased; - width: 30px; - - &:hover, &:focus { - background-color: #444; - color: #fff; - text-decoration: none; - } - - &.off { - opacity: 0.7; - } - - color: #797979; - } - } - } - - &:hover section.video-controls { - ul, div { - opacity: 1.0; - } - - div.slider { - @include transform(scaleY(1) translate3d(0, 0, 0)); - - a.ui-slider-handle { - @include transform(scale(1) translate3d(-50%, -15%, 0)); - } - } - } - } - - ol.subtitles { - padding-left: 0; - float: left; - max-height: 460px; - overflow: auto; - width: flex-grid(3, 9); - margin: 0; - font-size: 14px; - list-style: none; - - li { - border: 0; - color: #666; - cursor: pointer; - margin-bottom: 8px; - padding: 0; - line-height: lh(); - - &.current { - color: #333; - font-weight: 700; - } - - &:hover { - color: $blue; - } - - &:empty { - margin-bottom: 0px; - } - } - } - - &.closed { - - article.video-wrapper { - width: flex-grid(9,9); - - background-color: inherit; - } - - article.video-wrapper section.video-controls.html5 { - bottom: 0px; - left: 0px; - right: 0px; - position: absolute; - z-index: 1; - } - - article.video-wrapper div.video-player-pre, article.video-wrapper div.video-player-post { - height: 0px; - } - - ol.subtitles { - width: 0; - height: 0; - } - - ol.subtitles.html5 { - background-color: rgba(243, 243, 243, 0.8); - height: 100%; - position: absolute; - right: 0; - bottom: 0; - top: 0; - width: 275px; - padding: 0 20px; - z-index: 0; - } - } - - &.video-fullscreen { - background: rgba(#000, .95); - border: 0; - bottom: 0; - height: 100%; - left: 0; - margin: 0; - padding: 0; - position: fixed; - top: 0; - width: 100%; - z-index: 999; - vertical-align: middle; - - &.closed { - ol.subtitles { - right: -(flex-grid(4)); - width: auto; - } - } - - article.video-wrapper div.video-player-pre, article.video-wrapper div.video-player-post { - height: 0px; - } - - article.video-wrapper { - position: static; - } - - div.tc-wrapper { - @include clearfix; - display: table; - width: 100%; - height: 100%; - - position: static; - - article.video-wrapper { - width: 100%; - display: table-cell; - vertical-align: middle; - float: none; - } - - object, iframe { - bottom: 0; - height: 100%; - left: 0; - overflow: hidden; - position: fixed; - top: 0; - } - - section.video-controls { - bottom: 0; - left: 0; - position: absolute; - width: 100%; - z-index: 9999; - } - } - - ol.subtitles { - background: rgba(#000, .8); - bottom: 0; - height: 100%; - max-height: 460px; - max-width: flex-grid(3); - padding: lh(); - position: fixed; - right: 0; - top: 0; - @include transition(none); - - li { - color: #aaa; - - &.current { - color: #fff; - } - } - } - } -} diff --git a/common/lib/xmodule/xmodule/js/fixtures/video_all.html b/common/lib/xmodule/xmodule/js/fixtures/video_all.html index a98e2bf0a2..25a3c2c0ab 100644 --- a/common/lib/xmodule/xmodule/js/fixtures/video_all.html +++ b/common/lib/xmodule/xmodule/js/fixtures/video_all.html @@ -3,7 +3,7 @@
${_('Download video here.') % source}
+ % if not settings.MITX_FEATURES['STUB_VIDEO_FOR_TESTING']: + data-streams="${youtube_streams}" + % endif + + ${'data-sub="{}"'.format(sub) if sub else ''} + ${'data-autoplay="{}"'.format(autoplay) if autoplay else ''} + + % if not settings.MITX_FEATURES['STUB_VIDEO_FOR_TESTING']: + ${'data-mp4-source="{}"'.format(sources.get('mp4')) if sources.get('mp4') else ''} + ${'data-webm-source="{}"'.format(sources.get('webm')) if sources.get('webm') else ''} + ${'data-ogg-source="{}"'.format(sources.get('ogv')) if sources.get('ogv') else ''} + % endif + + data-caption-data-dir="${data_dir}" + data-show-captions="${show_captions}" + data-start="${start}" + data-end="${end}" + data-caption-asset-path="${caption_asset_path}" + data-autoplay="${autoplay}" +> +${(_('Download video') + ' ' + _('here') + '.') % sources.get('main')}
+${_('Download subtitles here.') % track}
-${(_('Download subtitles') + ' ' + _('here') + '.') % track}
+${(_('Download video') + ' ' + _('here') + '.') % sources.get('main')}
-${(_('Download subtitles') + ' ' + _('here') + '.') % track}
-