Changeset View
Changeset View
Standalone View
Standalone View
extension/extension-mpris.js
Show First 20 Lines • Show All 189 Lines • ▼ Show 20 Line(s) | |||||
190 | addRuntimeCallback("mpris", ["metadata", "callbacks"], function (message, sender, action) { | 190 | addRuntimeCallback("mpris", ["metadata", "callbacks"], function (message, sender, action) { | ||
191 | if (currentPlayer().id === playerIdFromSender(sender)) { | 191 | if (currentPlayer().id === playerIdFromSender(sender)) { | ||
192 | var payload = {}; | 192 | var payload = {}; | ||
193 | payload[action] = message; | 193 | payload[action] = message; | ||
194 | 194 | | |||
195 | sendPortMessage("mpris", action, payload); | 195 | sendPortMessage("mpris", action, payload); | ||
196 | } | 196 | } | ||
197 | }); | 197 | }); | ||
198 | | ||||
199 | addRuntimeCallback("mpris", "hasTabPlayer", (message) => { | ||||
200 | const playersOnTab = playerIds.filter((playerId) => { | ||||
201 | return playerId.startsWith(message.tabId + "-"); | ||||
202 | }); | ||||
203 | | ||||
204 | return Promise.resolve(playersOnTab); | ||||
205 | }); |