+
stopEventFromActivatingCardWideActions(ev)}
+ @animationend=${this._handleAnimationEnd}
+ >
+ ${this._renderButton(
+ 'mdi:phone-hangup',
+ localize('config.live.controls.call.end'),
+ {
+ emphasis: 'critical',
+ action: createCallEndAction(),
+ },
+ )}
+ ${this._renderButton(
+ microphoneMuted ? 'mdi:microphone-off' : 'mdi:microphone',
+ microphoneMuted
+ ? localize('config.live.controls.call.unmute_microphone')
+ : localize('config.live.controls.call.mute_microphone'),
+ {
+ emphasis: microphoneMuted ? undefined : 'critical',
+ action: createGeneralAction(
+ microphoneMuted ? 'microphone_unmute' : 'microphone_mute',
+ ),
+ },
+ )}
+ ${this._renderButton(
+ audioMuted ? 'mdi:volume-off' : 'mdi:volume-high',
+ audioMuted
+ ? localize('config.live.controls.call.unmute_audio')
+ : localize('config.live.controls.call.mute_audio'),
+ {
+ disabled: !audioAvailable,
+ handler: () => fireAdvancedCameraCardEvent(this, 'call:mute-toggle'),
+ },
+ )}
+
+
`;
+ }
+
+ private _handleAnimationEnd = (ev: AnimationEvent): void => {
+ if (hasPopOutAnimationEnded(ev)) {
+ this._exiting = false;
+ }
+ };
+
+ private _renderButton(
+ icon: string,
+ label: string,
+ options?: {
+ disabled?: boolean;
+ emphasis?: 'critical';
+ action?: ActionConfig;
+ handler?: () => void;
+ },
+ ): TemplateResult {
+ return html`
+