-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8624167
Showing
6 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# HTML Video Youtube Controls | ||
|
||
Use the YouTube keyboard controls on any HTML video player. | ||
First of all, you must click the video that you want to use this on. | ||
Controls: | ||
J: rewind 10 seconds | ||
K: play/pause | ||
L: skip 10 seconds | ||
|
||
Chrome Webstore page: *under review* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// content.js | ||
$(document).ready(function () { | ||
$(document).on('keypress',function(e) { | ||
if (e.target.tagName === "VIDEO") { | ||
if (e.which === 74 || e.which === 106) { | ||
e.target.currentTime = e.target.currentTime - 10 | ||
} | ||
else if (e.which === 76 || e.which === 108) { | ||
e.target.currentTime = e.target.currentTime + 10 | ||
} | ||
else if (e.which === 75 || e.which === 107) { | ||
if (e.target.paused) { | ||
e.target.play() | ||
} | ||
else { | ||
e.target.pause() | ||
} | ||
} | ||
} | ||
else if (e.target.children[0].tagName === "VIDEO") { | ||
if (e.which === 74 || e.which === 106) { | ||
e.target.children[0].currentTime = e.target.children[0].currentTime - 10 | ||
} | ||
else if (e.which === 76 || e.which === 108) { | ||
e.target.children[0].currentTime = e.target.children[0].currentTime + 10 | ||
} | ||
else if (e.which === 75 || e.which === 107) { | ||
if (e.target.children[0].paused) { | ||
e.target.children[0].play() | ||
} | ||
else { | ||
e.target.children[0].pause() | ||
} | ||
} | ||
} | ||
} | ||
) | ||
} | ||
) | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "HTML Video Youtube Controls", | ||
"version": "1.0", | ||
"permissions": [ | ||
"activeTab" | ||
], | ||
"description": "Use the Youtube keyboard controls on any HTML video player.", | ||
"content_scripts": [ | ||
{ | ||
"matches": [ | ||
"https://*/*" | ||
], | ||
"js": ["jquery-3.6.0.min.js", "content.js"] | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.