Last active
October 28, 2020 16:20
-
-
Save furf/34183eca47e061ea2e22ace181296a4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<rmp-mock-video-controller> | |
<rmp-muted-toggle ?muted=${boolean('muted', true)}> | |
<rmp-mute-button id="story.mute" slot="mute-button"> | |
<icon-mute fill></icon-mute> | |
</rmp-mute-button> | |
<rmp-unmute-button id="story.unmute" slot="unmute-button"> | |
<icon-volume fill></icon-volume> | |
</rmp-unmute-button> | |
</rmp-muted-toggle> | |
</rmp-mock-video-controller> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MutedToggle component | |
*/ | |
export class MutedToggle extends LitElement { | |
@videoContext.Consumer('muted') | |
muted?: TMuted; | |
render() { | |
return this.muted | |
? html`<slot name="unmute-button">${this.renderUnmuteButtonSlot()}</slot>` | |
: html`<slot name="mute-button">${this.renderMuteButtonSlot()}</slot>`; | |
} | |
protected renderMuteButtonSlot() { | |
return html`<rmp-mute-button />`; | |
} | |
protected renderUnmuteButtonSlot() { | |
return html`<rmp-unmute-button />`; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment