Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: Keybindings for the videoplayer are not successfully overriden #828

Closed
wants to merge 1 commit into from

Conversation

TDDR
Copy link
Contributor

@TDDR TDDR commented Dec 3, 2020


Fixes: Keybindings for the videoplayer are not successfully overriden

Pull Request Type

  • Bugfix
  • Feature Implementation

Related issue
Fixes: #637

Description
This PR is intended to fix the auto focus issue when changing to full screen so that hotkeys will still work without having to manually give focus back to the player. I have it mostly working but there are still a few bugs that I was hopping to get a hand with.

Testing (for code that is not small enough to be easily understandable)

Issues -

  • The alwaysCaptureHotkeys property kind of works, If you click on fullscreen, then let the userInactive event happen, focus will return to the player, allowing the use of hotkeys without having to manually click the player again. I know this is not the optimal behavior, but I'm not sure if the behavior I'm getting is because of the warning that came with using it, namely Note: This feature may break accessibility, and cause unexpected behavior. Or if the behavior is because I am not capturing the correct elements on this line
  • Three different implementations and I cannot successfully override the 'm' key
  • the 'c' hotkey does not work, but I could not toggle the captions with a click either so maybe a different issue?

Desktop (please complete the following information):

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.9

Additional context
I have replicated most of the old hotkey functionality. The only difference, aside from the bugs, is that I bundled l and right arrrow and j and left arrow. the old functionality was that j and l would change the playtime by 10sec and the arrows would only change it by 5sec. They both change it by 5 seconds now but I can change it to the old way if requested.

@TDDR TDDR marked this pull request as draft December 3, 2020 14:33
@PrestonN
Copy link
Member

Hello! Apologies for taking so long to look at this. Could you please update this branch to reflect upstream? There's a lot of out od date packages now and it's preventing me from looking into this further.

Thank you!

@TDDR
Copy link
Contributor Author

TDDR commented Jan 27, 2021

Hello @PrestonN! No worries, it was the holiday season when I first did the PR.

I have rebased my branch and pushed the changes. The same issues still persist as detailed above.

I did not implement the new keybindings that were added this past month ('D' ,'esc') or the ...mapActions block of code. I can implement those if you think this plugin is worth pursuing.

@orthand orthand mentioned this pull request May 10, 2021
Comment on lines +870 to +1054
// // Fast Forward by 5 seconds
// event.preventDefault()
// this.changeDurationBySeconds(5)
// break
// case 49:
// // 1 Key
// // Jump to 10% in the video
// event.preventDefault()
// this.changeDurationByPercentage(0.1)
// break
// case 50:
// // 2 Key
// // Jump to 20% in the video
// event.preventDefault()
// this.changeDurationByPercentage(0.2)
// break
// case 51:
// // 3 Key
// // Jump to 30% in the video
// event.preventDefault()
// this.changeDurationByPercentage(0.3)
// break
// case 52:
// // 4 Key
// // Jump to 40% in the video
// event.preventDefault()
// this.changeDurationByPercentage(0.4)
// break
// case 53:
// // 5 Key
// // Jump to 50% in the video
// event.preventDefault()
// this.changeDurationByPercentage(0.5)
// break
// case 54:
// // 6 Key
// // Jump to 60% in the video
// event.preventDefault()
// this.changeDurationByPercentage(0.6)
// break
// case 55:
// // 7 Key
// // Jump to 70% in the video
// event.preventDefault()
// this.changeDurationByPercentage(0.7)
// break
// case 56:
// // 8 Key
// // Jump to 80% in the video
// event.preventDefault()
// this.changeDurationByPercentage(0.8)
// break
// case 57:
// // 9 Key
// // Jump to 90% in the video
// event.preventDefault()
// this.changeDurationByPercentage(0.9)
// break
// case 48:
// // 0 Key
// // Jump to 0% in the video (The beginning)
// event.preventDefault()
// this.changeDurationByPercentage(0)
// break
// case 188:
// // , Key
// // Return to previous frame
// this.framebyframe(-1)
// break
// case 190:
// // . Key
// // Advance to next frame
// this.framebyframe(1)
// break
// case 68:
// // D Key
// // Toggle Picture in Picture Mode
// if (!this.player.isInPictureInPicture()) {
// this.player.requestPictureInPicture()
// } else if (this.player.isInPictureInPicture()) {
// this.player.exitPictureInPicture()
// }
// break
// case 27:
// // esc Key
// // Exit full window
// event.preventDefault()
// this.exitFullWindow()
// break
// case 83:
// // S Key
// // Toggle Full Window Mode
// this.toggleFullWindow()
// break
// }
// }
// ...mapActions([
// 'calculateColorLuminance'
// ])
// }
Copy link

Choose a reason for hiding this comment

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

I would prefer these lines removed if we don't need them, we can always revert using git if we need to restore them.

Copy link

@manuee manuee left a comment

Choose a reason for hiding this comment

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

No comments on the proposed solution since I am not familiar with the codebase... Here are my 2cents for fixing this issue :)

Funnily enough, if you hit the f key the full-screen comes on and keyboard shortcuts work. Its only when you use your mouse to go full-screen that the shortcuts stop working.

Its as if the player (or whatever has the shortcuts bind to it) does not contain the full screen button, and thus it goes out of focus. I wonder if bringing in hierarchically the full-screen button inside the player would fix the problem once and for all?

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Member

efb4f5ff-1298-471a-8973-3d47447115dc commented Sep 17, 2021

Hi @TDDR would u please update us on this otherwise we may consider closing this request.

@PrestonN
Copy link
Member

Hey there!

It's been a while since there's been any activity here. Since we haven't had any updates in a while, I'll go ahead and close this PR so that we can clean up our PR list. If by chance you decide to come back and continue this PR, please let us know and we can re-open this.

Thanks for understanding.

@PrestonN PrestonN closed this Sep 23, 2021
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.

Keybindings for the videoplayer are not successfully overriden
4 participants