-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
src method failed between frames #1195
Labels
Comments
shmulik
changed the title
src method failed netween frames
src method failed between frames
May 7, 2014
I don't believe |
We should be able to do a similar shim to how we're doing Object.create, vjs.obj.isArray = Array.isArray || function(arr) {
return Object.prototype.toString.call(arr) === "[object Array]";
}; |
Yeah, that sounds good to me. @shmulik, do you want to make a pull request for this? |
shmulik
added a commit
to shmulik/video.js
that referenced
this issue
May 18, 2014
instanceof Array, will not work on arrays created cross frames. Array,isArray is the method to check if an object isArray across frames. IE8 does not suppoort the Array.isArray method, so we have to create a shim to support all browsers.
shmulik
added a commit
to shmulik/video.js
that referenced
this issue
May 18, 2014
instanceof Array, will not work on arrays created cross frames. Array,isArray is the method to check if an object isArray across frames. IE8 does not suppoort the Array.isArray method, so we have to create a shim to support all browsers.
shmulik
added a commit
to shmulik/video.js
that referenced
this issue
May 19, 2014
vjs.Player.prototype.src uses the instanceof Array method. This will not work for arrays created on another frame, Instead of instanceof we should use Array.isArray, but this is not supported on IE8. So vjs.obj.isArray shim was created for the isArray method.
The PR's looking good so far. Thanks! |
shmulik
added a commit
to shmulik/video.js
that referenced
this issue
May 20, 2014
Using the instanceof Array method will not work for arrays created on another frame, Instead of instanceof we should use Array.isArray, but this is not supported on IE8. So vjs.obj.isArray shim was created for the isArray method.
shmulik
added a commit
to shmulik/video.js
that referenced
this issue
May 20, 2014
Adding test for the vjs.obj.isArray method
shmulik
added a commit
to shmulik/video.js
that referenced
this issue
May 20, 2014
Added test for the vjs.obj.isArray method.
shmulik
added a commit
to shmulik/video.js
that referenced
this issue
May 20, 2014
Added test for the vgs.obj.isArray
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am creating my playlist in the main window.
Each playlist have an array of sources.
The videojs player is running in an Iframe.
Each time an Item on the playlist is clicked, I am changing the src of the player using the src method, passing it the sources array.
But, since the code in "vjs.Player.prototype.src" function use "if (source instanceof Array)", and since the array of sources was created in another frame, the result of instanceof is false, and the sources not updated.
You should instead, use "Array.isArray(source)" to do the test for array.
Read more about "instanceof and multiple context (e.g. frames or windows)" here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof
The text was updated successfully, but these errors were encountered: