diff --git a/common/lib/xmodule/xmodule/js/src/video/01_initialize.js b/common/lib/xmodule/xmodule/js/src/video/01_initialize.js index ad7edc8b56..2a30ceb454 100644 --- a/common/lib/xmodule/xmodule/js/src/video/01_initialize.js +++ b/common/lib/xmodule/xmodule/js/src/video/01_initialize.js @@ -522,12 +522,9 @@ function (VideoPlayer, i18n) { this.youtubeXhr .always(function (json, status) { - var err = $.isPlainObject(json.error) || - ( - status !== 'success' && - status !== 'notmodified' - ); - if (err) { + // It will work for both if statusCode is 200 or 410. + var didSucceed = (json.error && json.error.code === 410) || status === 'success' || status === 'notmodified'; + if (!didSucceed) { console.log( '[Video info]: YouTube returned an error for ' + 'video with id "' + id + '".'