mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-08 08:39:59 +00:00
Fix incorrect device ID being set in Receiver API object
This commit is contained in:
@@ -83,7 +83,9 @@ export default class Session extends CastClient {
|
||||
volume: status.volume,
|
||||
appId: application.appId,
|
||||
displayName: application.displayName,
|
||||
receiverFriendlyName: friendlyName,
|
||||
receiverId: this.receiverDevice.id,
|
||||
receiverFriendlyName:
|
||||
this.receiverDevice.friendlyName,
|
||||
transportId: this.sessionId,
|
||||
|
||||
// TODO: Fix this
|
||||
@@ -162,23 +164,25 @@ export default class Session extends CastClient {
|
||||
) {
|
||||
super();
|
||||
|
||||
super.connect(receiverDevice.host, {
|
||||
onHeartbeat: () => {
|
||||
// Include transport heartbeat with platform heartbeat
|
||||
if (this.transportHeartbeat) {
|
||||
this.transportHeartbeat.send({ type: "PING" });
|
||||
super
|
||||
.connect(receiverDevice.host, {
|
||||
onHeartbeat: () => {
|
||||
// Include transport heartbeat with platform heartbeat
|
||||
if (this.transportHeartbeat) {
|
||||
this.transportHeartbeat.send({ type: "PING" });
|
||||
}
|
||||
},
|
||||
onReceiverMessage: message => {
|
||||
this.onReceiverMessage(message);
|
||||
}
|
||||
},
|
||||
onReceiverMessage: message => {
|
||||
this.onReceiverMessage(message);
|
||||
}
|
||||
}).then(() => {
|
||||
// Send a launch request and store the request ID for reference
|
||||
this.launchRequestId = this.sendReceiverMessage({
|
||||
type: "LAUNCH",
|
||||
appId: this.appId
|
||||
})
|
||||
.then(() => {
|
||||
// Send a launch request and store the request ID for reference
|
||||
this.launchRequestId = this.sendReceiverMessage({
|
||||
type: "LAUNCH",
|
||||
appId: this.appId
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Handle client connection closed
|
||||
this.client.on("close", () => {
|
||||
|
||||
@@ -25,6 +25,7 @@ export interface CastSessionCreatedDetails extends CastSessionUpdatedDetails {
|
||||
appId: string;
|
||||
appImages: Image[];
|
||||
displayName: string;
|
||||
receiverId: string;
|
||||
receiverFriendlyName: string;
|
||||
senderApps: SenderApplication[];
|
||||
transportId: string;
|
||||
|
||||
@@ -5,10 +5,7 @@ import logger from "../../lib/logger";
|
||||
import { ReceiverDevice } from "../../types";
|
||||
import { ErrorCallback, SuccessCallback } from "../types";
|
||||
|
||||
import {
|
||||
onMessage,
|
||||
sendMessageResponse
|
||||
} from "../eventMessageChannel";
|
||||
import { onMessage, sendMessageResponse } from "../eventMessageChannel";
|
||||
|
||||
import {
|
||||
AutoJoinPolicy,
|
||||
@@ -262,7 +259,7 @@ onMessage(message => {
|
||||
|
||||
// TODO: Implement persistent per-origin receiver IDs
|
||||
const receiver = new Receiver(
|
||||
status.receiverFriendlyName, // label
|
||||
status.receiverId, // label
|
||||
status.receiverFriendlyName, // friendlyName
|
||||
[Capability.VIDEO_OUT, Capability.AUDIO_OUT], // capabilities
|
||||
status.volume // volume
|
||||
|
||||
@@ -60,6 +60,7 @@ export interface CastSessionCreatedDetails extends CastSessionUpdatedDetails {
|
||||
appId: string;
|
||||
appImages: Image[];
|
||||
displayName: string;
|
||||
receiverId: string;
|
||||
receiverFriendlyName: string;
|
||||
senderApps: SenderApplication[];
|
||||
transportId: string;
|
||||
|
||||
Reference in New Issue
Block a user