mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-11 01:59:58 +00:00
Fix sender app detection
This commit is contained in:
@@ -924,8 +924,25 @@ async function getReceiverSelection(selectionOpts: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable app media type if sender application is present
|
let appInfo: Optional<ReceiverSelectorAppInfo>;
|
||||||
if (selectionOpts.castInstance) {
|
if (selectionOpts.castInstance?.apiConfig) {
|
||||||
|
if (!baseConfig) {
|
||||||
|
try {
|
||||||
|
({ baseConfig } = await baseConfigStorage.get("baseConfig"));
|
||||||
|
} catch (err) {
|
||||||
|
throw logger.error("Failed to get Chromecast base config!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
appInfo = {
|
||||||
|
sessionRequest: selectionOpts.castInstance.apiConfig.sessionRequest,
|
||||||
|
isRequestAppAudioCompatible: getAppTag(
|
||||||
|
baseConfig,
|
||||||
|
selectionOpts.castInstance.apiConfig?.sessionRequest.appId
|
||||||
|
)?.supports_audio_only
|
||||||
|
};
|
||||||
|
|
||||||
|
// Enable app media type if sender application is present
|
||||||
defaultMediaType = ReceiverSelectorMediaType.App;
|
defaultMediaType = ReceiverSelectorMediaType.App;
|
||||||
availableMediaTypes |= ReceiverSelectorMediaType.App;
|
availableMediaTypes |= ReceiverSelectorMediaType.App;
|
||||||
}
|
}
|
||||||
@@ -938,27 +955,6 @@ async function getReceiverSelection(selectionOpts: {
|
|||||||
// Ensure status manager is initialized
|
// Ensure status manager is initialized
|
||||||
await deviceManager.init();
|
await deviceManager.init();
|
||||||
|
|
||||||
let appInfo: Optional<ReceiverSelectorAppInfo>;
|
|
||||||
if (selectionOpts.castInstance?.apiConfig) {
|
|
||||||
if (!baseConfig) {
|
|
||||||
try {
|
|
||||||
baseConfig = (await baseConfigStorage.get("baseConfig"))
|
|
||||||
.baseConfig;
|
|
||||||
} catch (err) {
|
|
||||||
throw logger.error("Failed to get Chromecast base config!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
appInfo = {
|
|
||||||
sessionRequest:
|
|
||||||
selectionOpts.castInstance.apiConfig?.sessionRequest,
|
|
||||||
isRequestAppAudioCompatible: getAppTag(
|
|
||||||
baseConfig,
|
|
||||||
selectionOpts.castInstance.apiConfig?.sessionRequest.appId
|
|
||||||
)?.supports_audio_only
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
// Close an existing open selector
|
// Close an existing open selector
|
||||||
if (receiverSelector?.isOpen) {
|
if (receiverSelector?.isOpen) {
|
||||||
|
|||||||
Reference in New Issue
Block a user