Skip to content

Comments

feat: Add support for chromecast#3

Open
judicaelandria wants to merge 3 commits intosilvermine:masterfrom
judicaelandria:mandriamahandry/add-chromecast-support
Open

feat: Add support for chromecast#3
judicaelandria wants to merge 3 commits intosilvermine:masterfrom
judicaelandria:mandriamahandry/add-chromecast-support

Conversation

@judicaelandria
Copy link
Contributor

No description provided.

@judicaelandria judicaelandria marked this pull request as draft November 10, 2025 15:41
@judicaelandria judicaelandria force-pushed the mandriamahandry/add-chromecast-support branch 4 times, most recently from dd83b05 to fe3ba58 Compare November 11, 2025 05:40
@judicaelandria judicaelandria changed the title feat: add chromecast support feat: Implements Chromecast functionality for Video.js with remoteplayback API Nov 11, 2025
@judicaelandria judicaelandria force-pushed the mandriamahandry/add-chromecast-support branch from fe3ba58 to f92a3dc Compare November 11, 2025 07:06
@judicaelandria judicaelandria force-pushed the mandriamahandry/add-chromecast-support branch 6 times, most recently from a91ed87 to 9bebbd8 Compare January 20, 2026 16:40
@judicaelandria judicaelandria changed the title feat: Implements Chromecast functionality for Video.js with remoteplayback API feat: Add support for chromecast Jan 20, 2026
@judicaelandria judicaelandria force-pushed the mandriamahandry/add-chromecast-support branch 6 times, most recently from fc8d9e3 to 7f2c9ca Compare January 27, 2026 07:27
@judicaelandria judicaelandria marked this pull request as ready for review January 27, 2026 07:29
Copy link

@kmuncie kmuncie left a comment

Choose a reason for hiding this comment

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

@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 {
Copy link

Choose a reason for hiding this comment

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

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?

Copy link

Choose a reason for hiding this comment

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

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()) {
Copy link

Choose a reason for hiding this comment

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

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.');
Copy link

Choose a reason for hiding this comment

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

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.

Copy link

Choose a reason for hiding this comment

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

Looks good


/* Ensure button is visible when Chromecast is available */
.vjs-chromecast-button:not(.vjs-hidden) {
display: block;
Copy link

Choose a reason for hiding this comment

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

Is block correct here? I see alot of out rules for buttons above setting flex?

Copy link

Choose a reason for hiding this comment

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

I see you removed this block entirely, was it actually not needed at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, we didn't need it

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',
Copy link

Choose a reason for hiding this comment

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

These two GOOGLE_CAST... constants are apparently never used, is that intentional?

Copy link

Choose a reason for hiding this comment

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

I see they were deleted.

@@ -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;
Copy link

Choose a reason for hiding this comment

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

Whats up with the mixed file types? SVG for normal button and then hover switches to PNG? Do we need better assets for hover?

Copy link

Choose a reason for hiding this comment

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

I dont see any changes here but I assume it will be considered further

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed @kmuncie

@judicaelandria judicaelandria force-pushed the mandriamahandry/add-chromecast-support branch from 7f2c9ca to 6b3def0 Compare January 30, 2026 13:41
- 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.
@judicaelandria judicaelandria force-pushed the mandriamahandry/add-chromecast-support branch from 6b3def0 to e45da59 Compare February 2, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants