Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions catt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,22 @@ def cast(

@cli.command("cast_site", short_help="Cast any website to a Chromecast.")
@click.argument("url", callback=process_url)
@click.option(
"-i",
"--iframe",
is_flag=True,
help="Load website into an iframe to avoid timeout (requires HTTPS).",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
help="Load website into an iframe to avoid timeout (requires HTTPS).",
help="Load website into an iframe to avoid timeout (requires HTTPS, and the site must allow loading into an iframe).",

)
@click.pass_obj
def cast_site(settings, url):
def cast_site(settings, url, iframe):
cst = setup_cast(
settings["selected_device"],
controller="dashcast",
action="load_url",
prep="app",
)
click.echo('Casting {} on "{}"...'.format(url, cst.cc_name))
cst.load_url(url)
click.echo('Casting {} on "{}" (iframe={})...'.format(url, cst.cc_name, iframe))
cst.load_url(url, force=not iframe)


@cli.command(short_help="Add a video to the queue (YouTube only).")
Expand Down
10 changes: 6 additions & 4 deletions catt/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import pychromecast
from pychromecast.config import APP_BACKDROP as BACKDROP_APP_ID
from pychromecast.config import APP_DASHCAST as DASHCAST_APP_ID
from pychromecast.config import APP_MEDIA_RECEIVER as MEDIA_RECEIVER_APP_ID
from pychromecast.config import APP_YOUTUBE as YOUTUBE_APP_ID
from pychromecast.controllers.dashcast import DashCastController as PyChromecastDashCastController
Expand All @@ -26,6 +25,9 @@
VALID_STATE_EVENTS = ["UNKNOWN", "IDLE", "BUFFERING", "PLAYING", "PAUSED"]
CLOUD_APP_ID = "38579375"

DASHCAST_NAMESPACE = "urn:x-cast:es.offd.dashcast"
DASHCAST_APP_ID = "5C517DAC"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DASHCAST_APP_ID = "5C517DAC"
DASHCAST_APP_ID = "1B3FF1BC"



class App:
def __init__(self, app_name, app_id, supported_device_types):
Expand Down Expand Up @@ -496,11 +498,11 @@ def restore(self, data):

class DashCastController(CastController):
def __init__(self, cast, app, prep=None):
self._controller = PyChromecastDashCastController()
self._controller = PyChromecastDashCastController(appNamespace=DASHCAST_NAMESPACE, appId=DASHCAST_APP_ID)
super(DashCastController, self).__init__(cast, app, prep=prep)

def load_url(self, url, **kwargs):
self._controller.load_url(url, force=True)
def load_url(self, url, force=True, **kwargs):
self._controller.load_url(url, force=force)

def prep_app(self):
"""Make sure desired chromecast app is running."""
Expand Down