Skip to content

Commit 97d20f7

Browse files
authored
fix: cast availability (#251)
1 parent 59f4ed4 commit 97d20f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/js/media-controller.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,10 @@ class MediaController extends MediaContainer {
426426
}
427427

428428
if (this._castUnavailable !== AvailabilityStates.UNSUPPORTED) {
429-
const castSupportHandler = (event) => {
429+
const castSupportHandler = () => {
430430
// Cast state: NO_DEVICES_AVAILABLE, NOT_CONNECTED, CONNECTING, CONNECTED
431-
if (event?.detail.includes('CONNECT')) {
431+
const castState = globalThis.CastableVideoElement?.castState;
432+
if (castState?.includes('CONNECT')) {
432433
this._castUnavailable = undefined;
433434
} else {
434435
this._castUnavailable = AvailabilityStates.UNAVAILABLE;

0 commit comments

Comments
 (0)