Skip to content

Conversation

gurupras
Copy link
Contributor

Link to related issue (if applicable)

#1345

Summary of proposed changes

Replaced direct calls with proxy() to ensure that default handlers are called first.

Here's a pen with the fix

Checklist

  • Use develop as the base branch
  • Exclude the gulp build (/dist changes) from the PR
  • Test on supported browsers

Copy link
Owner

@sampotts sampotts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small fix needed 👍

// Space and K key
if (!repeat) {
player.togglePlay();
this.proxy(event, player.togglePlay, 'play')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should toggle play

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, could you elaborate? I don't quite understand what I should do about that line.
Should the 'play' become 'togglePlay'?

Copy link
Owner

@sampotts sampotts Jan 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for mega (!!) late response but I think it should have some logic that calls 'play' or 'pause' depending on current state...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do this, but I don't think the 'pause' event is triggered anywhere else in the code.

plyr/src/js/listeners.js

Lines 539 to 544 in 977a839

// Play/pause toggle
if (elements.buttons.play) {
Array.from(elements.buttons.play).forEach(button => {
this.bind(button, 'click', player.togglePlay, 'play');
});
}

Clicking the play/pause buttons only triggers the 'play' event.

@gurupras
Copy link
Contributor Author

@sampotts, let me know how to fix this when you have some time and I'll fix it so it can be merged in :)

@gurupras
Copy link
Contributor Author

gurupras commented Jan 13, 2020 via email

@sampotts
Copy link
Owner

sampotts commented Jan 13, 2020

Will update the code. Thanks for pointing stuff out.

Cheers mate 👍

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.

2 participants