Skip to content
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 streamtest by updating wrtc.js and adding /dist to static paths. #53

Merged
merged 1 commit into from Jan 23, 2014

Conversation

JessieAMorris
Copy link

This is for #51. This fixes all the examples that use the wrtc.js file.

modeswitch pushed a commit that referenced this pull request Jan 23, 2014
Fix streamtest by updating wrtc.js and adding /dist to static paths.
@modeswitch modeswitch merged commit 43d2b6d into node-webrtc:develop Jan 23, 2014
@piranna
Copy link
Contributor

piranna commented Jan 23, 2014

dist/wrtc.js was autogenerated with browserify using as basis lib/browser.js, changes should be done instead. By the way: that global var, where does it come from? Why don't use window instead?

@modeswitch
Copy link

@piranna examples work now, but could you fix the autogenerated file? i'm not sure how it was generated.

@JessieAMorris
Copy link
Author

@piranna The global var comes from this inside of a function that has no this bound to it. By default, this inside of a function defaults to the global variable, whatever that happens to be. In browser situations, that happens to be window. Using the global var this way allows us to use the library inside of WebWorkers as well, where window is undefined.

@piranna
Copy link
Contributor

piranna commented Jan 23, 2014

So global is equivalent to this, window and self (in that context)? I never
seen it before, is it implemented by browsers like self or it's a "manual"
addon?

2014/1/23 Jessie A. Morris notifications@github.com

@piranna https://github.com/piranna The global var comes from thisinside of a function that has no this bound to it. By default,
this inside of a function defaults to the global variable, whatever that
happens to be. In browser situations, that happens to be window. Using the
global var this way allows us to use the library inside of WebWorkers as
well, where window is undefined.


Reply to this email directly or view it on GitHubhttps://github.com//pull/53#issuecomment-33140165
.

"Si quieres viajar alrededor del mundo y ser invitado a hablar en un monton
de sitios diferentes, simplemente escribe un sistema operativo Unix."
– Linus Tordvals, creador del sistema operativo Linux

@JessieAMorris
Copy link
Author

It's a "manual" addon defined on line 2 of wrtc.js. But yes, in this case, global = this = self = window;.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants