-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Added check for window #1446
Added check for window #1446
Conversation
I've double-checked this. It seems to work as expected; i.e. it does the same thing as the change the plyr team made. |
It seems that with this change, nothing would be imported at all. Is that intended? Why? |
We are using shaka-player in a react environment. And we are using the same code for server-side and client-side rendering. |
I see. I think, though, that it might be a little misleading if the import fails silently. What if we import to |
For example, instead of checking |
I will test this solution tomorrow. And get back to you. But I think it could work. |
Great, thanks! |
e633e37
to
7302cd9
Compare
@joeyparrish it worked and I have updated the PR with your feedback. |
@joeyparrish also if the PR is accepted would it be possible for it to be cherry-picked to 2.4? |
The build bot is testing the change now. If all the tests pass, I would be happy to merge this and cherry-pick it for v2.4.1. Thank you for contributing! |
Actually, it's trivial enough that I could also cherry-pick to v2.3.x in case we do another release from that branch. |
All tests passed! |
If nodejs, use global as scope, else use window. Closes #1445
If nodejs, use global as scope, else use window. Closes #1445
Cherry-picked for v2.3.9 and v2.4.1. |
To support require in nodejs of shaka-player to fix this issue
#1445
I have added a check for window