Commit 7d215e12 by Anton Stupak Committed by Alexander Kryklia

Fixes InvalidStateError failures in FF and more.

Fixes HD button
Disables Fullscreen mode in the Studio
Fixes ui controls bug
parent af0149e5
...@@ -31,6 +31,8 @@ from path import path ...@@ -31,6 +31,8 @@ from path import path
############################ FEATURE CONFIGURATION ############################# ############################ FEATURE CONFIGURATION #############################
MITX_FEATURES = { MITX_FEATURES = {
'IS_CMS': True,
'USE_DJANGO_PIPELINE': True, 'USE_DJANGO_PIPELINE': True,
'GITHUB_PUSH': False, 'GITHUB_PUSH': False,
......
...@@ -70,10 +70,19 @@ div.videoalpha { ...@@ -70,10 +70,19 @@ div.videoalpha {
border-radius: 0; border-radius: 0;
border-top: 1px solid #000; border-top: 1px solid #000;
box-shadow: inset 0 1px 0 #eee, 0 1px 0 #555; 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-left: -1px;
margin-right: -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) translateY(50%));
div.ui-widget-header { div.ui-widget-header {
background: #777; background: #777;
...@@ -84,14 +93,18 @@ div.videoalpha { ...@@ -84,14 +93,18 @@ div.videoalpha {
background: $pink url(../images/slider-handle.png) center center no-repeat; background: $pink url(../images/slider-handle.png) center center no-repeat;
background-size: 50%; background-size: 50%;
border: 1px solid darken($pink, 20%); border: 1px solid darken($pink, 20%);
border-radius: 15px; border-radius: 50%;
box-shadow: inset 0 1px 0 lighten($pink, 10%); box-shadow: inset 0 1px 0 lighten($pink, 10%);
cursor: pointer; cursor: pointer;
height: 15px; height: 20px;
margin-left: -7px; margin-left: 0;
top: -4px; top: 0;
@include transition(height 2.0s ease-in-out 0s, width 2.0s ease-in-out 0s); -webkit-transition: -webkit-transform 0.7s ease-in-out;
width: 15px; -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 { &:focus, &:hover {
background-color: lighten($pink, 10%); background-color: lighten($pink, 10%);
...@@ -380,7 +393,7 @@ div.videoalpha { ...@@ -380,7 +393,7 @@ div.videoalpha {
border-right: 1px solid #000; border-right: 1px solid #000;
box-shadow: 1px 0 0 #555, inset 1px 0 0 #555; box-shadow: 1px 0 0 #555, inset 1px 0 0 #555;
color: #797979; color: #797979;
display: block; display: none;
float: left; float: left;
line-height: 46px; //height of play pause buttons line-height: 46px; //height of play pause buttons
margin-left: 0; margin-left: 0;
...@@ -441,15 +454,10 @@ div.videoalpha { ...@@ -441,15 +454,10 @@ div.videoalpha {
} }
div.slider { div.slider {
height: 14px; @include transform(scaleY(1) translateY(0));
margin-top: -7px;
a.ui-slider-handle { a.ui-slider-handle {
border-radius: 20px; @include transform(scale(1) translate3d(-50%, -15%, 0));
height: 20px;
margin-left: -10px;
top: -4px;
width: 20px;
} }
} }
} }
......
...@@ -8,23 +8,8 @@ window.YT = ...@@ -8,23 +8,8 @@ window.YT =
BUFFERING: 3 BUFFERING: 3
CUED: 5 CUED: 5
window.TYPES =
'undefined' : 'undefined'
'number' : 'number'
'boolean' : 'boolean'
'string' : 'string'
'[object Function]': 'function'
'[object RegExp]' : 'regexp'
'[object Array]' : 'array'
'[object Date]' : 'date'
'[object Error]' : 'error'
window.TOSTRING = Object.prototype.toString
window.STATUS = window.YT.PlayerState window.STATUS = window.YT.PlayerState
window.whatType = (o) ->
TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');
oldGetWithPrefix = window.jQuery.getWithPrefix oldGetWithPrefix = window.jQuery.getWithPrefix
jasmine.stubbedCaption = jasmine.stubbedCaption =
......
...@@ -356,9 +356,9 @@ ...@@ -356,9 +356,9 @@
videoPlayer.updateInterval = 100; videoPlayer.updateInterval = 100;
spyOn(videoPlayer, 'updatePlayTime').andCallThrough(); spyOn(videoPlayer, 'updatePlayTime');
spyOn(videoPlayer, 'log').andCallThrough(); spyOn(videoPlayer, 'log');
spyOn(videoPlayer.player, 'seekTo').andCallThrough(); spyOn(videoPlayer.player, 'seekTo');
}); });
it('Slider event causes log update', function () { it('Slider event causes log update', function () {
......
...@@ -99,7 +99,9 @@ function (VideoPlayer) { ...@@ -99,7 +99,9 @@ function (VideoPlayer) {
my: 'top right', my: 'top right',
at: 'top center' at: 'top center'
} }
} },
inCms: this.el.data('in-studio')
}; };
// Try to parse YouTube stream ID's. If // Try to parse YouTube stream ID's. If
......
...@@ -51,6 +51,10 @@ function () { ...@@ -51,6 +51,10 @@ function () {
state.videoControl.fullScreenState = false; state.videoControl.fullScreenState = false;
if (state.config.inCms === 'True') {
state.videoControl.fullScreenEl.hide();
}
if (!onTouchBasedDevice()) { if (!onTouchBasedDevice()) {
state.videoControl.pause(); state.videoControl.pause();
......
...@@ -41,6 +41,7 @@ function () { ...@@ -41,6 +41,7 @@ function () {
function renderElements(state) { function renderElements(state) {
state.videoQualityControl.el = state.el.find('a.quality_control'); state.videoQualityControl.el = state.el.find('a.quality_control');
state.videoQualityControl.el.show();
state.videoQualityControl.quality = null; state.videoQualityControl.quality = null;
if (!onTouchBasedDevice()) { if (!onTouchBasedDevice()) {
...@@ -71,6 +72,12 @@ function () { ...@@ -71,6 +72,12 @@ function () {
} }
} }
// This function change quality of video.
// Right now we haven't ability to choose quality of HD video,
// 'hd720' will be played by default as HD video(this thing is hardcoded).
// If suggested quality level is not available for the video,
// then the quality will be set to the next lowest level that is available.
// (large -> medium)
function toggleQuality(event) { function toggleQuality(event) {
var newQuality, var newQuality,
value = this.videoQualityControl.quality; value = this.videoQualityControl.quality;
......
...@@ -46,6 +46,7 @@ DISCUSSION_SETTINGS = { ...@@ -46,6 +46,7 @@ DISCUSSION_SETTINGS = {
# Features # Features
MITX_FEATURES = { MITX_FEATURES = {
'IS_CMS': False,
'SAMPLE': False, 'SAMPLE': False,
'USE_DJANGO_PIPELINE': True, 'USE_DJANGO_PIPELINE': True,
'DISPLAY_HISTOGRAMS_TO_STAFF': True, 'DISPLAY_HISTOGRAMS_TO_STAFF': True,
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
data-streams="${youtube_streams}" data-streams="${youtube_streams}"
% endif % endif
data-in-studio="${settings.MITX_FEATURES['IS_CMS']}"
${'data-sub="{}"'.format(sub) if sub else ''} ${'data-sub="{}"'.format(sub) if sub else ''}
${'data-autoplay="{}"'.format(autoplay) if autoplay else ''} ${'data-autoplay="{}"'.format(autoplay) if autoplay else ''}
% if not settings.MITX_FEATURES['STUB_VIDEO_FOR_TESTING']: % if not settings.MITX_FEATURES['STUB_VIDEO_FOR_TESTING']:
......
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