Skip to content

Commit

Permalink
Docs edits (including a list of unsupported features) (#651)
Browse files Browse the repository at this point in the history
* Docs edits (including a list of unsupported features)

Also fixes some details in the TypeScript type definitions.

* Notes on missing 2.23 features

* Typo corrections
  • Loading branch information
jeffswartz authored Mar 15, 2023
1 parent 8ec9080 commit ef46879
Show file tree
Hide file tree
Showing 8 changed files with 639 additions and 232 deletions.
59 changes: 48 additions & 11 deletions @types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,38 @@ declare module "opentok-react-native" {
stream: Stream;
}

interface ArchiveEvent {
archiveId: string;
name: string;
sessionId: string;
}

interface ErrorEvent {
code: string;
message: string;
}

interface SubscriberAudioStatsEvent {
audioBytesReceived: number,
audioPacketsLost: number,
audioPacketsReceived: number,
timeStamp: number,
}

interface VideoNetworkStatsEvent {
videoPacketsLost: number,
videoBytesReceived: number,
videoPacketsReceived: number,
timestamp: number,
}

interface SignalEvent {
sessionId: string;
fromConnection: string;
type: string;
data: string;
}

interface OTSessionProps extends ViewProps {
/**
* TokBox API Key
Expand All @@ -87,6 +119,11 @@ declare module "opentok-react-native" {
*/
signal?: any;

/**
* Used to get details about the session
*/
getSessionInfo?: any

/**
* Event handlers passed into the native session instance.
*/
Expand Down Expand Up @@ -127,7 +164,7 @@ declare module "opentok-react-native" {
isCamera2Capable?: boolean;

/**
* Android only - default is false
* Whether to use the allowed IP list feature - default is false
*/
ipWhitelist?: boolean;

Expand All @@ -153,12 +190,12 @@ declare module "opentok-react-native" {
/**
* Sent when an archive recording of a session starts. If you connect to a session in which recording is already in progress, this message is sent when you connect.
*/
archiveStarted?: CallbackWithParam<any, any>;
archiveStarted?: CallbackWithParam<ArchiveEvent, any>;

/**
* Sent when an archive recording of a session stops.
*/
archiveStopped?: CallbackWithParam<string, any>;
archiveStopped?: CallbackWithParam<ArchiveEvent, any>;

/**
* Sent when another client connects to the session. The connection object represents the client’s connection.
Expand All @@ -173,7 +210,7 @@ declare module "opentok-react-native" {
/**
* Sent if the attempt to connect to the session fails or if the connection to the session drops due to an error after a successful connection.
*/
error?: CallbackWithParam<any, any>;
error?: CallbackWithParam<ErrorEvent, any>;

/**
* Sent if there is an error with the communication between the native session instance and the JS component.
Expand Down Expand Up @@ -201,9 +238,9 @@ declare module "opentok-react-native" {
sessionReconnecting?: Callback<any>;

/**
* Sent when the local client has lost its connection to an OpenTok session and is trying to reconnect. This results from a loss in network connectivity. If the client can reconnect to the session, the sessionReconnected message is sent. Otherwise, if the client cannot reconnect, the sessionDisconnected message is sent.
* Sent when the client receives a signal.
*/
signal?: CallbackWithParam<any, any>;
signal?: CallbackWithParam<SignalEvent, any>;

/**
* Sent when a new stream is created in this session.
Expand Down Expand Up @@ -325,12 +362,12 @@ declare module "opentok-react-native" {
/**
* Sent when the publisher starts streaming.
*/
streamCreated?: CallbackWithParam<any, any>;
streamCreated?: CallbackWithParam<StreamCreatedEvent, any>;

/**
* Sent when the publisher stops streaming.
*/
streamDestroyed?: CallbackWithParam<any, any>;
streamDestroyed?: CallbackWithParam<StreamDestroyedEvent, any>;
}

/**
Expand All @@ -340,7 +377,7 @@ declare module "opentok-react-native" {

interface OTSubscriberProps extends ViewProps {
/**
* OpenTok Session Id. This is auto populated by wrapping OTSubscriber with OTSession
* OpenTok Session ID. This is auto populated by wrapping OTSubscriber with OTSession
*/
sessionId?: string;

Expand Down Expand Up @@ -391,7 +428,7 @@ declare module "opentok-react-native" {
/**
* Sent periodically to report audio statistics for the subscriber.
*/
audioNetworkStats?: CallbackWithParam<any, any>;
audioNetworkStats?: CallbackWithParam<SubscriberAudioStatsEvent, any>;

/**
* Sent when the subscriber successfully connects to the stream.
Expand Down Expand Up @@ -441,7 +478,7 @@ declare module "opentok-react-native" {
/**
* Sent periodically to report video statistics for the subscriber.
*/
videoNetworkStats?: CallbackWithParam<any, any>;
videoNetworkStats?: CallbackWithParam<VideoNetworkStatsEvent, any>;
}

interface OTSubscriberViewProps extends ViewProps {
Expand Down
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@

<img src="https://assets.tokbox.com/img/vonage/Vonage_VideoAPI_black.svg" height="48px" alt="Tokbox is now known as Vonage" />

## Please note that this library is not officially supported by Vonage.
React Native library for OpenTok iOS and Android SDKs

- [opentok-react-native](#opentok-react-native)
- [Please note that this library is not officially supported by Vonage.](#please-note-that-this-library-is-not-officially-supported-by-vonage)
- [In this repo, you'll find the OpenTok React Native library:](#in-this-repo-youll-find-the-opentok-react-native-library)
- [Pre-Requisites:](#pre-requisites)
- [Installation:](#installation)
- [iOS Installation](#ios-installation)
- [Android Installation](#android-installation)
- [Bintray sunset](#bintray-sunset)
- [Samples](#samples)
- [Development and Contributing](#development-and-contributing)
- [Getting Help](#getting-help)

### In this repo, you'll find the OpenTok React Native library:
React Native library for using [OpenTok](https://tokbox.com/developer/).

**Important:** Please note that this library is not officially supported by Vonage.

- [Pre-Requisites:](#pre-requisites)
- [Installation:](#installation)
- [iOS Installation](#ios-installation)
- [Android Installation](#android-installation)
- [Samples](#samples)
- [Docs](#docs)
- [Development and Contributing](#development-and-contributing)
- [Getting Help](#getting-help)

In this repo, you'll find the OpenTok React Native library.

## Pre-Requisites:

Expand Down Expand Up @@ -165,6 +163,10 @@ allprojects {
}
```

## Docs

See the [docs](/docs/index.mg).

## Samples

To see this library in action, check out the [opentok-react-native-samples](https://github.com/opentok/opentok-react-native-samples) repo.
Expand Down
Loading

0 comments on commit ef46879

Please sign in to comment.