Add video image settings to aws settings so that lms can pull values from lms.env.json
This commit is contained in:
@@ -711,46 +711,6 @@ class VideoImageTestCase(VideoUploadTestBase, CourseTestCase):
|
||||
image_min_size=settings.VIDEO_IMAGE_MIN_FILE_SIZE_KB
|
||||
)
|
||||
),
|
||||
# Image file resolution validation
|
||||
(
|
||||
{
|
||||
'width': settings.VIDEO_IMAGE_MAX_WIDTH, # 1280x720
|
||||
'height': settings.VIDEO_IMAGE_MAX_HEIGHT
|
||||
},
|
||||
None
|
||||
),
|
||||
(
|
||||
{
|
||||
'width': 850, # 16:9
|
||||
'height': 478
|
||||
},
|
||||
None
|
||||
),
|
||||
(
|
||||
{
|
||||
'width': 940, # 1.67 ratio, applicable aspect ratio margin of .01
|
||||
'height': 560
|
||||
},
|
||||
None
|
||||
),
|
||||
(
|
||||
{
|
||||
'width': 1200, # not 16:9
|
||||
'height': 100
|
||||
},
|
||||
'This image file must have an aspect ratio of {video_image_aspect_ratio_text}.'.format(
|
||||
video_image_aspect_ratio_text=settings.VIDEO_IMAGE_ASPECT_RATIO_TEXT
|
||||
)
|
||||
),
|
||||
(
|
||||
{
|
||||
'width': settings.VIDEO_IMAGE_MIN_WIDTH + 100,
|
||||
'height': settings.VIDEO_IMAGE_MIN_HEIGHT + 200
|
||||
},
|
||||
'This image file must have an aspect ratio of {video_image_aspect_ratio_text}.'.format(
|
||||
video_image_aspect_ratio_text=settings.VIDEO_IMAGE_ASPECT_RATIO_TEXT
|
||||
)
|
||||
),
|
||||
# Image file minimum width / height
|
||||
(
|
||||
{
|
||||
@@ -782,6 +742,47 @@ class VideoImageTestCase(VideoUploadTestBase, CourseTestCase):
|
||||
image_file_min_height=settings.VIDEO_IMAGE_MIN_HEIGHT
|
||||
)
|
||||
),
|
||||
(
|
||||
{
|
||||
'width': 1200, # not 16:9, but width/height check first.
|
||||
'height': 100
|
||||
},
|
||||
'The minimum allowed image resolution is {image_file_min_width}x{image_file_min_height}.'.format(
|
||||
image_file_min_width=settings.VIDEO_IMAGE_MIN_WIDTH,
|
||||
image_file_min_height=settings.VIDEO_IMAGE_MIN_HEIGHT
|
||||
)
|
||||
),
|
||||
# Image file aspect ratio validation
|
||||
(
|
||||
{
|
||||
'width': settings.VIDEO_IMAGE_MAX_WIDTH, # 1280x720
|
||||
'height': settings.VIDEO_IMAGE_MAX_HEIGHT
|
||||
},
|
||||
None
|
||||
),
|
||||
(
|
||||
{
|
||||
'width': 850, # 16:9
|
||||
'height': 478
|
||||
},
|
||||
None
|
||||
),
|
||||
(
|
||||
{
|
||||
'width': 940, # 1.67 ratio, applicable aspect ratio margin of .01
|
||||
'height': 560
|
||||
},
|
||||
None
|
||||
),
|
||||
(
|
||||
{
|
||||
'width': settings.VIDEO_IMAGE_MIN_WIDTH + 100,
|
||||
'height': settings.VIDEO_IMAGE_MIN_HEIGHT + 200
|
||||
},
|
||||
'This image file must have an aspect ratio of {video_image_aspect_ratio_text}.'.format(
|
||||
video_image_aspect_ratio_text=settings.VIDEO_IMAGE_ASPECT_RATIO_TEXT
|
||||
)
|
||||
),
|
||||
# Image file name validation
|
||||
(
|
||||
{
|
||||
|
||||
@@ -186,15 +186,15 @@ def validate_video_image(image_file):
|
||||
except TypeError:
|
||||
return _('This image file is corrupted.')
|
||||
image_file_aspect_ratio = abs(image_file_width / float(image_file_height) - settings.VIDEO_IMAGE_ASPECT_RATIO)
|
||||
if image_file_aspect_ratio > settings.VIDEO_IMAGE_ASPECT_RATIO_ERROR_MARGIN:
|
||||
error = _('This image file must have an aspect ratio of {video_image_aspect_ratio_text}.').format(
|
||||
video_image_aspect_ratio_text=settings.VIDEO_IMAGE_ASPECT_RATIO_TEXT
|
||||
)
|
||||
elif image_file_width < settings.VIDEO_IMAGE_MIN_WIDTH or image_file_height < settings.VIDEO_IMAGE_MIN_HEIGHT:
|
||||
if image_file_width < settings.VIDEO_IMAGE_MIN_WIDTH or image_file_height < settings.VIDEO_IMAGE_MIN_HEIGHT:
|
||||
error = _('The minimum allowed image resolution is {image_file_min_width}x{image_file_min_height}.').format(
|
||||
image_file_min_width=settings.VIDEO_IMAGE_MIN_WIDTH,
|
||||
image_file_min_height=settings.VIDEO_IMAGE_MIN_HEIGHT
|
||||
)
|
||||
elif image_file_aspect_ratio > settings.VIDEO_IMAGE_ASPECT_RATIO_ERROR_MARGIN:
|
||||
error = _('This image file must have an aspect ratio of {video_image_aspect_ratio_text}.').format(
|
||||
video_image_aspect_ratio_text=settings.VIDEO_IMAGE_ASPECT_RATIO_TEXT
|
||||
)
|
||||
else:
|
||||
try:
|
||||
image_file.name.encode('ascii')
|
||||
|
||||
@@ -41,7 +41,9 @@ define(
|
||||
},
|
||||
|
||||
removeVideo: function(event) {
|
||||
var videoView = this;
|
||||
var $thumbnailEl,
|
||||
videoView = this,
|
||||
videoId = videoView.model.get('edx_video_id');
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
@@ -58,6 +60,11 @@ define(
|
||||
type: 'DELETE'
|
||||
}).done(function() {
|
||||
videoView.remove();
|
||||
// TODO: Remove this when cleaning up - EDUCATOR-562
|
||||
$thumbnailEl = $('.thumbnail-error-wrapper[data-video-id="' + videoId + '"]');
|
||||
if ($thumbnailEl.length) {
|
||||
$thumbnailEl.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
@@ -796,6 +796,9 @@ XBLOCK_SETTINGS = ENV_TOKENS.get('XBLOCK_SETTINGS', {})
|
||||
XBLOCK_SETTINGS.setdefault("VideoDescriptor", {})["licensing_enabled"] = FEATURES.get("LICENSING", False)
|
||||
XBLOCK_SETTINGS.setdefault("VideoModule", {})['YOUTUBE_API_KEY'] = AUTH_TOKENS.get('YOUTUBE_API_KEY', YOUTUBE_API_KEY)
|
||||
|
||||
##### VIDEO IMAGE STORAGE #####
|
||||
VIDEO_IMAGE_SETTINGS = ENV_TOKENS.get('VIDEO_IMAGE_SETTINGS', VIDEO_IMAGE_SETTINGS)
|
||||
|
||||
##### CDN EXPERIMENT/MONITORING FLAGS #####
|
||||
CDN_VIDEO_URLS = ENV_TOKENS.get('CDN_VIDEO_URLS', CDN_VIDEO_URLS)
|
||||
ONLOAD_BEACON_SAMPLE_RATE = ENV_TOKENS.get('ONLOAD_BEACON_SAMPLE_RATE', ONLOAD_BEACON_SAMPLE_RATE)
|
||||
|
||||
Reference in New Issue
Block a user