Skip to content

[fork request] Would it be possible to distribute a small subset of this functionality compiled to WebAssembly? #193

@warren-bank

Description

@warren-bank

The reason for my asking is that Firefox desktop doesn't support Chromecast.
Presumably, this is also the case for all non-Chromium browsers.
If the following (example) API could be run from a WebExtension..
then it would be easy to write a very capable replacement for Chrome's built-in integration.

window.GoChromecast.status(ip)
  => {"status": "Idle", "volume": 0.17, "muted": false}

window.GoChromecast.load(ip, url)
window.GoChromecast.pause(ip)
window.GoChromecast.unpause(ip)
window.GoChromecast.next(ip)
window.GoChromecast.previous(ip)
window.GoChromecast.rewind(ip, seconds)
window.GoChromecast.seek(ip, seconds)
window.GoChromecast.mute(ip)
window.GoChromecast.unmute(ip)
window.GoChromecast.volume(ip, level)
  => true

Note that because there is currently no browser API to use mDNS discovery,
a static (stateless) "ip" parameter is explicitly passed to each method.

These methods would be equivalent to the following functionality,
which is already available from the command-line:

ip='192.168.0.156'
url='https://example.com/path/to/media.mp4'
seconds='30'
level='0.55'

go-chromecast -a "$ip" status
  Idle, volume=0.17 muted=false

go-chromecast -a "$ip" load "$url"

go-chromecast -a "$ip" pause
go-chromecast -a "$ip" unpause

go-chromecast -a "$ip" next
go-chromecast -a "$ip" previous

go-chromecast -a "$ip" rewind "$seconds"
go-chromecast -a "$ip" seek "$seconds"

go-chromecast -a "$ip" mute
go-chromecast -a "$ip" unmute
go-chromecast -a "$ip" volume "$level"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions