Skip to content

Commit 31035fd

Browse files
author
smoghe-bw
committed
Revert "fix: route gateway streamAvailable notification to new onInboundStreamNotification callback"
This reverts commit e587b4d.
1 parent 2f76547 commit 31035fd

2 files changed

Lines changed: 2 additions & 32 deletions

File tree

src/bandwidthRtc.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class BandwidthRtc {
2222
// Event handlers
2323
private streamAvailableHandler?: { (event: RtcStream): void };
2424
private streamUnavailableHandler?: { (event: RtcStream): void };
25-
private inboundStreamNotificationHandler?: { (event: RtcStream): void };
2625
private readyHandler?: { (readyMetadata: ReadyMetadata): void };
2726

2827
private logLevel?: LogLevel;
@@ -78,10 +77,6 @@ class BandwidthRtc {
7877
this.delegate!.onStreamUnavailable(this.streamUnavailableHandler);
7978
}
8079

81-
if (this.inboundStreamNotificationHandler) {
82-
this.delegate!.onInboundStreamNotification(this.inboundStreamNotificationHandler);
83-
}
84-
8580
if (this.readyHandler) {
8681
this.delegate!.onReady(this.readyHandler);
8782
}
@@ -121,19 +116,6 @@ class BandwidthRtc {
121116
}
122117
}
123118

124-
/**
125-
* Set the function that will be called when the gateway signals that an inbound
126-
* stream is ready to be accepted or declined, before the WebRTC media arrives.
127-
* Use this to drive accept/decline UI; mediaStream will be undefined at this point.
128-
* @param callback callback function
129-
*/
130-
onInboundStreamNotification(callback: { (event: RtcStream): void }): void {
131-
this.inboundStreamNotificationHandler = callback;
132-
if (this.delegate) {
133-
this.delegate.onInboundStreamNotification(callback);
134-
}
135-
}
136-
137119
/**
138120
* Set the function that will be called when a subscribed stream becomes unavailable
139121
* @param callback callback function

src/v1/bandwidthRtc.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export class BandwidthRtc {
7777
// Event handlers
7878
private streamAvailableHandler?: { (event: RtcStream): void };
7979
private streamUnavailableHandler?: { (event: RtcStream): void };
80-
private inboundStreamNotificationHandler?: { (event: RtcStream): void };
8180
private readyHandler?: { (readyMetadata: ReadyMetadata): void };
8281

8382
/**
@@ -111,8 +110,8 @@ export class BandwidthRtc {
111110
this.signaling.on("sdpOffer", this.handleSubscribeSdpOffer.bind(this));
112111
this.signaling.on("init", this.init.bind(this));
113112
this.signaling.on("streamAvailable", ({ callId, autoAccepted }: { callId: string; autoAccepted: boolean }) => {
114-
if (this.inboundStreamNotificationHandler) {
115-
this.inboundStreamNotificationHandler({ mediaTypes: [MediaType.AUDIO], callId, autoAccepted });
113+
if (this.streamAvailableHandler) {
114+
this.streamAvailableHandler({ mediaTypes: [MediaType.AUDIO], callId, autoAccepted });
116115
}
117116
});
118117
this.signaling.on("streamUnavailable", ({ callId }: { callId: string }) => {
@@ -136,23 +135,12 @@ export class BandwidthRtc {
136135

137136
/**
138137
* Set the function that will be called when a subscribed stream becomes available.
139-
* The RtcStream passed to the callback always contains a populated mediaStream.
140138
* @param callback callback function
141139
*/
142140
onStreamAvailable(callback: { (event: RtcStream): void }): void {
143141
this.streamAvailableHandler = callback;
144142
}
145143

146-
/**
147-
* Set the function that will be called when the gateway signals that an inbound
148-
* stream is ready to be accepted or declined, before the WebRTC media arrives.
149-
* Use this to drive accept/decline UI; mediaStream will be undefined at this point.
150-
* @param callback callback function
151-
*/
152-
onInboundStreamNotification(callback: { (event: RtcStream): void }): void {
153-
this.inboundStreamNotificationHandler = callback;
154-
}
155-
156144
/**
157145
* Set the function that will be called when a subscribed stream becomes unavailable
158146
* @param callback callback function

0 commit comments

Comments
 (0)