Commit 5d03cad7 by Anton Stupak

Merge pull request #3883 from edx/anton/fix-youtube-regexp

Fix youtube regular expression in video player editor
parents 926ce567 db213bf3
...@@ -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 Youtube regular expression in video player editor. BLD-967.
Blades: Fix displaying transcripts on touch devices. BLD-1033. 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.
......
define( define(
[ [
"jquery", "underscore", 'jquery', 'underscore',
"js/views/video/transcripts/utils", 'js/views/video/transcripts/utils',
"underscore.string", "xmodule", "jasmine-jquery" 'underscore.string', 'xmodule', 'jasmine-jquery'
], ],
function ($, _, Utils, _str) { function ($, _, Utils, _str) {
describe('Transcripts.Utils', function () { 'use strict';
describe('Transcripts.Utils', function () {
var videoId = 'OEoXaMPEzfM', var videoId = 'OEoXaMPEzfM',
ytLinksList = (function (id) { ytLinksList = (function (id) {
var links = [ var links = [
...@@ -33,6 +34,7 @@ function ($, _, Utils, _str) { ...@@ -33,6 +34,7 @@ function ($, _, Utils, _str) {
'http://somelink.com/%s.%s', 'http://somelink.com/%s.%s',
'ftp://somelink.com/%s.%s', 'ftp://somelink.com/%s.%s',
'https://somelink.com/%s.%s', 'https://somelink.com/%s.%s',
'http://cdn.somecdn.net/v/%s.%s',
'somelink.com/%s.%s', 'somelink.com/%s.%s',
'%s.%s' '%s.%s'
], ],
...@@ -214,7 +216,7 @@ function ($, _, Utils, _str) { ...@@ -214,7 +216,7 @@ function ($, _, Utils, _str) {
describe('Method: parseLink', function () { describe('Method: parseLink', function () {
var resultDataDict = { var resultDataDict = {
'html5': { 'html5': {
link: html5LinksList['mp4'][0], link: html5LinksList.mp4[0],
resp: { resp: {
mode: 'html5', mode: 'html5',
video: html5FileName, video: html5FileName,
...@@ -260,5 +262,5 @@ function ($, _, Utils, _str) { ...@@ -260,5 +262,5 @@ function ($, _, Utils, _str) {
}); });
}); });
}); });
}); });
}); });
...@@ -37,6 +37,7 @@ from .video_handlers import VideoStudentViewHandlers, VideoStudioViewHandlers ...@@ -37,6 +37,7 @@ from .video_handlers import VideoStudentViewHandlers, VideoStudioViewHandlers
from urlparse import urlparse from urlparse import urlparse
def get_ext(filename): def get_ext(filename):
# Prevent incorrectly parsing urls like 'http://abc.com/path/video.mp4?xxxx'. # Prevent incorrectly parsing urls like 'http://abc.com/path/video.mp4?xxxx'.
path = urlparse(filename).path path = urlparse(filename).path
......
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