hensm / fx_cast

Chromecast Web Sender SDK implementation for Firefox
https://hensm.github.io/fx_cast/
MIT License
1.87k stars 63 forks source link

Chromecast Audio Support #184

Closed kevincox closed 2 years ago

kevincox commented 3 years ago

OS version: Linux NixOS/unstable Browser version: Firefox 89.0 Extension version: 0.1.2 Bridge version: 0.1.2

Description Chromecast devices are visible but Chromecast Audio (including third party devices and groups) are not visible.

Steps to reproduce

  1. Click the cast button.

Expected behaviour Audio devices and groups are also available.

Logs Provide any applicable logs here. Info on where to find them is located here.

fx_cast (Info): init background.js:1:1201
fx_cast (Info): checking for bridge... background.js:1:1201
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. extension.html
The Components object is deprecated. It will soon be removed. regex.js:12:20
Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. update.js:26
fx_cast (Info): ... bridge compatible! background.js:1:1201
fx_cast (Info): init (menus) background.js:1:1201
fx_cast (Info): init (whitelist) background.js:1:1201
fx_cast (Info): init (media overlay) background.js:1:1201
fx_cast (Info): init (browser action) background.js:1:1201
Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. extension.js:113
    <anonymous> moz-extension://3bb15141-fecd-44e1-8551-326fc29be4ba/extension.js:113
fx_cast (Info): Cancelled receiver selection background.js:1:1201
sendRemoveListener on closed conduit fx_cast@matt.tf.412316861493 ConduitsChild.jsm:108
fx_cast (Info): Cancelled receiver selection background.js:1:1201
sendRemoveListener on closed conduit fx_cast@matt.tf.412316862158 ConduitsChild.jsm:108
fx_cast (Info): Cancelled receiver selection background.js:1:1201
sendRemoveListener on closed conduit fx_cast@matt.tf.412316862345 ConduitsChild.jsm:108
fx_cast (Info): Cancelled receiver selection background.js:1:1201
sendRemoveListener on closed conduit fx_cast@matt.tf.412316862519 ConduitsChild.jsm:108
fx_cast (Info): Cancelled receiver selection background.js:1:1201
sendRemoveListener on closed conduit fx_cast@matt.tf.412316862670 ConduitsChild.jsm:108

Possibly related: https://github.com/hensm/fx_cast/issues/129

kevincox commented 3 years ago

After more testing I can see the audio devices and groups if something is playing on them. I can then "override" with no issue. However if they are idle they never appear even though idle video devices do appear.

hensm commented 3 years ago

Looks like the issue with this version is that it checks if an application is running on the receiver devices, but Chromecast Audio devices don't run a backdrop application like the regular devices, so it just doesn't get shown in the receiver list: https://github.com/hensm/fx_cast/blob/v0.1.2/ext/src/background/StatusManager.ts#L40-L43

I've replaced a lot of the discovery stuff in a local branch, so this should be fixed now. Groups are a bit more complex, I think they require extra support, I haven't really looked too much at them.

There's also some work to do passing device capabilities to the sender apps, since that could also cause issues. https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.Capability

kevincox commented 3 years ago

Ah, makes sense. Let me know if you push that branch somewhere and want me to test it out. Otherwise I'll just look forward to the next update.

gavinhungry commented 2 years ago

Did this land in 0.2.0?

I'm using this version on Linux, and I only see listed my Chromecast-enabled devices that have a screen, and no audio-only devices (Chromecast Audio, Nest Audio, Nest Mini, etc.).

I'm also unable to recreate @kevincox's workaround above - that is, I still cannot see audio-only devices that are already playing media.

Thanks!

hensm commented 2 years ago

@gavinhungry

Did this land in 0.2.0?

No, I filtered audio devices out before the v0.2.0 release because it wasn't finished. https://github.com/hensm/fx_cast/blob/v0.2.0/ext/src/background/receiverDevices.ts#L87-L95

I fixed some of the issues a little while after (https://github.com/hensm/fx_cast/commit/234280f5eccf5a634d9c80ffd2a8426b704a4d00). Still haven't really tested it, but my Nest Mini has been showing up in the device list while I've been testing other stuff lately.

hensm commented 2 years ago

So, I've done some testing. My development branch works pretty well with audio devices. A few rough edges where you can cast apps that aren't supported and the application status not being updated properly that need fixing.

One notable missing feature is audio streaming, so no YouTube support like you'd get with desktop Chrome.

ccaudio

hensm commented 2 years ago

https://github.com/hensm/fx_cast/releases/tag/v0.3.0