#1303 ✓ staged
brianchirls

When HTMLYouTubeVideoElement changes currentTime while paused, it will start playing

Reported by brianchirls | August 22nd, 2012 @ 08:50 AM | in 1.4

This only happens if currentTime is set before the first time the video has started playing. After seeking, it will start playing when it should seek and remain paused.

According to the YouTube iframe API documentation on player.seekTo:

Seeks to a specified time in the video. If the player is paused when the function is called, it will remain paused. If the function is called from another state (playing, video cued, etc.), the player will play the video.

When the player has not been started, it's state is "unstarted" (-1), which is different from "paused" (2).

This happens even when using the html5 player ("html5=1"), so it's not just a weird Flash thing. It appears to be a "feature" in YouTube.

Comments and changes to this ticket

  • David Humphrey

    David Humphrey September 4th, 2012 @ 04:09 PM

    I'd love to get a fix for this, got a patch too? :)

  • Charlie Stigler

    Charlie Stigler November 1st, 2012 @ 03:58 PM

    • State changed from “new” to “peer-review-requested”

    I just wrote up a patch that returns to the YT player's system of calling a playVideo() immediately on player load, then calling ready events after that play() finishes. It seems to make the player's behavior much more reliable.

    Unfortunately, due to the issue reported in #1346, seeks don't work right with this patch. This is fixed by applying this and then my patch in #1346. If you would prefer that I combine this + #1346 into one PR, I can do that.

    https://github.com/mozilla/popcorn-js/pull/231

  • Scott Downe

    Scott Downe December 4th, 2012 @ 04:30 PM

    • State changed from “peer-review-requested” to “under-review”
    • Assigned user changed from “David Humphrey” to “Scott Downe”
    • Milestone order changed from “31” to “0”
  • Scott Downe

    Scott Downe December 5th, 2012 @ 12:36 PM

    • State changed from “under-review” to “review-needs-work”
    • Assigned user changed from “Scott Downe” to “Charlie Stigler”
    • Milestone order changed from “178” to “0”

    Just one small order of calls issue commented on in the pull request, and this'll be good in my books!

  • Scott Downe

    Scott Downe December 6th, 2012 @ 12:52 PM

    • State changed from “review-needs-work” to “peer-review-requested”
    • Assigned user changed from “Charlie Stigler” to “cadecairos”
    • Milestone order changed from “9” to “0”

    I pulled in Charlie's changes and made some fixes on top.

    Wonder if I could get a review? https://github.com/mozilla/popcorn-js/pull/251

    Charlie, if you're around feel free to take a look and do a review/fixes.

  • cadecairos

    cadecairos December 6th, 2012 @ 02:59 PM

    • State changed from “peer-review-requested” to “review-needs-work”
    • Assigned user changed from “cadecairos” to “Scott Downe”
    • Milestone order changed from “140” to “0”

    I'd like to see some unit tests for this.

    Otherwise it looks good.

  • Scott Downe

    Scott Downe December 6th, 2012 @ 03:04 PM

    • State changed from “review-needs-work” to “feature-request”
    • Assigned user changed from “Scott Downe” to “cadecairos”
    • Milestone order changed from “184” to “0”

    There actually are, but they currently test this functionality with the old player.

    The idea is to land fixes until the old player's tests pass, then remove the old player.

  • cadecairos

    cadecairos December 6th, 2012 @ 03:10 PM

    the old YT tests were deleted

  • cadecairos

    cadecairos December 6th, 2012 @ 03:12 PM

    For some reason I got those mixed w/ the SoundCloud tests

  • cadecairos

    cadecairos December 6th, 2012 @ 03:35 PM

    • State changed from “feature-request” to “under-review”

    I'm gonna see how it performs in Popcorn Maker

  • cadecairos

    cadecairos December 6th, 2012 @ 04:14 PM

    yeah seeking is terrible with the wrapper

  • Scott Downe

    Scott Downe December 6th, 2012 @ 04:58 PM

    • State changed from “under-review” to “peer-review-requested”

    Bunch of tests for autplay, and order of play and ready events when auto play is true.

  • cadecairos

    cadecairos December 6th, 2012 @ 05:47 PM

    • State changed from “peer-review-requested” to “review-needs-work”
    • Assigned user changed from “cadecairos” to “Scott Downe”
    • Milestone order changed from “139” to “0”

    nice. One issue is the SoundCloud wrapper doesn't pass those new tests. We're gonna need a ticket for that.

    PR+ with a new ticket

  • Scott Downe

    Scott Downe December 6th, 2012 @ 05:51 PM

    • State changed from “review-needs-work” to “super-review-requested”
    • Assigned user changed from “Scott Downe” to “mjschranz”
    • Milestone order changed from “184” to “0”

    Filed #1386.

  • mjschranz

    mjschranz December 7th, 2012 @ 12:25 PM

    • State changed from “super-review-requested” to “review-needs-work”
    • Assigned user changed from “mjschranz” to “Scott Downe”
    • Milestone order changed from “26” to “0”

    This looks sane, although I'm getting the 26th group of YouTube tests failing for me in Chrome and Firefox (Granted, firefox has a lot more fails).

  • Scott Downe

    Scott Downe December 7th, 2012 @ 01:26 PM

    • State changed from “review-needs-work” to “feedback-requested”
    • Assigned user changed from “Scott Downe” to “mjschranz”
    • Milestone order changed from “184” to “0”

    That is the only fail I see, and I see it in master.

    I looked into it, and it looks like youtube forces a stop now, when it ends, and we need to force it to start again.

    We should probably just file it, as the solution i came up with to test this was not ideal.

  • Scott Downe

    Scott Downe December 7th, 2012 @ 04:12 PM

    • State changed from “feedback-requested” to “super-review-requested”

    Gooood catch.

    That, while not what I wanted to fix, was a good fix.

  • mjschranz

    mjschranz December 10th, 2012 @ 10:15 AM

    • State changed from “super-review-requested” to “review-looks-good”
    • Assigned user changed from “mjschranz” to “Scott Downe”

    Finished reviewing this from Friday.

    It is working very well for me in both Popcorn/Popcorn Maker land.

    SR+

  • Scott Downe

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

Referenced by

Pages