Improve handling of receiver actions

This commit is contained in:
hensm
2022-08-26 06:09:52 +01:00
parent ee492802e0
commit 90b00c0ce4
10 changed files with 275 additions and 356 deletions

View File

@@ -8,7 +8,6 @@
import {
ReceiverDevice,
ReceiverDeviceCapabilities,
ReceiverSelectionActionType,
ReceiverSelectorMediaType,
ReceiverSelectorPageInfo
} from "../../types";
@@ -347,7 +346,6 @@
subject: "receiverSelector:selected",
data: {
receiverDevice,
actionType: ReceiverSelectionActionType.Cast,
mediaType
}
});
@@ -355,12 +353,17 @@
function onReceiverStop(receiverDevice: ReceiverDevice) {
port?.postMessage({
subject: "receiverSelector:stop",
subject: "receiverSelector:receiverMessage",
data: {
receiverDevice,
actionType: ReceiverSelectionActionType.Stop
deviceId: receiverDevice.id,
message: { requestId: 0, type: "STOP" }
}
});
port?.postMessage({
subject: "receiverSelector:stop",
data: { deviceId: receiverDevice.id }
});
}
</script>