Stopping video playback for hidden steps - #115
Conversation
| } | ||
|
|
||
| var activeStep = $('.mentoring', element).data('active-step'); | ||
| var activeStepIndex = $('.mentoring', element).data('active-step'); |
There was a problem hiding this comment.
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.
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.
@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.
@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.
@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
| var submitXHR, resultsXHR, | ||
| message = $(element).find('.sb-step-message'); | ||
|
|
||
| var childManager = new ProblemBuilderUtilLMS.ChildManager(element, runtime); |
There was a problem hiding this comment.
@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.
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
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.