feat: Surface the provider's error cause in the media_unavailable notification (#2599)
- Closes: #2592
This commit is contained in:
@@ -25,7 +25,10 @@ import { mapFailureReasonToIssueReason } from '../../../../components-lib/live/p
|
||||
import { dispatchLiveErrorEvent } from '../../../../components-lib/live/utils/dispatch-live-error.js';
|
||||
import { MediaLoadedInfoSourceController } from '../../../../components-lib/media-loaded-info-source-controller.js';
|
||||
import { VideoMediaPlayerController } from '../../../../components-lib/media-player/video.js';
|
||||
import { SignedURLController } from '../../../../components-lib/signed-url-controller.js';
|
||||
import {
|
||||
getSignedURLErrorText,
|
||||
SignedURLController,
|
||||
} from '../../../../components-lib/signed-url-controller.js';
|
||||
import type { MicrophoneConfig } from '../../../../config/schema/live.js';
|
||||
import type { CardWideConfig } from '../../../../config/schema/types.js';
|
||||
import type { HomeAssistant } from '../../../../ha/types.js';
|
||||
@@ -162,7 +165,7 @@ export class AdvancedCameraCardGo2RTCExperimental
|
||||
// the error itself (below); the event drives the liveness verdict + retry.
|
||||
errorCallback: (reason) => {
|
||||
this._streamError = mapFailureReasonToIssueReason(reason);
|
||||
dispatchLiveErrorEvent(this, this._streamError);
|
||||
dispatchLiveErrorEvent(this, { reason: this._streamError });
|
||||
},
|
||||
});
|
||||
|
||||
@@ -243,7 +246,7 @@ export class AdvancedCameraCardGo2RTCExperimental
|
||||
const error = this._signedURLController.getError();
|
||||
if (error) {
|
||||
return renderMediaNotification({
|
||||
title: localize(error === 'proxy' ? 'error.failed_proxy' : 'error.failed_sign'),
|
||||
title: getSignedURLErrorText(error),
|
||||
targetTitle: this.cameraTitle,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,7 +11,10 @@ import { customElement, property } from 'lit/decorators.js';
|
||||
import type { Camera } from '../../../../camera-manager/camera.js';
|
||||
import { dispatchLiveErrorEvent } from '../../../../components-lib/live/utils/dispatch-live-error.js';
|
||||
import { VideoMediaPlayerController } from '../../../../components-lib/media-player/video.js';
|
||||
import { SignedURLController } from '../../../../components-lib/signed-url-controller.js';
|
||||
import {
|
||||
getSignedURLErrorText,
|
||||
SignedURLController,
|
||||
} from '../../../../components-lib/signed-url-controller.js';
|
||||
import type { MicrophoneConfig } from '../../../../config/schema/live.js';
|
||||
import type { HomeAssistant } from '../../../../ha/types.js';
|
||||
import { localize } from '../../../../localize/localize.js';
|
||||
@@ -153,7 +156,7 @@ export class AdvancedCameraCardGo2RTC extends LitElement implements MediaPlayer
|
||||
const error = this._signedURLController.getError();
|
||||
if (error) {
|
||||
return renderMediaNotification({
|
||||
title: localize(error === 'proxy' ? 'error.failed_proxy' : 'error.failed_sign'),
|
||||
title: getSignedURLErrorText(error),
|
||||
targetTitle: this.cameraTitle,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export class AdvancedCameraCardLiveImage extends LitElement implements MediaPlay
|
||||
.proxyConfig=${this.camera?.getLiveProxyConfig()}
|
||||
@advanced-camera-card:image-updating-player:error=${(
|
||||
ev: CustomEvent<MediaUnavailableIssueReason>,
|
||||
) => dispatchLiveErrorEvent(this, ev.detail)}
|
||||
) => dispatchLiveErrorEvent(this, { reason: ev.detail })}
|
||||
>
|
||||
</advanced-camera-card-image-updating-player>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user