-
Notifications
You must be signed in to change notification settings - Fork 60
Stopping video playback for hidden steps #115
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
| } | ||
|
|
||
| var activeStep = $('.mentoring', element).data('active-step'); | ||
| var activeStepIndex = $('.mentoring', element).data('active-step'); |
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.
Most of the changes in this file are leftover from last PR, I left it in on the basis that this makes the code cleaner. But they can be safely removed.
af3c0e7 to
6d9fae4
Compare
| @@ -0,0 +1,109 @@ | |||
| (function () { | |||
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.
This can be moved to step.js but I figured that it would be better to have it on separate file, to keep every file simple enough.
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.
@jbzdak Is there a reason not to move the contents of this file to the existing util.js file? If they do need to be kept in a separate file, I think it would make sense to call it step_util.js to indicate the relationship more clearly. (This would also take into account the fact that usage of this file isn't limited to the LMS runtime.)
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.
@itsjeyd utils.js is used only in studio (or cms), and this one is used only in lms and while this would have negligible effect on performance, i decided that adding unneeded code would be bad, so I decided to split them.
I'll rename them step_utils.js.
6d9fae4 to
28bdcbd
Compare
|
@itsjeyd This is ready for review. |
7a3f6f7 to
c477ea0
Compare
| /** | ||
| * Manager for HTML XBlocks. These blocks are hid by detaching and shown | ||
| * by re-attaching them to the DOM.This is only generic way to generically | ||
| * handle things like video players (they should stop playing when removed from DOM). |
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.
@jbzdak "hid" ⟶ "hidden"
"DOM.This is only generic way to generically handle" ⟶ "DOM. This is the only way to generically handle"
|
@jbzdak Reviewed! Please ping me when you're done addressing the comments so I can have another quick look. |
a26168b to
2af1ddc
Compare
problem_builder/public/js/step.js
Outdated
| var submitXHR, resultsXHR, | ||
| message = $(element).find('.sb-step-message'); | ||
|
|
||
| var childManager = new ProblemBuilderUtilLMS.ChildManager(element, runtime); |
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.
@jbzdak Now that the utils file has been renamed, ProblemBuilderUtilLMS should be renamed as well I think. How about just StepUtil?
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.
Done. I went for ProblemBuilderStepUtil this is a global name attached to window object, so I'd rather be verbose than have a clash.
8fa4281 to
4b7b231
Compare
|
@jbzdak 👍 once the build is green and @bradenmacdonald confirms that we can go ahead without adding integration tests for now. |
|
@jbzdak As long as your code is well commented (looks like it is - thanks!), writing integration tests would require enormous effort (which seems to be the case), and all the other non-video-specific refactoring you've done is covered by tests, that's fine with me in this case. The only thing I would suggest is that you first have a look to see if you can use |
|
Using XBlock.register_temp_plugin would work, if not for this. JQuery-xblock doesnt return Html XModules as children of the step (this runtime is used on Apros), so I added a workaround of querying dom for HTML modules. . . and this workaround would not work in XBlock sdk as the dom elements generated by sdk and lms are different. In LMS I can select html xblock using |
|
@jbzdak Sounds good, let's push for that. |
|
Merging. |
This is a follow up on: #114 and #112.
Course set up
What you need is a course where on a step you have a video, and then you can to the next step (you should still hear the video on that next step --- which is the error).
Create a course with three sections, each containing a single subsection and a single unit.
First unit contains following steps:
a. A step with Video Block and a question
b. A step with HTML Block with a youtube video and a question. Example embedding code:
<iframe width="420" height="315" src="https://www.youtube.com/embed/QH2-TGUlwu4" frameborder="0" allowfullscreen></iframe>c. A step with a question (no videos!)
d. A review step with a HTML with a youtube video, and other review elements.
Second unit contains
a. A step with OOyala video and a question (OOyala set-up is described in the OC-1441 issue)
b. A step with a question
c. A review step
Third unit contains (note that having the same Ooyala video on a two steps in single unit might not work.
a. A step with a question
a. A review step with a HTML block with ooyala video embedded.
Verification instructions
OO.ready(function() { OO.Player.create('xxx', 'yyy_zzz'); });. After you start the video it should work as it was started "normally" so tests are still valid.Testing instructions
For each of the units:
Checkout this branch.
Go to video and block, start the video and wait until it loads, fill in the quiz and go to next step. Note that the video is no longer playing in the background.
Fill in rest of the quiz, watch the review step, and go back to the video step. Verify that video is still working properly.
Check if:
a. Reloading a page with a video works
b. Video works on first visit
c. Video works when re-visiting
d. Video XBlock rememebers it's position
Note that Ooyala videos in review steps are still broken.