Skip to content

Stopping video playback for hidden steps - #115

Merged
jbzdak merged 3 commits into
masterfrom
jbzdak/oc-1441/detach-html-elements
Apr 11, 2016
Merged

Stopping video playback for hidden steps#115
jbzdak merged 3 commits into
masterfrom
jbzdak/oc-1441/detach-html-elements

Conversation

@jbzdak

@jbzdak jbzdak commented Apr 4, 2016

Copy link
Copy Markdown
Contributor

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).

  1. Create a course with three sections, each containing a single subsection and a single unit.

  2. 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.

  3. 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

  4. 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

  1. Please note that OOyala video needs to be manually started by pasting a snippet to a javascript console --- snippet is attached above the video, and looks like that: 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.
  2. Go to the block with video, start the video and wait until it loads, fill in the quiz and go to next step. Note that you still hear video music in the background.
  3. Check the same with the OOyala video subsection.
  4. Note that on re-entering the ooyala videos on review step the video doesn't display itself, this is due to the fact that html of review elements is replaced when displaying this step (this is current behaviour in master), which doesn't play well with ooyala .

Testing instructions

For each of the units:

  1. Checkout this branch.

  2. 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.

  3. Fill in rest of the quiz, watch the review step, and go back to the video step. Verify that video is still working properly.

  4. 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

  5. Note that Ooyala videos in review steps are still broken.

}

var activeStep = $('.mentoring', element).data('active-step');
var activeStepIndex = $('.mentoring', element).data('active-step');

Copy link
Copy Markdown
Contributor Author

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.

@jbzdak
jbzdak force-pushed the jbzdak/oc-1441/detach-html-elements branch from af3c0e7 to 6d9fae4 Compare April 5, 2016 09:15
@@ -0,0 +1,109 @@
(function () {

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Member

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.)

Copy link
Copy Markdown
Contributor Author

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.

@jbzdak
jbzdak force-pushed the jbzdak/oc-1441/detach-html-elements branch from 6d9fae4 to 28bdcbd Compare April 5, 2016 09:52
@jbzdak

jbzdak commented Apr 5, 2016

Copy link
Copy Markdown
Contributor Author

@itsjeyd This is ready for review.

@jbzdak
jbzdak force-pushed the jbzdak/oc-1441/detach-html-elements branch from 7a3f6f7 to c477ea0 Compare April 7, 2016 11:13
/**
* 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).

Copy link
Copy Markdown
Member

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"

@itsjeyd

itsjeyd commented Apr 7, 2016

Copy link
Copy Markdown
Member

@jbzdak Reviewed! Please ping me when you're done addressing the comments so I can have another quick look.

@jbzdak
jbzdak force-pushed the jbzdak/oc-1441/detach-html-elements branch 3 times, most recently from a26168b to 2af1ddc Compare April 7, 2016 20:13
Comment thread problem_builder/public/js/step.js Outdated
var submitXHR, resultsXHR,
message = $(element).find('.sb-step-message');

var childManager = new ProblemBuilderUtilLMS.ChildManager(element, runtime);

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Contributor Author

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.

@jbzdak
jbzdak force-pushed the jbzdak/oc-1441/detach-html-elements branch from 8fa4281 to 4b7b231 Compare April 7, 2016 20:34
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.

3 participants