Skip to content
This repository was archived by the owner on Jun 29, 2018. It is now read-only.
This repository was archived by the owner on Jun 29, 2018. It is now read-only.

YouTube player start-pause causes issues with start position #452

@cvcmatthewmorgan

Description

@cvcmatthewmorgan

I understand that this might be a continuation to #430 but I felt this was a separate issue to do with the same section of code.

I am happy to contribute a pull request to fix the issue along with #430 but would like to discuss workflow here first.

Given the use of the following code, the start time is ignored.

document.addEventListener("DOMContentLoaded", function() {
  var popcorn = Popcorn.smart("#video", "http://www.youtube.com/watch?v=eTKs27KcL00&t=10s");
}, false);

In the middle of onFirstPlay() there is a line that resets the video back to 0 which causes this to occur.

Suggested changes:

  • onFirstPlay() makes use of the start or t player variables instead of always going to 0.
  • onFirstPlay() should be triggered if player.seekTo() is going to be triggered or if preload() is required.
  • onFirstPlay() should not pause if autoplay is true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions