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

Support Chromecast with Google TV #163

Open levihb opened 3 years ago

levihb commented 3 years ago

OS version: Arch Linux Browser version: Firefox 84 Extension version: 0.1.2 Bridge version: 0.1.2

Description

I have a new Chromecast with Google TV. When I cast from YouTube on my phone I get the normal YouTube app on the TV, with related videos, subscribe, etc etc. But when I cast from my browser using this I get another interface, although when it launches it still says "YouTube"? This interface just has the uploader + title, then a play bar with + 30s and - 30s buttons. There are no related videos, no subscription, no way to view the channel, etc etc.

Steps to reproduce

  1. Go to a YouTube video, click the cast button.
  2. Opens in the different app

Expected behaviour Should work the same as casting from my phone?

Logs Really not sure what logs are wanted? The link just shows three generic tutorials? Here's the normal browser ones:

fx_cast (Info): cast.initialize cast_sender.js:1:1201
CAST MSG: [0.013s] [yt.mdx.remote] LocalScreenService: Initializing with []
cast_sender.js:1:18949
CAST MSG: [0.013s] [yt.mdx.remote] ScreenService: Updated manual screens: []
cast_sender.js:1:18949
CAST MSG: [0.013s] [yt.mdx.remote] ScreenService: Initializing automatic screens: []
cast_sender.js:1:18949
CAST MSG: [0.013s] [yt.mdx.remote] OnlineScreenService: Initialized with {}
cast_sender.js:1:18949
CAST MSG: [0.014s] [yt.mdx.remote] cloudview: cloudview.createSingleton_: true
cast_sender.js:1:18949
CAST MSG: [0.014s] [yt.mdx.remote] remote: Initializing: {"device":"Desktop","app":"youtube-desktop","loadCastApiSetupScript":true,"enableDialLoungeToken":false,"enableCastLoungeToken":false}
cast_sender.js:1:18949
CAST MSG: [0.015s] [yt.mdx.remote] remote:  -- with channel params: {"device":"REMOTE_CONTROL","id":"4d49f75b-0450-4c3a-96e1-d2e34ebd664a","name":"Desktop","app":"youtube-desktop","mdxVersion":3}
cast_sender.js:1:18949
CAST MSG: [0.017s] [yt.mdx.remote] cloudview: clearCurrentReceiver
cast_sender.js:1:18949
CAST MSG: [0.017s] [yt.mdx.remote] remote: Skipping connecting because no session screen found.
cast_sender.js:1:18949
CAST MSG: [0.656s] [yt.mdx.remote] cloudview: setCastInstalled_ true
cast_sender.js:1:18949
fx_cast (Info): STUB :: cast.setCustomReceivers cast_sender.js:1:1201
CAST MSG: [0.659s] [yt.mdx.remote] cloudview: setApiReady_ true
cast_sender.js:1:18949
CAST MSG: [0.659s] [yt.mdx.remote] Controller: Receiver availability updated: unavailable
cast_sender.js:1:18949
CAST MSG: [0.664s] [yt.mdx.remote] Controller: Receiver availability updated: available
cast_sender.js:1:18949
CAST MSG: [4.075s] [yt.mdx.remote] cloudview: Requesting cast selector.
cast_sender.js:1:18949
fx_cast (Info): cast.requestSession cast_sender.js:1:1201
Some cookies are misusing the recommended “SameSite“ attribute 67
fx_cast (Info): Selected receiver cast_sender.js:1:1201
fx_cast (Info): Calling receiver action listener (CAST) 
Object { host: "192.168.2.103", port: 8009, id: "3a86b25729b16239c60c95e7315a33d5", friendlyName: "Levi's TV", status: {…} }
cast_sender.js:1:1183
CAST MSG: [6.378s] [yt.mdx.remote] Controller: onReceiverAction_ 3a86b25729b16239c60c95e7315a33d5 / Levi's TV-- cast
cast_sender.js:1:18949
CAST MSG: [6.379s] [yt.mdx.remote] cloudview: onReceiverSelected: Levi's TV
cast_sender.js:1:18949
CAST MSG: [6.380s] [yt.mdx.remote] remote: Connecting to: {"key":"cast-selector-receiver","name":"Levi's TV"}
cast_sender.js:1:18949
CAST MSG: [6.380s] [yt.mdx.remote] CastSession: launchWithParams no-op for Cast: {"videoIds":["LbH1ZDImaI8"],"listId":null,"videoId":"LbH1ZDImaI8","playerParams":null,"clickTrackingParams":"CAAQu2kiEwjVhtW3h63uAhWbi1EKHbTCAgo=","index":0,"currentTime":1.226062}
cast_sender.js:1:18949
CAST MSG: [11.600s] [yt.mdx.remote] Controller: New cast session ID: e111894a-fdf0-4aa0-a6c4-3ec5587c4cf8
cast_sender.js:1:18949
CAST MSG: [11.603s] [yt.mdx.remote] CastSession: sendYoutubeMessage_: getMdxSessionStatus null
cast_sender.js:1:18949
CAST MSG: [12.271s] [yt.mdx.remote] CastSession: onYoutubeMessage_: mdxSessionStatus {"screenId":"75isi1kidcmhncekdrf198ol0b","deviceId":"1290280e-38d3-4fd3-96c1-d1f25e7258ed"}
cast_sender.js:1:18949
CAST MSG: [12.271s] [yt.mdx.remote] CastSession: onConnectedScreenId_: Received screenId: 75isi1kidcmhncekdrf198ol0b
cast_sender.js:1:18949
CAST MSG: [12.272s] [yt.mdx.remote] ScreenService: getAutomaticScreenByIds 75isi1kidcmhncekdrf198ol0b / 3a86b25729b16239c60c95e7315a33d5
cast_sender.js:1:18949
CAST MSG: [12.273s] [yt.mdx.remote] ScreenService: requestLoungeToken_ for 75isi1kidcmhncekdrf198ol0b
cast_sender.js:1:18949
CAST MSG: [12.357s] [yt.mdx.remote] cloudview: onSessionChange: {name:"Levi's TV",id:75isi1..,token:..yckcfU,uuid:..5a33d5,idType:normal}
cast_sender.js:1:18949
CAST MSG: [12.357s] [yt.mdx.remote] remote: remote.onCastSessionChange_: {name:"Levi's TV",id:75isi1..,token:..yckcfU,uuid:..5a33d5,idType:normal}
cast_sender.js:1:18949
CAST MSG: [12.359s] [yt.mdx.remote] conn: Connecting with setPlaylist and params: {"videoId":"LbH1ZDImaI8","currentTime":0,"clickTrackingParams":"CAAQu2kiEwjVhtW3h63uAhWbi1EKHbTCAgo=","currentIndex":0}
cast_sender.js:1:18949
CAST MSG: [12.370s] [yt.mdx.remote] Controller: Setting connected screen ID: 75isi1kidcmhncekdrf198ol0b -> YouTube TV
cast_sender.js:1:18949
CAST MSG: [12.371s] [yt.mdx.remote] CP: Setting cast session: e111894a-fdf0-4aa0-a6c4-3ec5587c4cf8
cast_sender.js:1:18949
fx_cast (Info): STUB :: Session#addMediaListener cast_sender.js:1:1201
CAST MSG: [12.378s] [yt.mdx.remote] CP: Setting cast session: e111894a-fdf0-4aa0-a6c4-3ec5587c4cf8
cast_sender.js:1:18949
fx_cast (Info): STUB :: Session#addMediaListener cast_sender.js:1:1201
Attempt to set a forbidden header was denied: Connection remote.js:290:184
CAST MSG: [13.040s] [yt.mdx.remote] conn: Channel opened
cast_sender.js:1:18949
CAST MSG: [13.044s] [yt.mdx.remote] conn: Received: action=loungeStatus, params={"devices":"[{\"app\":\"lb-v4\",\"capabilities\":\"dsp,que,mus\",\"clientName\":\"tvhtml5\",\"experiments\":\"\",\"name\":\"Chromecast\",\"id\":\"1290280e-38d3-4fd3-96c1-d1f25e7258ed\",\"type\":\"LOUNGE_SCREEN\",\"hasCc\":\"true\"},{\"app\":\"youtube-desktop\",\"capabilities\":\"que,mus\",\"clientName\":\"web\",\"experiments\":\"\",\"userAvatarUri\":\"https://yt3.ggpht.com/yti/ANoDKi7rqdlp61DSWlRAO5MJLV4NHXKiWYcYZDaeFA\\u003ds240\",\"type\":\"REMOTE_CONTROL\",\"localChannelEncryptionKey\":\"vDdV8JCm3AzTg8YJesFKYPQSnmWz6IpA6A20N1u_X2U\",\"pairingType\":\"unknown\",\"name\":\"Desktop\",\"obfuscatedGaiaId\":\"103564082053560963065\",\"id\":\"4d49f75b-0450-4c3a-96e1-d2e34ebd664a\",\"user\":\"LeviHB\"}]"}
cast_sender.js:1:18949
CAST MSG: [13.045s] [yt.mdx.remote] conn: Sending: action=getSubtitlesTrack
cast_sender.js:1:18949
CAST MSG: [13.047s] [yt.mdx.remote] conn: Received: action=playlistModified, params={"listId":"RQyGz_k7DFCtj_WXQRlAmY_9g8358","firstVideoId":"LbH1ZDImaI8","videoId":"LbH1ZDImaI8","currentIndex":"0"}
cast_sender.js:1:18949
CAST MSG: [13.048s] [yt.mdx.remote] conn: Received: action=onAutoplayModeChanged, params={"autoplayMode":"UNSUPPORTED"}
cast_sender.js:1:18949
CAST MSG: [13.049s] [yt.mdx.remote] conn: Received: action=onPlaylistModeChanged, params={"shuffleEnabled":"false","loopEnabled":"false"}
cast_sender.js:1:18949
CAST MSG: [13.049s] [yt.mdx.remote] conn: Unrecognized action: onPlaylistModeChanged
cast_sender.js:1:18949
Attempt to set a forbidden header was denied: Connection remote.js:290:184
CAST MSG: [13.451s] [yt.mdx.remote] conn: Received: action=nowPlaying, params={"currentTime":"0","listId":"RQyGz_k7DFCtj_WXQRlAmY_9g8358","duration":"0","loadedTime":"0","videoId":"LbH1ZDImaI8","state":"3","currentIndex":"0","seekableStartTime":"0","seekableEndTime":"0"}
cast_sender.js:1:18949
CAST MSG: [13.470s] [yt.mdx.remote] conn: Received: action=onVolumeChanged, params={"volume":"68","muted":"false"}
cast_sender.js:1:18949
CAST MSG: [13.476s] [yt.mdx.remote] conn: Received: action=onSubtitlesTrackChanged, params={"videoId":"LbH1ZDImaI8"}
cast_sender.js:1:18949
CAST MSG: [14.519s] [yt.mdx.remote] conn: Received: action=nowPlaying, params={"currentTime":"0","listId":"RQyGz_k7DFCtj_WXQRlAmY_9g8358","duration":"0","loadedTime":"0","videoId":"LbH1ZDImaI8","state":"3","currentIndex":"0","seekableStartTime":"0","seekableEndTime":"0"}
cast_sender.js:1:18949
CAST MSG: [14.521s] [yt.mdx.remote] conn: Received: action=onHasPreviousNextChanged, params={"hasPrevious":"false","hasNext":"false"}
cast_sender.js:1:18949
CAST MSG: [14.521s] [yt.mdx.remote] conn: Received: action=autoplayUpNext, params={}
cast_sender.js:1:18949
CAST MSG: [14.571s] [yt.mdx.remote] conn: Received: action=onAutoplayModeChanged, params={"autoplayMode":"UNSUPPORTED"}
cast_sender.js:1:18949
CAST MSG: [15.733s] [yt.mdx.remote] conn: Received: action=onStateChange, params={"currentTime":"0","duration":"0","cpn":"JN66hzrheOb2RAZh","loadedTime":"0","state":"3","seekableStartTime":"0","seekableEndTime":"0"}
cast_sender.js:1:18949
CAST MSG: [16.357s] [yt.mdx.remote] conn: Received: action=onVideoQualityChanged, params={"availableQualityLevels":"[1080,720,480,360,240,0]","videoId":"LbH1ZDImaI8","qualityLevel":"1080"}
cast_sender.js:1:18949
CAST MSG: [16.357s] [yt.mdx.remote] conn: Unrecognized action: onVideoQualityChanged
cast_sender.js:1:18949
CAST MSG: [17.335s] [yt.mdx.remote] conn: Received: action=onStateChange, params={"currentTime":"0.107","duration":"2941.961","cpn":"JN66hzrheOb2RAZh","loadedTime":"4.3","state":"1","seekableStartTime":"0","seekableEndTime":"2941.933"}
cast_sender.js:1:18949
CAST MSG: [20.568s] [yt.mdx.remote] CP: Cast volume update: 0.5799999833106995
cast_sender.js:1:18949
CAST MSG: [20.653s] [yt.mdx.remote] CP: Cast volume update: 0.6000000238418579
cast_sender.js:1:18949
CAST MSG: [20.678s] [yt.mdx.remote] conn: Received: action=onVolumeChanged, params={"volume":"57","muted":"false"}
cast_sender.js:1:18949
CAST MSG: [20.733s] [yt.mdx.remote] conn: Received: action=onVolumeChanged, params={"volume":"60","muted":"false"}
cast_sender.js:1:18949
CAST MSG: [20.865s] [yt.mdx.remote] CP: Cast volume update: 0.5
cast_sender.js:1:18949
CAST MSG: [20.950s] [yt.mdx.remote] CP: Cast volume update: 0.5199999809265137
cast_sender.js:1:18949
CAST MSG: [20.981s] [yt.mdx.remote] conn: Received: action=onVolumeChanged, params={"volume":"50","muted":"false"}
cast_sender.js:1:18949
CAST MSG: [20.985s] [yt.mdx.remote] conn: Received: action=onVolumeChanged, params={"volume":"51","muted":"false"}
cast_sender.js:1:18949
CAST MSG: [21.402s] [yt.mdx.remote] CP: Cast volume update: 0.41999998688697815
cast_sender.js:1:18949
CAST MSG: [21.524s] [yt.mdx.remote] CP: Cast volume update: 0.4399999976158142
cast_sender.js:1:18949
CAST MSG: [21.966s] [yt.mdx.remote] conn: Received: action=onVolumeChanged, params={"volume":"41","muted":"false"}
cast_sender.js:1:18949
CAST MSG: [21.970s] [yt.mdx.remote] conn: Received: action=onVolumeChanged, params={"volume":"43","muted":"false"}
cast_sender.js:1:18949
CAST MSG: [37.500s] [yt.mdx.remote] conn: Received: action=onStateChange, params={"currentTime":"20.22","duration":"2941.961","cpn":"JN66hzrheOb2RAZh","loadedTime":"53.333","state":"2","seekableStartTime":"0","seekableEndTime":"2941.933"}
cast_sender.js:1:18949
CAST MSG: [99.202s] [yt.mdx.remote] cloudview: Requesting cast selector.
cast_sender.js:1:18949
fx_cast (Info): cast.requestSession cast_sender.js:1:1201
CAST MSG: [105.444s] [yt.mdx.remote] Controller: Failed to estabilish a session: {"code":"cancel","description":null,"details":null}
cast_sender.js:1:18949
Attempt to set a forbidden header was denied: Connection remote.js:290:184
Attempt to set a forbidden header was denied: Connection remote.js:290:184
hensm commented 3 years ago

Thanks for the report.

Sounds like Cast Connect, which isn't implemented yet, so it just falls back to a regular Chromecast app. I don't have a Android TV device, so I can't say when (or if) I'll work on it. It doesn't look like there are too many changes on the sender-side, but I've not done much research yet.