Skip to content

Instantly share code, notes, and snippets.

@Yuiki Yuiki/core.py
Created Aug 26, 2018

Embed
What would you like to do?
Play YouTube on Chrome Cast
import pychromecast
from pychromecast.controllers.youtube import YouTubeController
CAST_NAME = ""
VIDEO_ID = ""
chromecasts = pychromecast.get_chromecasts()
cast = next(cc for cc in chromecasts if cc.device.friendly_name == CAST_NAME)
cast.wait()
yt = YouTubeController()
cast.register_handler(yt)
yt.play_video(VIDEO_ID)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.