Cast API overhaul (#173)

Re-write the shim<->bridge messaging interface and session creation/update handling for better accuracy.
This commit is contained in:
Matt Hensman
2021-05-03 14:37:54 +01:00
committed by GitHub
parent ccac662e74
commit 101c25e26d
25 changed files with 1079 additions and 1346 deletions

View File

@@ -41,7 +41,7 @@ export default new class ShimManager {
for (const shim of this.activeShims) {
shim.contentPort.postMessage({
subject: "shim:serviceUp"
, data: { id: ev.detail.receiverDevice.id }
, data: { receiverDevice: ev.detail.receiverDevice }
});
}
});
@@ -50,7 +50,7 @@ export default new class ShimManager {
for (const shim of this.activeShims) {
shim.contentPort.postMessage({
subject: "shim:serviceDown"
, data: { id: ev.detail.receiverDeviceId }
, data: { receiverDeviceId: ev.detail.receiverDeviceId }
});
}
});
@@ -173,7 +173,7 @@ export default new class ShimManager {
for (const receiverDevice of receiverDevices.getDevices()) {
shim.contentPort.postMessage({
subject: "shim:serviceUp"
, data: { id: receiverDevice.id }
, data: { receiverDevice }
});
}

View File

@@ -76,7 +76,7 @@ export default new class extends TypedEventTarget<EventMap> {
const receiverDevice = this.receiverDevices.get(receiverDeviceId);
if (receiverDevice) {
this.bridgePort.postMessage({
subject: "bridge:stopReceiverApp"
subject: "bridge:stopCastApp"
, data: { receiverDevice }
});
}