Skip to content

Commit

Permalink
fix(mux-player): Extra type safety, because tests are confused.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjpillsbury committed Aug 25, 2022
1 parent 6765934 commit 8e7024f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/mux-player/src/helpers.ts
Expand Up @@ -113,7 +113,7 @@ export const isInLiveWindow = (el: MuxPlayerElement) => {
return false;
};

export class AttributeTokenList {
export class AttributeTokenList implements Iterable<string> {
#el?: HTMLElement;
#attr?: string;
#tokens: string[] = [];
Expand Down
5 changes: 4 additions & 1 deletion packages/mux-player/src/template.ts
Expand Up @@ -5,6 +5,7 @@ import {
getSrcFromPlaybackId,
getPosterURLFromPlaybackId,
getStoryboardURLFromPlaybackId,
AttributeTokenList,
} from './helpers';
import { html, unsafeStatic } from './html';
// @ts-ignore
Expand Down Expand Up @@ -84,7 +85,9 @@ export const content = (props: MuxTemplateProps) => html`
forward-seek-offset="${props.forwardSeekOffset}"
backward-seek-offset="${props.backwardSeekOffset}"
playbackrates="${props.playbackRates ?? false}"
hide-duration="${[...props.controlsList].some((key) => key.search(/^no(top|bottom|center)?duration/) === 0)}"
hide-duration="${[...(props?.controlsList?.values() ?? [])].some(
(key) => key.search(/^no(top|bottom|center)?duration/) === 0
)}"
default-show-remaining-time="${props.defaultShowRemainingTime ?? false}"
exportparts="seek-live, ${forwardUniqueCSSParts}"
>
Expand Down

0 comments on commit 8e7024f

Please sign in to comment.