Last active
July 7, 2020 18:21
-
-
Save blacklight/fc8085c57ff3d9bcdb885d2f2dbec7c1 to your computer and use it in GitHub Desktop.
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
// Platypush user script to play the current URL | |
// on the Chromecast if it is a YouTube URL. | |
async (app, args) => { | |
const url = await app.getURL(); | |
if (!url.startsWith('https://www.youtube.com/watch?v=')) { | |
return; | |
} | |
const response = await app.run({ | |
action: 'media.chromecast.play', | |
args: { | |
resource: url, | |
}, | |
}, args.host); | |
if (response.success) { | |
app.notify('YouTube video now playing on Chromecast'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment