#308 ✓ resolved
Scott Downe

standard pause attribute

Reported by Scott Downe | February 4th, 2011 @ 01:44 PM | in 1.3 (closed)

This would be a standard attribute use in all tracks regardless of plugin. If the attribute exists, and contained a valid time, the registered timing control (video, youtube, vimeo, audio, etc) would be paused, the track fired and a timeout would be created with the designated number of seconds, then the timing control would resume.

The attribute would, obviously, be optional.

Comments and changes to this ticket

  • Scott Downe

    Scott Downe February 4th, 2011 @ 01:56 PM

    I think an example of how I think this should look would be helpful.

    Popcorn("#video").trackevent({
      start: 10,
      end: 10,
      target: 'container-div',
      pause: 5
    });
    

    Hmm, looking at this, I do see the value of doing this in exec, but I just find doing it this way to be more user friendly. Using the familiar interface of creating a track instead of an exec and allows us to attach to ANY plugin, and ANY parser.

  • Rich Caloggero

    Rich Caloggero February 4th, 2011 @ 02:11 PM

    Couple related ideas:

    • pause="stop" Pauses till the user continues. Could be useful for blind users; sometimes its not known how long it might take to explore a resource.

    • allows something like end="never" Sometimes we might want an element to be present even after the video ends. Blind users might find this useful.

    • end="media" Remove this element when the video ends, but not before.

  • Scott Downe

    Scott Downe February 4th, 2011 @ 02:34 PM

    • pause="stop" Pauses till the user continues. Could be useful for blind users; sometimes its not known how long it might take to explore a resource.

    I like this idea, but I don't like making something that takes a number, all of a sudden take a string. We should consider other ways to specify a default value of forever.

    • allows something like end="never" Sometimes we might want an element to be present even after the video ends. Blind users might find this useful.

    Leaving the end attribute out is defaulted to the end of the video.

    • end="media" Remove this element when the video ends, but not before.

    I am not sure what you mean by this, but same issue with a number now taking a string.

  • Rick

    Rick February 4th, 2011 @ 02:40 PM

    I need some clarification for both myself and general record.

    "till the user continues" - What precisely does this mean? What is the user doing that causes a "continuance". Are referring to the act of clicking the "play" control on the movie (or the accessibility equivalent)?

  • Scott Downe

    Scott Downe February 4th, 2011 @ 02:40 PM

    For context, this is Rich's original email that this ticket was created from.

    Hi.
    
    Just recently became aware of Popcorn, and have a suggestion for an extension
    to its xml format.
    
    I work at the National Center for Accessible Media
    http://ncam.wgbh.org/
    
    We are working on a project to study the usefulness of video as an educational
    tool for blind and visually impaired audiences.  One of the things blind folks
    depend on, especially in an educational context, is what we call video
    description. Its essentially a text track synchronized with the video which
    adds descriptions of on-screen visual items deemed necessary for the
    comprehension of the material.  Often times the built-in narration is enough,
    but in many situations there is a lot going on visually which is simply missed
    by those who only have the video sound track available - e.g. blind users.
    
    Traditionally, people have added description to the video sound track itself
    via an additional voice over track recorded post production. If you've ever
    rented a movie on DVD and seen the DVS symbol, this means that with the
    propper decoder you can hear extra description which is built into the
    presentation.
    
    Typically, this is inserted between the existing narration (or dialog in the
    case of a movie).  However, there are times when we want the presentation to
    pause so that a longer description can be inserted, giving it time to play
    without squashing the narration.  This is difficult to do if the description
    track is built into the presentation itself.
    
    Popcorn is an easy way to add synchronized events to a video. Not only can we
    play additional textual description, but we can bring up arbitrary web pages,
    etc.  The sighted user can catch these changes and follow them easily
    on-screen. THe blind user, on the other hand, will quickly get overwhelmed
    with information if too many simultaneous  streams of information are pushed
    out.  SO, to this end, I'd like to propose extending the xml format to provide
    a way to say: pause the video when you fire this event.
    
    For instance:
    Popcorn("#video")
    .exec (10, "pause", 3, function () {
    // do some stuff
    });
    
    If the second arg is not a function, and if its non-null, then pause the video
    before executing the function.
    If the third arg is not a function, then this is the number of seconds (or
    whatever time units exec deals with) the pause should last.
    
    Of course, we could simply exec another event to continue the video, but I
    think its clearer this way.
    
    As per the xml, I see entries like:
    
    
    <tagthisperson target="inthisvideo" in="00:00:05:02" out="00:00:10:07"
    person="Steve Song" />
    
          <wikipedia in="00:00:05:02" out="00:00:10:07" resourceid="villagetelco"
    numberofwords="200" lang="en" target="wikidiv"/>
    
    We could extend this:
          <wikipedia pause="00:00:10:00" in="00:00:05:02" out="00:00:10:07"
    resourceid="villagetelco" numberofwords="200" lang="en" target="wikidiv"/>
    
    This will pause the video for ten seconds, allowing the screen reader to speak
    appropriate info; the video would continue automatically after the specified
    interval.
    
    We might allow keywords:
    <wikipedia pause="stop" .../>
    to stop and let the user continue on her own.
    
    Seems like this should be fairly easily added, but I'm not fully grocking the
    code...
    
    question: are you planning to use jquery to implement Popcorn in the future?
    They have a very nice event system, and their DOM manipulation and extraction
    is so elegant!  THey even parse xml, so the whole parser thing could be
    emensely simplified.
    Again, I'm no Javascript whiz, but seems like jquery has a lot to offer here.
    I've not checked out your 0.3 work, so maybe this is already planned??
    
    Thanx for reading.  Continue the great work - I think this a fantastic idea
    and implementation.
    
    -- Peace, Rich
    
  • Rick

    Rick February 4th, 2011 @ 03:05 PM

    Rich,

    I'd like to invite you to come to the Bocoup Loft - we're in Fort Point, South Boston - across the channel from South Station. I think this would be a great opportunity for you to actually show me what you'd like to do, or at least to be able to explain it in person (I find that's often the absolute best way to communicate).

    We can set up any time that is good for you

    Rick

  • annasob

    annasob February 8th, 2011 @ 05:31 PM

    • Milestone changed from 0.3 release date to 0.4
    • Milestone order changed from “33” to “0”
  • annasob

    annasob February 24th, 2011 @ 12:18 PM

    • Milestone changed from 0.4 to 0.5
    • Milestone order changed from “8” to “0”
  • Scott Downe

    Scott Downe March 4th, 2011 @ 09:00 AM

    • State changed from “new” to “assigned”
    • Assigned user set to “Scott Downe”
  • Scott Downe

    Scott Downe April 9th, 2011 @ 01:42 PM

    • Milestone changed from 0.5 to 0.6
    • Milestone order changed from “15” to “0”
  • annasob

    annasob May 10th, 2011 @ 05:26 PM

    • Milestone changed from 0.6 to 0.7
  • Scott Downe

    Scott Downe June 2nd, 2011 @ 05:13 PM

    • Milestone changed from 0.7 to 0.8
    • Milestone order changed from “8” to “0”
  • Scott Downe

    Scott Downe August 23rd, 2011 @ 11:25 AM

    • Milestone changed from 0.8 to 0.9
    • Milestone order changed from “7” to “0”
  • Scott Downe

    Scott Downe September 6th, 2011 @ 03:44 PM

    • State changed from “assigned” to “open”
    • Assigned user cleared.
  • David Seifried

    David Seifried September 12th, 2011 @ 11:05 AM

    • Milestone changed from 0.9 to 1.0 Release
    • Milestone order changed from “14” to “0”

    We need to revisit this idea on our push to 1.0.

  • Jon Buckley

    Jon Buckley September 12th, 2011 @ 11:38 AM

    I asked my friend Leisa, who is a deaf-blind interpreter for the CNIB said:

    Do you mean, whenever the page updates with new info (example, according to the short video on the site: When Will Ferrell is dancing, pause audio/video when the page switches from his Twitter account to his wiki, etc.)? If that is what you mean, then that would be very helpful in alerting a blind user that content has been updated--otherwise they may not know, or may miss the information. However, it should be made clear that the pause = info update, and not just buffering (or whatnot).

    So you'd need to do a bit more work to make a Popcorn.js video accessible, but this is a pretty good start.

  • David Seifried
  • David Seifried

    David Seifried September 29th, 2011 @ 04:20 PM

    • State changed from “open” to “assigned”
    • Assigned user set to “Ausley Johnson”
  • Ausley Johnson

    Ausley Johnson October 15th, 2011 @ 01:39 AM

    • State changed from “assigned” to “peer-review-requested”
    • Assigned user changed from “Ausley Johnson” to “David Seifried”

    Added the pause feature to Popcorn. The user can now set the Pause key value. Code has been submitted for review.

    Commit Location

  • Scott Downe

    Scott Downe October 16th, 2011 @ 07:27 PM

    I have not looked at the above commit yet, this is not a review, but I had some thoughts on this.

    This week, I needed to do this quickly, so I weaved execs along with the events, looked like this:

    p.subtitle({start: 82, end: 83, text: "subtitle to fire while pauses"});
    p.exec( 82, function() {
       // should check if playing, and store value
       p.pause();
       setTimeout(function() {
         p.play(); // should only call play if was playing before
       }, 7000 );
    });
    

    This worked without needing to touch the source. Might not of been ideal, but worked.

    I noticed an issue that I don't think a standard pause attribute would solve either.

    What if the developer wants to fire more than one event during the pause. Almost as if the setTimeout in the pause is a small Popcorn instance itself.

    Example:

    At 82 seconds, pause video for 10 seconds, and display subtitle for 5 seconds. Then at the 5th second of being paused, display another subtitle.

    You could string pauses together, but what if the time the video has to hold all these pauses is quite small, 1 second or less. It is not infinite.

    If we could fire events while paused, based on an internal setTimeout firing events, we could have infinite space inside of a video's linear timeline.

  • Scott Downe

    Scott Downe October 16th, 2011 @ 07:34 PM

    One thing I did notice about the above commit, the video should only re play if the video was playing when the paused was fired, so if the user pauses the video explicitly, and seeks to the pause location, the video should stay paused until the user clicks play.

  • David Seifried

    David Seifried October 17th, 2011 @ 12:21 PM

    • State changed from “peer-review-requested” to “review-needs-work”
    • Assigned user changed from “David Seifried” to “Ausley Johnson”

    Hey Ausley, nice job on this, but there are a few things:

    • line 1210 has an alert on it
    • the changes you made to the footnote plugin are going to have to be reverted
    • you are going to have to write unit tests for the new functionality you added to the core unit tests
    • instead of inside the timeUpdate function I think this might be better suited to be handled in the plugin function itself ( in the 1205 area )
  • Scott Downe

    Scott Downe October 17th, 2011 @ 06:29 PM

    I am actually thinking we're going about this all wrong.

    A standard pause attribute is so linear(it can only pause ONE event) and so easily done via exec and a setTimeout.

    If we are going to be doing it this way, it should be a plugin and not in core.

    This is no ones fault, and does not mean Ausley's work is a waste, it just means we should figure out a way to make this land, without it being in core.

  • David Seifried

    David Seifried October 18th, 2011 @ 04:20 PM

    • Milestone changed from 1.0 Release to 1.1
    • Milestone order changed from “13” to “0”

    pushing to 1.1

  • Ausley Johnson

    Ausley Johnson October 27th, 2011 @ 08:53 PM

    • Assigned user changed from “Ausley Johnson” to “David Seifried”
    • State changed from “review-needs-work” to “peer-review-requested”

    Added the pause feature to a plug-in removing it from the core as suggested and correct bug that was pointed out previously. Footnote was used to implement it. Please view commit

  • cadecairos

    cadecairos October 27th, 2011 @ 09:44 PM

    That link is broken, something to do with marking it up with html. try using github markdown (edit: updated link >.< )

  • Ausley Johnson
  • Rick

    Rick October 28th, 2011 @ 02:02 PM

    • Assigned user changed from “David Seifried” to “Ausley Johnson”
    • State changed from “peer-review-requested” to “review-needs-work”

    Need to rebase the code here, getting merge conflicts:

    Switched to a new branch 't308'
    remote: Counting objects: 37, done.
    remote: Compressing objects: 100% (19/19), done.
    remote: Total 31 (delta 25), reused 18 (delta 12)
    Unpacking objects: 100% (31/31), done.
    From git://github.com/aljohnson1/popcorn-js
     * branch            t308       -> FETCH_HEAD
    Auto-merging plugins/footnote/popcorn.footnote.html
    CONFLICT (content): Merge conflict in plugins/footnote/popcorn.footnote.html
    Auto-merging plugins/footnote/popcorn.footnote.js
    CONFLICT (content): Merge conflict in plugins/footnote/popcorn.footnote.js
    Auto-merging popcorn.js
    CONFLICT (content): Merge conflict in popcorn.js
    Recorded preimage for 'plugins/footnote/popcorn.footnote.html'
    Recorded preimage for 'plugins/footnote/popcorn.footnote.js'
    Recorded preimage for 'popcorn.js'
    Automatic merge failed; fix conflicts and then commit the result.
    
  • Ausley Johnson

    Ausley Johnson November 6th, 2011 @ 09:08 PM

    • Assigned user changed from “Ausley Johnson” to “David Seifried”
    • State changed from “review-needs-work” to “peer-review-requested”

    Resolved merge conflicts. Please view commit

  • David Seifried

    David Seifried November 14th, 2011 @ 11:03 AM

    • Assigned user changed from “David Seifried” to “Ausley Johnson”
    • State changed from “peer-review-requested” to “review-needs-work”

    Hey Ausley,

    Im getting merge conflicts on the popcorn.js file, mind fixing it?

    Sorry this review has been getting pushed a bunch, once you get it updated this time around I will review it immediately.

  • David Seifried

    David Seifried November 14th, 2011 @ 11:25 AM

    • Assigned user changed from “Ausley Johnson” to “David Seifried”
    • State changed from “review-needs-work” to “peer-review-requested”

    Oops my bad, pulled wrong branch first time, reviewing now.

  • David Seifried

    David Seifried November 14th, 2011 @ 11:42 AM

    • Assigned user changed from “David Seifried” to “Ausley Johnson”
    • State changed from “peer-review-requested” to “review-needs-work”

    Theres seems to be a bunch of files that have changed ( as well as one added ) that shouldnt have been. My pull looks like the following:

    Make10_24_11                                       |   78 ++++++++++++++++++++
     .../popcorn.timeline-sources.unit.js               |    2 +-
     parsers/parserJSON/popcorn.parserJSON.unit.js      |    4 +-
     players/soundcloud/popcorn.soundcloud.unit.js      |   29 ++++---
     players/vimeo/popcorn.vimeo.unit.js                |    7 ++
     plugins/footnote/popcorn.footnote.html             |   25 ++++---
     plugins/footnote/popcorn.footnote.js               |   14 ++++
     plugins/linkedin/popcorn.linkedin.unit.js          |    1 -
     plugins/mustache/popcorn.mustache.unit.js          |    7 +-
     popcorn.js                                         |   21 ++++--
    

    The only file that should be changed is popcorn.js as thats where the pause feature is being implemented, and there should also be unit tests to support the code written ( which would be added to test/popcorn.unit.js )
    The only file that should have changed is popcorn.js ( as thats where the pause feature is being implemented )

  • Ausley Johnson

    Ausley Johnson November 21st, 2011 @ 10:51 PM

    • Assigned user changed from “Ausley Johnson” to “David Seifried”

    Completed creation of plug-in and demo for disability pause feature. Please see commit

  • David Seifried

    David Seifried December 7th, 2011 @ 01:45 PM

    • State changed from “review-needs-work” to “peer-review-requested”
  • David Seifried

    David Seifried December 9th, 2011 @ 11:54 AM

    • State changed from “peer-review-requested” to “review-needs-work”
    • Assigned user changed from “David Seifried” to “Ausley Johnson”

    Please add unit tests. Keep in mind that anything not in review by Monday will be pushed to 1.2.

  • David Seifried

    David Seifried December 13th, 2011 @ 09:30 AM

    • Milestone changed from 1.1 to 1.2
    • Milestone order changed from “1” to “0”

    This never got put back into review by last night at 7pm EST so im pushing to 1.2

  • Ausley Johnson

    Ausley Johnson December 17th, 2011 @ 01:21 AM

    • State changed from “review-needs-work” to “peer-review-requested”
    • Assigned user changed from “Ausley Johnson” to “David Seifried”

    Created unit test for feature. Please view commit

  • Ausley Johnson

    Ausley Johnson December 17th, 2011 @ 01:56 AM

    I removed an alert message in the unit test in a following commit.

  • David Seifried

    David Seifried January 3rd, 2012 @ 12:59 PM

    • Assigned user changed from “David Seifried” to “Ausley Johnson”
    • State changed from “peer-review-requested” to “review-needs-work”

    In your .html file:

    • line 9 has whitespace padding issues and single quotes should be double quotes
    • indentation issues with head and body tags

    .js file:

    • end of line whitespace on lines 21, 59, 61
    • why is the plugin call being wrapped in a Popcorn.foreach?
    • indentation should be 2 spaces not 4 ( which is the case in some areas )
    • you can fill out your information for the about portion of the manifest
    • the label for pause in the manifest should be something meaningful
    • padding issues in your start function, take a look at the style guide
    • using Popcorn.instances[ 0 ] will not work. What if there is more then one instance on the page? You have a reference to the current instance already, you should use that
    • indentation issues

    unit.html file:

    • end of line whitespace line 37

    unit.js file:

    • end of line whitespace all over the file
    • your plus function is calling a start() that doesn't exist
    • reference style guide
    • spelling mistakes
    • in a lot of your execs your just checking if the time === a time ? the tests don't do what they should be doing
    • some tests for multiple instances would be nice
    • you write the following lines of code all over the place that never get used:
    
    time = new Date();
    pauseStarted = time.getSeconds();
    

    please remove it
    * indentation issues

  • David Seifried

    David Seifried February 23rd, 2012 @ 05:25 PM

    • Milestone changed from 1.2 to 1.3
    • Milestone order changed from “2” to “0”
  • cadecairos

    cadecairos April 30th, 2012 @ 08:45 PM

    • State changed from “review-needs-work” to “open”
    • Assigned user cleared.

    I really think this ticket should just be closed. The functionality being asked for can easily be created with a cue

    pop.cue( 10, function() {
      pop.pause();
      window.setTimeout(function() {
        pop.play();
      }, 5000 );
    });
    

    There's absolutely no reason to bloat the core with something like this.

    thoughts?

  • Rick

    Rick April 30th, 2012 @ 09:31 PM

    +1 to closing. The functionality is definitely there

  • Jon Buckley

    Jon Buckley April 30th, 2012 @ 09:37 PM

    • State changed from “open” to “resolved”

    the best code is code never committed

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Popcorn.js is an HTML5 video framework that lets you bring elements of the web into your videos.

Popcorn.js is a project of Web Made Movies, Mozilla's Open Video Lab.

Shared Ticket Bins

Tags

Pages