chromecast controls

This commit is contained in:
jakequade
2024-08-24 14:53:33 +10:00
parent e9783d293d
commit fb6e3dc690
3 changed files with 14 additions and 12 deletions

View File

@@ -181,13 +181,15 @@ export const PlaybackProvider: React.FC<{ children: ReactNode }> = ({
useEffect(() => {
if (!deviceId || !api?.accessToken) return;
const url = `ws://${api?.basePath
const protocol = api?.basePath.includes('https') ? 'wss' : 'ws'
const url = `${protocol}://${api?.basePath
.replace("https://", "")
.replace("http://", "")}/socket?api_key=${
api?.accessToken
}&deviceId=${deviceId}`;
console.log("WS", url);
console.log(protocol, url);
const newWebSocket = new WebSocket(url);