Skip to content

Commit

Permalink
Merge pull request #241 from aleppos/master
Browse files Browse the repository at this point in the history
Add Crunchyroll
  • Loading branch information
feedbee authored Oct 7, 2017
2 parents cdfbe53 + a099450 commit fa1bfa1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ when you're listening to music on various streaming websites.
* Bugs Music
* Chrome Built-In Player
* Comcast/Xfinity
* Crunchyroll
* Deezer
* Digitally Imported (di.fm)
* Gaana.com
Expand Down Expand Up @@ -58,6 +59,7 @@ when you're listening to music on various streaming websites.
* Twitch.tv
* Ustream.tv
* vk.com (Vkontakte)
* Vimeo
* XFINITY (untested)
* Xiami Music
* YouTube
Expand Down
19 changes: 19 additions & 0 deletions extension/keysocket-crunchyroll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
keySocket.init(
"crunchyroll",
{
"play-pause": function () {
var video = document.querySelector('#showmedia_video_player');
video.togglePlayPause();
},
"prev": function () {
location.href = document.querySelector("link[rel=prev]").getAttribute("href");
},
"next": function () {
location.href = document.querySelector("link[rel=next]").getAttribute("href");
},
"stop": function () {
var video = document.querySelector('#showmedia_video_player');
video.pauseVideo();
},
}
);
15 changes: 15 additions & 0 deletions extension/keysocket-vimeo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
keySocket.init(
"vimeo",
{
"play-pause": '.controls button',
"prev": function () {
location.href = document.querySelector("a[rel=prev]").getAttribute("href");
},
"next": function () {
location.href = document.querySelector("a[rel=next]").getAttribute("href");
},
"stop": function () {
location.href = document.querySelector("link[rel=canonical]").getAttribute("href");
},
}
);
8 changes: 8 additions & 0 deletions extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,14 @@
{
"matches": ["*://music.163.com/*"],
"js": ["plugin-api.js", "keysocket-163.js"]
},
{
"matches": ["*://*.crunchyroll.com/*"],
"js": ["plugin-api.js", "keysocket-crunchyroll.js"]
},
{
"matches": ["*://*.vimeo.com/*"],
"js": ["plugin-api.js", "keysocket-vimeo.js"]
}
]
}

0 comments on commit fa1bfa1

Please sign in to comment.