Skip to content

Commit

Permalink
Merge pull request #689 from opentok/develop
Browse files Browse the repository at this point in the history
v2.25.3
  • Loading branch information
jeffswartz authored Sep 28, 2023
2 parents d327d99 + 310cd7a commit bf5af09
Show file tree
Hide file tree
Showing 24 changed files with 874 additions and 44 deletions.
64 changes: 62 additions & 2 deletions @types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ declare module "opentok-react-native" {
timestamp: number,
}

interface PublisherRtcStatsReport {
connectionId: string,
jsonArrayOfReports: string,
}

interface SignalEvent {
sessionId: string;
fromConnection: string;
Expand Down Expand Up @@ -124,6 +129,35 @@ declare module "opentok-react-native" {
*/
getSessionInfo?: any

/**
* Used to get capabilities of the client
*/
getCapabilities(): Promise<{
canForceMute: boolean;
canPublish: boolean;
canSubscribe: boolean;
}>

/**
* Mutes all streams in the session.
*/
forceMuteAll(excludedStreamIds: string[]): Promise<>

/**
* Mutes a stream in the session.
*/
forceMuteStream(streamId: string): Promise<>

/**
* Disables the force mute state for the session.
*/
disableForceMute(): Promise<>

/**
* Used to report an issue
*/
reportIssue(): Promise<string>

/**
* Event handlers passed into the native session instance.
*/
Expand Down Expand Up @@ -273,6 +307,13 @@ declare module "opentok-react-native" {
* Event handlers passed into native publsiher instance
*/
eventHandlers?: OTPublisherEventHandlers;

/**
* Gets the RTC stats report for the publisher. This is an asynchronous operation.
* The OTPublisher object dispatches an rtcStatsReport event when RTC statistics for
* the publisher are available.
*/
getRtcStatsReport(): void;
}

interface OTPublisherProperties {
Expand Down Expand Up @@ -328,9 +369,9 @@ declare module "opentok-react-native" {
publishVideo?: boolean;

/**
* The desired resolution of the video. The format of the string is "widthxheight", where the width and height are represented in pixels. Valid values are "1280x720", "640x480", and "352x288". The published video will only use the desired resolution if the client configuration supports it. Some devices and clients do not support each of these resolution settings.
* The desired resolution of the video. The format of the string is "widthxheight", where the width and height are represented in pixels. Valid values are "1920x1080", "1280x720", "640x480", and "352x288". The published video will only use the desired resolution if the client configuration supports it. Some devices and clients do not support each of these resolution settings.
*/
resolution?: "1280x720" | "640x480" | "352x288";
resolution?: "1920x1080" | "1280x720" | "640x480" | "352x288";

/**
* If this property is set to false, the video subsystem will not be initialized for the publisher, and setting the publishVideo property will have no effect. If your application does not require the use of video, it is recommended to set this property rather than use the publishVideo property, which only temporarily disables the video track.
Expand Down Expand Up @@ -359,6 +400,12 @@ declare module "opentok-react-native" {
*/
otrnError?: CallbackWithParam<any, any>;

/**
* Sent when RTC stats reports are available for the publisher,
* in response to calling the OTPublisher.getRtcStatsReport() method.
*/
rtcStatsReport?: CallbackWithParam<PublisherRtcStatsReport[]>, any>;

/**
* Sent when the publisher starts streaming.
*/
Expand Down Expand Up @@ -405,6 +452,13 @@ declare module "opentok-react-native" {
* If set to true, the subscriber can subscribe to it's own publisher stream (default: false)
*/
subscribeToSelf?: boolean;

/**
* Gets the RTC stats report for the subscriber. This is an asynchronous operation.
* The OTSubscriber object dispatches an rtcStatsReport event when RTC statistics for
* the publisher are available.
*/
getRtcStatsReport(): void;
}

interface OTSubscriberProperties {
Expand Down Expand Up @@ -450,6 +504,12 @@ declare module "opentok-react-native" {
*/
otrnError?: CallbackWithParam<any, any>;

/**
* Sent when an RTC stats report is available for the subscriber,
* in response to calling the OTSubscriber.getRtcStatsReport() method.
*/
rtcStatsReport?: CallbackWithParam<RtcStatsReport>, any>;

/**
* Sent when a frame of video has been decoded. Although the subscriber will connect in a relatively short time, video can take more time to synchronize. This message is sent after the connected message is sent.
*/
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# 2.25.3 (September 2023)

- [Update]: Add API to implement functionality missing from the OpenTok Android and iOS SDKs:

* `OTSession.getCapabilities()` method
* `reportIssue()` methods and `rtcStatsReport` events added to OTPublisher and OTSubscriber
* OTPublisher `scalableScreenshare` option (in the OTPublisher properties)
* OTPublisher `audioNetworkStats` and `videoNetworkStats` events
* `OTPublisher.getRtcStatsReport()` method and OTPublisher `rtcStatsReport` event
* "1920x1080" option for OTPublisher `resolution` (for FHD video support)
* OTSubscriber `audioVolume` property.
* OT.getSupportedCodecs() method.
* OT.forceMuteAll(), OT.forceMuteStream(), OT.disableForceMute() methods. OTPublisher
`muteForce` event and OTSession `muteForced` event.

For more info, see the docs:

* [OTPublisher](/docs/OTPublisher.md)
* [OTSession](/docs/OTSession.md)
* [OTSubscriber](/docs/OTSubscriber.md)

- [Fix]: Fix android app crash due to permission missing.

# 2.25.2 (July 5 2023)

- [Fix]: Fix crash on iOS when publishing a screen-sharing stream.
Expand Down
Loading

0 comments on commit bf5af09

Please sign in to comment.