feat: Add support for chromecast#3
Conversation
dd83b05 to
fe3ba58
Compare
fe3ba58 to
f92a3dc
Compare
a91ed87 to
9bebbd8
Compare
fc8d9e3 to
7f2c9ca
Compare
kmuncie
left a comment
There was a problem hiding this comment.
@judicaelandria here is a very surface level review to consider before @joshuacurtiss is back and able to give this a thorough review.
| * (e.g. the Chromecast button) can respond to connect / connecting / | ||
| * disconnect transitions. | ||
| */ | ||
| private _setupEventListeners(): void { |
There was a problem hiding this comment.
Do we need to cleanup these listeners at some point? Should we add a dispose() method that removes these listeners, similar to how ChromecastButton handles cleanup at ChromecastButton.ts:287-291, or is that handled somewhere else?
There was a problem hiding this comment.
Looks like you aimed to solve this one, I will leave this open until @joshuacurtiss has a look
| private _setupDirectAPIListeners(): void { | ||
| const videoElement = getVideoElement(this._player); | ||
|
|
||
| if (!videoElement || !checkClientChromecastSupport()) { |
There was a problem hiding this comment.
Would it be better to handle the !checkClientChromecastSupport down on L285 instead of here?
| } | ||
|
|
||
| if (!this._isSetup) { | ||
| throw new Error('ChromecastManager not properly initialized. Call setup first.'); |
There was a problem hiding this comment.
Issue: Error message says "Call setup first" but there's no public setup() method - initialization happens automatically in the constructor. Suggestion: Revise to: ChromecastManager initialization failed - video element with Remote Playback support not found.
src/styles/chromecast.scss
Outdated
|
|
||
| /* Ensure button is visible when Chromecast is available */ | ||
| .vjs-chromecast-button:not(.vjs-hidden) { | ||
| display: block; |
There was a problem hiding this comment.
Is block correct here? I see alot of out rules for buttons above setting flex?
There was a problem hiding this comment.
I see you removed this block entirely, was it actually not needed at all?
There was a problem hiding this comment.
no, we didn't need it
src/js/constants/log-messages.ts
Outdated
| CHROMECAST_NOT_SUPPORTED: 'Chromecast not supported on this device', | ||
| CHROMECAST_SUPPORTED: 'Chromecast support detected', | ||
| GOOGLE_CAST_SUPPORTED: 'Google Cast API supported - full device compatibility', | ||
| GOOGLE_CAST_PREFERRED: 'Using Google Cast API for full device list', |
There was a problem hiding this comment.
These two GOOGLE_CAST... constants are apparently never used, is that intentional?
src/styles/chromecast.scss
Outdated
| @@ -0,0 +1,49 @@ | |||
| $icon-chromecast--default: '../assets/ic_cast_white_24px.svg' !default; | |||
| $icon-chromecast--hover: '../assets/ic_cast_connected_white_24dp.png' !default; | |||
There was a problem hiding this comment.
Whats up with the mixed file types? SVG for normal button and then hover switches to PNG? Do we need better assets for hover?
There was a problem hiding this comment.
I dont see any changes here but I assume it will be considered further
7f2c9ca to
6b3def0
Compare
- Implement core Chromecast functionality for the plugin
The AirPlay getVideoElement function returns an HTMLVideoElementWithAirPlay type, while Chromecast's getVideoElement returns a standard HTMLVideoElement. This type mismatch could cause runtime errors when the functions are used interchangeably.
6b3def0 to
e45da59
Compare
No description provided.