Skip to content

Commit

Permalink
Add scalable video setting (#236)
Browse files Browse the repository at this point in the history
* Add scalableVideo option

... to enable disabling scalable video. Scalable video is enabled by default.

* Rev version

* Set Publisher scalableVideo option to false

This improves testQuality() results.
  • Loading branch information
jeffswartz authored Mar 13, 2023
1 parent bfd059f commit acbcbde
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ The `OTNetworkTest()` constructor includes the following parameters:
in OpenTok.js). For more information, please check the
[IP Proxy Documentation](https://tokbox.com/developer/guides/ip-proxy/).

* `scalableVideo` (Boolean) -- (Optional) Whether to use
[scalable video](https://tokbox.com/developer/guides/scalable-video/)
(`true`) or not (`false`, the default). Disabling scalable video
was added in OpenTok.js version 2.24.7.

The `options` parameter is optional.

The constructor throws an Error object with a `message` property and a `name` property. The
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opentok-network-test-js",
"version": "2.4.5",
"version": "2.5.0",
"description": "Precall network test for applications using the OpenTok platform.",
"main": "dist/NetworkTest/index.js",
"types": "dist/NetworkTest/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/NetworkTest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface NetworkTestOptions {
videoSource?: string;
initSessionOptions?: OT.InitSessionOptions;
proxyServerUrl?: string;
scalableVideo?: boolean;
}

export default class NetworkTest {
Expand Down
4 changes: 4 additions & 0 deletions src/NetworkTest/testConnectivity/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ function checkCreateLocalPublisher(
height: '100%',
insertMode: 'append',
showControls: false,
scalableVideo: false,
};
if (options && options.audioSource) {
publisherOptions.audioSource = options.audioSource;
Expand All @@ -181,6 +182,9 @@ function checkCreateLocalPublisher(
if (!Object.keys(availableDevices.video).length) {
publisherOptions.videoSource = null;
}
if (options && options.scalableVideo) {
publisherOptions.scalableVideo = options.scalableVideo;
}
const publisher = OT.initPublisher(publisherDiv, publisherOptions, (error?: OT.OTError) => {
if (!error) {
resolve({ publisher });
Expand Down
1 change: 1 addition & 0 deletions src/NetworkTest/types/opentok/publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface PublisherProperties extends WidgetProperties, GetUserMediaPrope
'320x240' |
'320x180'
);
scalableVideo?: boolean;
style?: Partial<PublisherStyle>;
usePreviousDeviceSelection?: boolean;
videoSource?: string | null;
Expand Down

0 comments on commit acbcbde

Please sign in to comment.