mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-08 08:39:59 +00:00
Hide cast buttons when no media types are available
This commit is contained in:
@@ -171,8 +171,8 @@
|
|||||||
if (browserWindow?.id === undefined) return;
|
if (browserWindow?.id === undefined) return;
|
||||||
browser.windows.update(browserWindow.id, {
|
browser.windows.update(browserWindow.id, {
|
||||||
height: Math.ceil(
|
height: Math.ceil(
|
||||||
(document.body.clientHeight +
|
document.body.clientHeight +
|
||||||
(window.outerHeight - window.innerHeight))
|
(window.outerHeight - window.innerHeight)
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -417,6 +417,8 @@
|
|||||||
{port}
|
{port}
|
||||||
{device}
|
{device}
|
||||||
{isMediaTypeAvailable}
|
{isMediaTypeAvailable}
|
||||||
|
isAnyMediaTypeAvailable={availableMediaTypes !==
|
||||||
|
ReceiverSelectorMediaType.None}
|
||||||
isAnyConnecting={isConnecting}
|
isAnyConnecting={isConnecting}
|
||||||
on:cast={ev => onReceiverCast(ev.detail.device)}
|
on:cast={ev => onReceiverCast(ev.detail.device)}
|
||||||
on:stop={ev => onReceiverStop(ev.detail.device)}
|
on:stop={ev => onReceiverStop(ev.detail.device)}
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
export let isAnyConnecting: boolean;
|
export let isAnyConnecting: boolean;
|
||||||
/** Whether the selected media type is available for this receiver. */
|
/** Whether the selected media type is available for this receiver. */
|
||||||
export let isMediaTypeAvailable: boolean;
|
export let isMediaTypeAvailable: boolean;
|
||||||
|
/** Whether any media types are available for this receiver. */
|
||||||
|
export let isAnyMediaTypeAvailable: boolean;
|
||||||
|
|
||||||
/** Receiver device to display. */
|
/** Receiver device to display. */
|
||||||
export let device: ReceiverDevice;
|
export let device: ReceiverDevice;
|
||||||
@@ -98,7 +100,7 @@
|
|||||||
>
|
>
|
||||||
{_("popupStopButtonTitle")}
|
{_("popupStopButtonTitle")}
|
||||||
</button>
|
</button>
|
||||||
{:else}
|
{:else if isAnyMediaTypeAvailable}
|
||||||
<button
|
<button
|
||||||
class="receiver__cast-button"
|
class="receiver__cast-button"
|
||||||
disabled={isConnecting || isAnyConnecting || !isMediaTypeAvailable}
|
disabled={isConnecting || isAnyConnecting || !isMediaTypeAvailable}
|
||||||
|
|||||||
Reference in New Issue
Block a user