-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix video module issue with require.js #1337
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
Conversation
|
On Friday, I was able to reliably reproduce the bug with the video module loading without any content. Today, I put this branch up on a server on AWS and tested in exactly the same configuration where I was able to reliably reproduce the bug on Friday. I wasn't able to reproduce the bug at all on this branch; the video loaded successfully three times in a row. |
|
@cahrens @valera-rozuvan Can you two review this pull request, please? |
cms/templates/base.html
Outdated
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'm surprised to see this deletion in the file. I imagine a rebase is in order....
|
I had to disable two Jasmine tests in this pull request, because they were failing for (what appear to be) reasons unrelated to the change in this pull request. Jasmine runs tests in a deterministic order, but that order is not the order that the tests were defined in in; I suspect that the modifications I made to the tests caused the tests to run in a different order than before, and that these test failures are due to issues of test isolation. (In theory, reordering tests shouldn't cause them to break -- in practice, sometimes it does.) @valera-rozuvan, when you review this PR, can you investigate these test failures, and see if you can figure out what's causing them to fail and how to fix them? If we could get these tests running and passing again before the branch is merged, that would be excellent. |
and disable tests that fail for unrelated reasons
|
@singingwolfboy I have rebased against Now will try to identify the cause for the failing of the 2 Jasmine tests that you have commented out. |
|
@singingwolfboy Enabled and fixed 1 of your disabled tests. Also enabled and fixed 1 unrelated test. |
|
@singingwolfboy Fixed second disabled test. |
|
👍 Good to merge. |
|
👍 Once tests pass. |
fix video module issue with require.js
Previously, the YouTube API and the Video Xmodule had a race condition -- Xmodule was waiting for the www.youtube.com/player_api script to load before executing the video scripts, but that file is just a loader that handles loading the real YouTube API. As a result, the real YouTube API and the Xmodule videoplayer were loaded simultaneously, and if Xmodule loaded before YouTube, the video would not display on the page. Fortunately, the YouTube API loader exposes a
YT.readyfunction, that will execute its argument when the YouTube API is fully loaded, so it wasn't too difficult to make Xmodule wait until the YouTube API is fully loaded.