@@ -3,8 +3,8 @@ Allows your keyboard media keys (play/pause, next, previous) to work
3
3
when you're listening to music on various streaming websites.
4
4
5
5
# Supported Sites
6
+
6
7
* 163 Music
7
- * 22tracks
8
8
* 8tracks
9
9
* Amazon Cloud Player
10
10
* Bandcamp
@@ -22,53 +22,60 @@ when you're listening to music on various streaming websites.
22
22
* iloveradio.de
23
23
* Jamstash
24
24
* Jango.com
25
- * JB Hi-Fi Now
26
- * Livestream.com
27
25
* Mixcloud
28
- * Music Choice
26
+ * Music Choice (untested)
29
27
* Myspace
30
28
* Myzuka.fm
31
29
* Naxos Music Library
32
30
* Netflix
33
- * Noon Pacific
31
+ * Noon Pacific (untested)
34
32
* NRK Radio
35
33
* Ok.ru
36
- * Overcast
34
+ * Overcast (untested)
37
35
* Pandora
38
36
* Phish Tracks
39
37
* Picarto.tv
40
- * Plex
38
+ * Plex (untested)
41
39
* Pocketcasts.com
42
40
* Prostopleer
43
41
* Qobuz
44
- * Rdio
45
42
* Relax-Hub.com
46
43
* Saavn.com
47
44
* Slacker
48
45
* Sirius XM Radio
49
46
* SomaFM
50
- * Songza
51
47
* Soundcloud
52
48
* Sowndhaus
53
49
* Spotify
54
50
* Spreaker
55
51
* Streamsquid
56
52
* Subsonic (and Madsonic)
57
- * Superplayer.fm
58
- * Synology Audio Station v.5
53
+ * Superplayer.fm (untested)
54
+ * Synology Audio Station v.5 (untested)
59
55
* thesixtyone
60
- * Tidal
61
- * Tracksflow.com
56
+ * Tidal (untested)
62
57
* tunein.com
63
58
* Twitch.tv
64
59
* Ustream.tv
65
60
* vk.com (Vkontakte)
61
+ * XFINITY (untested)
66
62
* Xiami Music
67
63
* YouTube
68
64
* Zvooq
69
65
* Яндекс.Музыка (Yandex.Music)
70
66
* Яндекс.Радио (Yandex.Radio)
71
67
68
+ # Untested Sites (after latest changes)
69
+
70
+ * Music Choice (account is needed)
71
+ * Noon Pacific (account is needed)
72
+ * Overcast (account is needed)
73
+ * Plex (can't simulate click, not working)
74
+ * Superplayer.fm (regional restrictions)
75
+ * Synology (special environment is needed)
76
+ * Tidal (regional restrictions)
77
+ * XFINITY (account is needed)
78
+
72
79
# Usage
73
80
74
81
1 . Install extension from the [ chrome web store] [ crx ] .
@@ -112,8 +119,49 @@ document.addEventListener("MediaNext", function () {
112
119
});
113
120
```
114
121
115
- # Please contribute!
122
+ # Please, contribute!
123
+
124
+ * Looking for plugins for other music players. Create Pull Requests to contribute. Create Issues to inform us about
125
+ broken sites (but PR is preferable).
126
+
127
+ Plugin creation is simple. If you have found a website with media content, that isn't supported by keysocket, just
128
+ write a plugin by yourself and create new Pull Request to share it with others. How to do it?
129
+
130
+ First of all, determine the fixed part of website's URL, where a media content is shown. In ` extension/manifest.json `
131
+ add an item into ` content_scripts ` array like this:
132
+
133
+ ```
134
+ {
135
+ "matches": ["*://example.com/player*"],
136
+ "js": ["plugin-api.js", "keysocket-example-service-name.js"]
137
+ },
138
+ ```
139
+
140
+ Create new file into ` extension ` folder using the pattern ` keysocket-example-service-name.js ` (use your service name to
141
+ replace ` example-service-name ` part). Write plugin's code there. Check other plugins for examples.
142
+
143
+ Typically, plugin can interact with a player using either button press simulation or public API call. The second option
144
+ implies you writing custom JS code to talk to player, while the first one requires just to mention DOM selectors to
145
+ configure keysocket.
146
+
147
+ ``` javascript
148
+ keySocket .init (' example-service-name' , {
149
+ " play-pause" : ' ...' ,
150
+ " prev" : ' ...' ,
151
+ " next" : ' ...' ,
152
+ " stop" : ' ...'
153
+ });
154
+ ```
155
+
156
+ In the code above two arguments were passed to ` keySocket.init ` function. The first argument is a plugin name, it used for
157
+ logging and can be anything you want. The second argument is a map used to bind keysocket events (which is caused by
158
+ user pressing control keys) to buttons or code, that handles this event. The events are ` play-pause ` , ` prev ` , ` next `
159
+ and ` stop ` . Any of them can be omitted in the map.
160
+
161
+ So, passing a function as an event handler, you set the code, that will be called when event is thrown. Passing anything
162
+ else, which expected to be a string, you define DOM selector to look up for a DOM object to simulate click on it.
116
163
117
- * Looking for adapters for other music players.
164
+ Different websites require different approaches to dial with them. So, make a research to find the best solution in
165
+ your case. Look through the other plugins (` extension/keysocket-*.js ` files) for the reference.
118
166
119
167
[ crx ] : https://chrome.google.com/webstore/detail/fphfgdknbpakeedbaenojjdcdoajihik
0 commit comments