Skip to content

Commit aa3a1ca

Browse files
authored
fix: bring back cast button for drm protected videos (#1137)
## Context I have been writing documentation for building a custom Chromecast sender and receiver for DRM playback. With the help of @luwes we discovered that the Mux player sends everything you need for a custom receiver to play DRM content. Unfortunately it's still not usable because we always hide the cast button when a DRM token is provided. This PR brings back the cast button for DRM content if you configure a custom cast receiver. ## Testing ### Example code ``` <mux-player id="player" playback-id="..." playback-token="..." drm-token=".." cast-receiver="" ></mux-player> ``` ### In production Using the `<mux-player>` with a drm-token attribute will *hide* the cast button Using the `<mux-player>` with a drm-token attribute and a cast-receiver attribute will *hide* the cast button ### In this PR Using the `<mux-player>` with a drm-token attribute will *hide* the cast button Using the `<mux-player>` with a drm-token attribute and a cast-receiver attribute will *show* the cast button
1 parent 1c850b6 commit aa3a1ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/mux-player/src/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const getPropsCSS = (props: MuxTemplateProps) => {
1111
const { tokens } = props;
1212
if (!tokens.drm) return '';
1313
// See styles.css for usage.
14-
return ':host { --_cast-button-drm-display: none; }';
14+
return ':host(:not([cast-receiver])) { --_cast-button-drm-display: none; }';
1515
};
1616

1717
export const template = (props: MuxTemplateProps) => html`

0 commit comments

Comments
 (0)