Fixed youtube video was not loading even youtube is available.

TNL-2361
This commit is contained in:
Waheed Ahmed
2015-06-05 21:41:42 +05:00
committed by Awais Jibran
parent 44bea2eacb
commit f9fe00ff6c

View File

@@ -532,12 +532,9 @@ function (VideoPlayer, VideoStorage, 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 + '".'