Skip to content

Commit 75668ae

Browse files
add getPingInfo (#215)
1 parent a4d6015 commit 75668ae

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/data-sdk/src/devices/BaseDevice.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
RtcClient,
55
IRtcPeer,
66
} from "@formant/realtime-sdk";
7+
import { IPingInfo } from "@formant/realtime-sdk/dist/rtc-client/models/IPingInfo";
78
import { DataChannel } from "../DataChannel";
89
import { EventEmitter } from "eventemitter3";
910
import { Manipulator } from "../Manipulator";
@@ -73,6 +74,14 @@ export abstract class BaseDevice
7374
}
7475
}
7576

77+
getRealtimePingInfo(): IPingInfo | undefined {
78+
if (this.rtcClient && this.remoteDevicePeerId) {
79+
return this.rtcClient.getPingInfo(this.remoteDevicePeerId);
80+
} else {
81+
throw new Error(`Realtime connection hasn't been started`);
82+
}
83+
}
84+
7685
getRealtimePing(): number | undefined {
7786
if (this.rtcClient && this.remoteDevicePeerId) {
7887
return this.rtcClient.getPing(this.remoteDevicePeerId);

0 commit comments

Comments
 (0)