-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix critical js error in some case #26
base: master
Are you sure you want to change the base?
Conversation
@@ -66,7 +66,7 @@ var Dailymotion = (function (_Tech) { | |||
|
|||
if (typeof this.videoId !== 'undefined') { | |||
this.setTimeout(function () { | |||
_this.setPoster('//api.dailymotion.com/video/' + _this.videoId + '?fields=poster_url&ads=false'); | |||
_this.setPoster('https://api.dailymotion.com/video/' + _this.videoId + '?fields=thumbnail_large_url'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'll be better to stick to //api.
rather than enforcing https://
, that way it'll ensure compatibility from all sort of requests. Don't you think so?
the api doesn't work with http protocol, only https |
this.poster_ = poster; | ||
this.trigger('posterchange'); | ||
var baseClass = this; | ||
$.getJSON(poster, function(data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Videojs get instead if jquey
videojs.xhr({
-
body: someJSONString,
-
uri: "/foo",
-
headers: {
-
"Content-Type": "application/json"
-
}
-
}, function (err, resp, body) {
-
// check resp.statusCode
-
});
there is 1 improvement (poster is now correctly loaded using ajax with jquery)
and 1 bug fix, in some case loadApi() is called but the iframe still doesn't exists yet, this cause a fatal error (from dailymotion js) and avoid any further js to work on the page