Giter Site home page Giter Site logo

opentok / opentok-network-test-js Goto Github PK

View Code? Open in Web Editor NEW
57.0 46.0 44.0 2.36 MB

A node module that lets you check network connectivity to resources and services required to use OpenTok

License: MIT License

JavaScript 6.44% TypeScript 93.56%
opentok javascript tokbox webrtc

opentok-network-test-js's Introduction

logo

OpenTok Network Test

Build Status license npm

This Node module lets you check network connectivity to resources and services required to use OpenTok. Run this on a web client to get the following information:

  • Whether the client will be able to succeed in connecting to an OpenTok session

  • MOS estimates for the audio and video quality the client will experience

  • A recommended frame rate and resolution to use for publishing to a session

For a sample that uses this module, see the OpenTok Pre-call Test tool.

Example Usage in Node/Browserify/Webpack

First, install the package:

$ npm install opentok-network-test-js

Now load the OpenTok Network Test in your project. The module exports two objects:

  • NetworkTest -- The class containing methods for testing your OpenTok connectivity and quality. This is the default export.

  • ErrorNames -- An object enumerating error name values

Using CommonJS:

const NetworkTest = require('opentok-network-test-js').default;
const ErrorNames = require('opentok-network-test-js').ErrorNames;

... or ES6 ...

import NetworkTest, { ErrorNames } from 'opentok-network-test-js';

Load the OpenTok.js library.

Instantiate an instance of the test object, passing in the OpenTok.js OT object and a configuration object. The configuration object contains an API key for your app's OpenTok project, a session ID for a test session, and a token for that session:

const otNetworkTest = new NetworkTest(OT, {
  apiKey: '123456', // Add the API key for your OpenTok project here.
  sessionId: '1_MX40NzIwMzJ-fjE1MDElGQkJJfn4', // Add a test session ID for that project
  token: 'T1==cGFydG5lcXN0PQ==' // Add a token for that session here
});

Use the OpenTok server SDKs to generate a unique session ID for each client. This session ID is used for the network test, and it must be different than the session ID used for communication in the app. The test session must be a routed session -- one that uses the OpenTok Media Router. Also generate a test token that has publish privileges.

Then run the test methods:

otNetworkTest.testConnectivity().then((results) => {
  console.log('OpenTok connectivity test results', results);
  otNetworkTest.testQuality(function updateCallback(stats) {
    console.log('intermediate testQuality stats', stats);
  }).then((results) => {
    // This function is called when the quality test is completed.
    console.log('OpenTok quality results', results);
    let publisherSettings = {};
    if (results.video.reason) {
      console.log('Video not supported:', results.video.reason);
      publisherSettings.videoSource = null; // audio-only
    } else {
      publisherSettings.frameRate = results.video.recommendedFrameRate;
      publisherSettings.resolution = results.video.recommendedResolution;
    }
    if (!results.audio.supported) {
      console.log('Audio not supported:', results.audio.reason);
      publisherSettings.audioSource = null;
      // video-only, but you probably don't want this -- notify the user?
    }
    if (!publisherSettings.videoSource && !publisherSettings.audioSource) {
      // Do not publish. Notify the user.
    } else {
      // Publish to the "real" session, using the publisherSettings object.
    }
  }).catch((error) => {
    console.log('OpenTok quality test error', error);
  });
}).catch(function(error) {
  console.log('OpenTok connectivity test error', error);
});

You can also run the tests in audio-only mode by passing in an options object with audioOnly set to true into the constructor:

const sessionInfo = {
  apiKey: '123456', // Add the API key for your OpenTok project here.
  sessionId: '1_MX40NzIwMzJ-fjE1MDElGQkJJfn4', // Add a test session ID for that project
  token: 'T1==cGFydG5lcXN0PQ==' // Add a token for that session here
}
const options = {audioOnly: true};
const otNetworkTest = new NetworkTest(OT, sessionInfo, options);

otNetworkTest.testQuality(function updateCallback(stats) {
  const currentStats = stats[stats.length - 1];
  console.log('testQuality stats', currentStats);
}).then((results) => {
  console.log('OpenTok quality results', results);
}).catch((error) => {
  console.log('OpenTok quality test error', error);
});

This code uses Promises returned by the OTNetworkTest.testConnectivity() and OTNetworkTest.testQuality() methods. Alternatively, you can pass completion handler functions into each of these methods.

See the following section for details on using the test results.

See the /sample subdirectory (and the /sample/README.md file) for a sample app.

Supported browsers

The OTNetworkTest.testConnectivity() method is supported in Chrome, Firefox, Safari, Opera, and Edge.

The OTNetworkTest.testQuality() method is supported in Chrome, Safari, Opera, and Chromium-based versions of Edge (versions 79+). It is not supported in Firefox and non-Chromium-based versions of Edge.

Update: Firefox has been removed from the list of supported browsers for the testQuality feature since version 2.6.0 due to missing some important statistics. This could lead to inaccurate results.

API reference

The OTNetworkTest NPM module includes three public methods:

  • The OTNetworkTest() constructor method

  • The OTNetworkTest.testConnectivity() method

  • The OTNetworkTest.testQuality() method

Note: Some API changes were introduced in v2. See the releases page for details.

OTNetworkTest() constructor

The OTNetworkTest() constructor includes the following parameters:

  • ot -- A reference to the OpenTok.js OT object. You must load OpenTok.js into the web page and pass the OpenTok.js OT into the OTNetworkTest() constructor.

    Note that you may load OpenTok.js from the opentok.com server (https://static.opentok.com/v2/js/opentok.js) or via NPM (https://www.npmjs.com/package/@opentok/client). Or if your OpenTok project uses the enterprise environment, you will load OpenTok.js from the enterprise URL.

    Passing the OT object into the OTNetworkTest() constructor ensures that the tests will use the same version of OpenTok and the same OpenTok environment that will be used by the main OpenTok session in your application.

  • sessionInfo -- An object containing the following:

    • apiKey -- The API key corresponding to the OpenTok project the app uses.

    • sessionId -- A test session ID. This must be an ID for a different session than the one that your application will be used for communication. Generate a unique session ID for each client. This session ID is used for the network test, and it must be different than the session ID used for communication in the app. The test session must be a routed session -- one that uses the OpenTok Media Router.

      To test connectivity in a specific region, specify a location hint when creating the test session.

    • token -- A token corresponding to the test session. The role of the token must be either publisher or moderator.

      The sessionInfo parameter is required.

  • options --The options parameter is an object containing the following properties, each of which are optional:

    • audioOnly (Boolean) -- Set this property to true to run audio-only tests.

    When this option is set to false (the default), the quality test will try to run an audio-video quality test (using both the camera and microphone). If there is no camera available, or if the results of the audio-video test do not support adequate audio quality, the test continues in audio-only mode.

    Setting the audioOnly to true will reduce the time of the quality test on systems that have both a microphone and camera attached (since the audio-only test is shorter than the audio-video test).

    • timeout (Number) -- Set this property to the maximum duration of the testQuality() test, in milliseconds. Set this to a value greater than 5000 (5 seconds) but less than 30000 (30 seconds). (Values outside of this range are ignored.) If you do not set this value, the testQuality() test will run for approximately 30 seconds for an audio-video test or for 10 seconds for an audio-only test.

      The timeout period begins when the quality test starts publishing (after the user grants access to the camera and microphone).

      Setting a lower timeout duration may result in less accurate results, including MOS ratings.

    • audioSource (String) -- The ID of the audio input device (such as a microphone) to be used by the test publisher. You can obtain a list of available devices, including audio input devices, by calling the OT.getDevices() method.

      You may want to set this to have the OpenTok Network Test use the same device that will be used in the real OpenTok session. This way, the test prompts the end user to grant permission to the correct device. Note that changing the audio device may not influence the quality test score.

    • videoSource (String) -- The ID of the video input device (such as a camera) to be used by the test publisher. You can obtain a list of available devices, including audio input devices, by calling the OT.getDevices() method.

      You may want to set this to have the OpenTok Network Test use the same device that will be used in the real OpenTok session. This way, the test prompts the end user to grant permission to the correct device. Note that changing the video device may not influence the quality test score.

    • initSessionOptions (Object) -- An object that includes optional options for initializing the session (Session Options). This object includes the following properties:

      • ipWhitelist (Boolean) -- This is available as an add-on feature for enterprise accounts. Set this to true if IP white listing is enabled for your project. The default value is false.
      • iceConfig (Object) -- This feature is part of the configurable TURN add-on feature.
    • proxyServerUrl (String) -- (Optional) Set this to the proxy server URL you use in the OpenTok client SDKs (for example, when calling OT.setProxyUrl() in OpenTok.js). For more information, please check the IP Proxy Documentation.

    • scalableVideo (Boolean) -- (Optional) Whether to use scalable video (true) or not (false, the default). Disabling scalable video was added in OpenTok.js version 2.24.7.

    • fullHd (Boolean) -- (Optional) Allows publishing with a resolution of 1920x1080 (1080p). If the camera does not support 1920x1080 resolution, the OTNetworkTest.testConnectivity() method is rejected with an UNSUPPORTED_RESOLUTION_ERROR error. We highly recommend set scalableVideo setting to true when testing full HD resolution. Without scalableVideo, the client may not reach full HD resolution during the test period.

    The options parameter is optional.

The constructor throws an Error object with a message property and a name property. The message property describes the error. You should check the name property to determine the type of error. The name property will be set to one of the values defined as properties of the ErrorNames object (see ErrorNames). For example:

try {
  const otNetworkTest = new NetworkTest(OT, sessionInfo);
} catch (error) {
  switch (error.name) {
    case ErrorNames.MISSING_OPENTOK_INSTANCE:
      console.error('Missing OT instance in constructor.');
      break;
    case ErrorNames.INCOMPLETE_SESSON_CREDENTIALS:
    case ErrorNames.MISSING_SESSON_CREDENTIALS:
    case ErrorNames.INVALID_SESSON_CREDENTIALS:
      console.error('Missing or invalid OpenTok session credentials.');
      break;
    default:
      console.error('Unknown error .');
  }
}

OTNetworkTest.testConnectivity()

This method checks to see if the client can connect to OpenTok servers. The method returns a Promise that is resolved when the connectivity check completes. The promise is resolved with a results object that has the following two properties:

  • success (Boolean) -- true if connectivity to OpenTok servers succeeded; false if any connectivity test failed.

  • failedTests (Array) -- If connectivity failed, this array contains an object for each failure type. The object has two properties, type and errors:

    • type -- A sting defining the failure type. It will be set to one of the following values:

      • 'api' -- The test could not connect to the OpenTok API server. Connection to this server is required to connect to an OpenTok session.

      • 'messaging' -- The test could not establish a connection to the OpenTok messaging WebSocket. This connection is required to connect to an OpenTok session. In addition to other causes for WebSocket connectivity failures, this failure type will occur if you pass an invalid OpenTok API key, session ID, or token into the OTNetworkTest() constructor.

      • 'media' -- The test could not connect to the OpenTok Media Router. If your app uses a routed session, it will not succeed in using OpenTok. However, if your app uses a relayed session, the client may still succeed in using the OpenTok session, although it may fail if the relayed session requires use of a TURN server.

      • 'logging' -- The test could not connect to the OpenTok logging server. The OpenTok.js library periodically logs data (such as video and audio quality) to this server. The client can still connect to an OpenTok session, however TokBox will not collect data that may help you debug issues with the session, using tools like OpenTok Inspector.

    • error -- An object defining the reason for the type of failure. This object includes a message property and a name property. The message property describes the error. You should check the name property to determine the type of error. The name property will be set to one of the values defined as properties of the ErrorNames object (see ErrorNames):

      For example:

      otNetworkTest.testConnectivity(function(results) {
        results.failedTests && results.failedTests.forEach(result) => {
          switch (failedTest.error.name) {
            case ErrorNames.FAILED_TO_OBTAIN_MEDIA_DEVICES:
            // Display UI message about granting access to the microphone and camera
              break;
            case ErrorNames.NO_AUDIO_CAPTURE_DEVICES:
            case ErrorNames.NO_VIDEO_CAPTURE_DEVICES:
              // Display UI message about no available camera or microphone
              break;
            // Handle other errors, as needed
            default:
              console.error('Unknown error .');
          }
        }
      });

    If all connectivity tests succeed, the failedTests property is undefined.

OTNetworkTest.testQuality(updateCallback)

This function runs a test publisher (using the API key, session ID and token provided in the constructor). Based on the measured video bitrate, audio bitrate, and the audio packet loss for the published stream, it provides the following results:

  • Whether audio and video are supported and a reason why they aren't supported (if they aren't).

  • The MOS estimate (from 0 - 4.5) for the the audio and video published by the client.

  • Statistics for the test, including bitrate and packet loss ratio (for both audio and video), as well as the video packet loss ratio.

  • The recommended supported publisher settings. These settings include the recommended video frame rate and resolution for a stream published by the client. Or, if the stats do not support video, the results indicate whether an audio-only published is recommended or not, based on the measured audio bitrate and packet loss.

This method takes one parameter: updateCallback. The method returns a Promise.

updateCallback

The updateCallback function is called periodically during the test (at a 1-second test interval).

The object passed into the updateCallback function includes statistics about the audio and video in the test stream. The object has the following data:

{
  audio: {
    timestamp: 1509747314,
    bytesSent:534349,// The total number of video bytes received, cumulative
    bytesReceived: 434349, // The total number of audio bytes received, cumulative
    packetsReceived: 24234,  // The total number of audio packets received, cumulative
    packetsLost: 0   // The total number of audio packets lost, cumulative
  },
  video: {
    timestamp: 1509747314,
    bytesReceived: 434349, // The total number of video bytes received, cumulative
    bytesSent:434349, // The total number of video bytes sent
    frameRate: 15,   // The video frame rate
    packetsReceived: 24234,  // The total number of video packets received, cumulative
    packetsLost: 0   // The total number of video packets lost, cumulative
  },
  timestamp: 1512679143897, // The timestamp of the sample
  phase: 'audio-video' // Either 'audio-video' or 'audio-only'
}

The phase property is set to 'audio-video' during the initial audio-video test. If a secondary audio-only test is required (because audio quality was not acceptable during the audio-video test), the property is set to 'audio-only'.

Pass in a null value if you do not want to register an updateCallback function.

Update: We advise using 'bytesSent' to provide a more accurate result, especially if scalable video is enabled for the API key

Promise returned

The Promise returned by the OTNetworkTest.testQuality() method is resolved when the connectivity check completes. The promise is resolved with a results object that has the following properties:

  • video (Object) -- Contains the following properties:

    • supported (Boolean) -- Whether the results indicate that video is supported.

    • recommendedFrameRate (Number) -- The recommended video frame rate. However, if video is unsupported, this is set to null. If the the test ran in audio-only mode (for example, because no camera was found), this property is undefined.

    • recommendedResolution (String) -- The recommended video resolution. This will be set to '1280x720', '640x480', or '320x240'. However, if video is unsupported, this is set to null. If the the test ran in audio-only mode (for example, because no camera was found), this property is undefined.

    • reason (String) -- A string describing the reason for an unsupported video recommendation. For example, 'No camera was found.'

    • qualityLimitationReason (String) -- Indicates the reason behind the highest resolution tested failing. It can have values: 'cpu' for CPU overload, 'bandwidth' for insufficient network bandwidth, or value is null if there is no limitation.

    • bitrate (Number) -- The average number of video bits per second during the last five seconds of the test. If the the test ran in audio-only mode (for example, because no camera was found), this property is undefined.

    • frameRate (Number) -- The average number of frames per second during the last five seconds of the test. Note that this is different than the recommendedFrameRate. The frameRate value is the actual frame rate observed during the test, and the recommendedFrameRate is the recommended frame rate. If the the test ran in audio-only mode (for example, because no camera was found), this property is undefined.

    • packetLossRatio (Number) -- The audio packet loss ratio during the last five seconds of the test. If the the test ran in audio-only mode (for example, because no camera was found), this property is undefined.

    • mos (Number) -- The MOS estimate for the test video quality. This will be in a range from 1 to 4.5. See MOS estimates below for more information.

  • audio (Object) -- Contains the following properties:

    • supported (Boolean) -- Whether audio will be supported (true) or not (false).

    • reason (String) -- A string describing the reason for an unsupported audio recommendation. For example, 'No microphone was found.'

    • bitrate (Number) -- The average number of audio bits per second during the last five seconds of the test.

    • packetLossRatio (Number) -- The video packet loss ratio during the last five seconds of the test.

    • mos (Number) -- The MOS estimate for the test audio quality. This will be in a range from 1 to 4.5. See MOS estimates below for more information.

results is undefined if there was an error in running the tests (and the error parameter is unset).

Important: v1 included a results.mos property (an overall MOS rating for the test). This was removed in v2 and replaced with results.audio.mos and results.video.mos properties.

The results, including the MOS estimates and the recommended video resolution and frame rate are subjective. You can adjust the values used in the source code, or you can use the data passed into the updateCallback() function and apply your own quality analysis algorithm.

The Promise returned by the OTNetworkTest.testQuality() method is rejected when the connectivity check encounters an error. The promise is reject with an error object that has two properties: a message property and a name property. The message property describes the error. You should check the name property to determine the type of error. The name property will be set to one of the values defined as properties of the ErrorNames object (see Error.name values).

otNetworkTest.testQuality(null, function updateCallback() {
  // process intermediate results
}).then((results) => {
  // Display UI based on results
}).catch((error) => {
    switch (error.name) {
      case ErrorNames.UNSUPPORTED_BROWSER:
        // Display UI message about unsupported browser
        break;
      case ErrorNames.CONNECT_TO_SESSION_NETWORK_ERROR:
        // Display UI message about network error
        break;
      case ErrorNames.FAILED_TO_OBTAIN_MEDIA_DEVICES:
        // Display UI message about granting access to the microphone and camera
        break;
      case ErrorNames.NO_AUDIO_CAPTURE_DEVICES:
      case ErrorNames.NO_VIDEO_CAPTURE_DEVICES:
        // Display UI message about no available camera or microphone
        break;
      default:
        console.error('Unknown error .');
    }
});

OTNetworkTest.stop()

Stops the testConnectivity() test if it is running. The test will not stop until it has been running for at least 5 seconds (after the user has granted access to the camera and microphone). While you can call stop() prior to this, results will not be returned until the 5-second mark.

ErrorNames

The ErrorNames object includes properties that enumerate values used in the name property of OTNetworkTest error objects. You should check the name property of an error object (against the values defined in ErrorNames) to determine the type of error.

Errors thrown by the OTNetworkTest() constructor

Error.name property set
to this property of
ErrorNames ...
Description
MISSING_OPENTOK_INSTANCE An instance of OT, the OpenTok.js client SDK, was not passed into the constructor.
INCOMPLETE_SESSON_CREDENTIALS The sessionInfo object passed into the constructor did not include an apiKey, sessionId, or token object.
MISSING_SESSON_CREDENTIALS No sessionInfo object was passed into the constructor.

testConnectivity() errors

The testConnectivity() returns a JavaScript promise that succeeds with a results object. The results object contains a failedTests array, and each element of this array (if there are any elements) has an error property, which is error object has a name property set to one of the following:

Error.name property set to this property
of ErrorNames ...
Description
API_CONNECTIVITY_ERROR The test failed to connect to OpenTOK API Server.
CONNECT_TO_SESSION_ERROR The test failed to connect to the test OpenTok session due to a network error.
CONNECT_TO_SESSION_TOKEN_ERROR The test failed to connect to the test OpenTok session due to an invalid token.
CONNECT_TO_SESSION_ID_ERROR The test failed to connect to the test OpenTok session due to an invalid session ID.
CONNECT_TO_SESSION_NETWORK_ERROR The test failed to connect to the test OpenTok session due to a network error.
FAILED_TO_OBTAIN_MEDIA_DEVICES The test failed to obtain media devices (a camera or microphone).
NO_AUDIO_CAPTURE_DEVICES The browser cannot access a microphone.
NO_VIDEO_CAPTURE_DEVICES The browser cannot access a camera.
PUBLISH_TO_SESSION_ERROR Encountered an unknown error while attempting to publish to a session.
FAILED_MESSAGING_SERVER_TEST The test failed to connect to media server due to messaging server connection failure.
FAILED_TO_CREATE_LOCAL_PUBLISHER The test failed to create a local publisher object.
PUBLISH_TO_SESSION_NOT_CONNECTED The test failed to publish to the test session because the client was not connected to the session.
PUBLISH_TO_SESSION_PERMISSION_OR_TIMEOUT_ERROR The test failed to publish to the test session due a permissions error or timeout.
PUBLISH_TO_SESSION_NETWORK_ERROR The test failed to publish to the test session due a network error.
SUBSCRIBE_TO_SESSION_ERROR The test encountered an unknown error while attempting to subscribe to a test stream.
LOGGING_SERVER_CONNECTION_ERROR The test failed to connect to the OpenTok logging server.

testQuality() errors

If the promised returned by the testQuality() is rejected, the error passed into the .catch() method has a name property set to one of the following:

Error.name property set to this
property of ErrorNames ...
Description
INVALID_ON_UPDATE_CALLBACK The updateCallback parameter is invalid. It must be a function that accepts a single parameter.
UNSUPPORTED_BROWSER The test is running on an unsupported browser (see Supported browsers).
CONNECT_TO_SESSION_ERROR The test failed to connect to the test OpenTok session due to a network error.
CONNECT_TO_SESSION_TOKEN_ERROR The test failed to connect to the test OpenTok session due to an invalid token.
CONNECT_TO_SESSION_ID_ERROR The test failed to connect to the test OpenTok session due to an invalid session ID.
CONNECT_TO_SESSION_NETWORK_ERROR The test failed to connect to the test OpenTok session due to a network error.
FAILED_TO_OBTAIN_MEDIA_DEVICES The test failed to obtain media devices (a camera or microphone).
NO_AUDIO_CAPTURE_DEVICES The browser cannot access a microphone.
NO_VIDEO_CAPTURE_DEVICES The browser cannot access a camera.
PUBLISH_TO_SESSION_ERROR The test encountered an unknown error while attempting to publish to a session.
INIT_PUBLISHER_ERROR The test failed to initialize a publisher.
PUBLISH_TO_SESSION_NOT_CONNECTED The test failed to publish to the test session because the client was not connected to the session.
PUBLISH_TO_SESSION_PERMISSION_OR_TIMEOUT_ERROR The test failed to publish to the test session due a permissions error or timeout.
SUBSCRIBE_TO_SESSION_ERROR The test encountered an unknown error while attempting to subscribe to a test stream.
SUBSCRIBER_GET_STATS_ERROR The test failed to get audio and video statistics for the test stream.

Errors thrown by the OTNetworkTest.checkCameraSupport() method

Error.name property set
to this property of
ErrorNames ...
Description
PERMISSION_DENIED_ERROR The user denied access to the camera.
UNSUPPORTED_RESOLUTION_ERROR The camera does not support the requested resolution.

MOS estimates

The testQuality() results include MOS estimates for video (if supported) and audio (if supported).

A MOS estimate is a rating of audio or video quality. In subjective scoring, a user is asked to rate quality from 1 (bad) to 5 (excellent). This module uses an objective test, calculating the MOS value based on bitrate, packet loss ratio, and (for video) resolution. For example, the audio MOS calculation is based on the ITU G.107 specification. These algorithms limit the range of scores from 1.0 to 4.5.

MOS value Meaning
3.8 - 4.5 Excellent
3.1 - 3.79 Good
2.4 - 3.09 Fair
1.7 - 2.39 Poor
1.0 - 1.69 Bad

Note: The audio MOS estimate is less accurate when using OpenTok.js version 2.17.5 or lower or on Chrome version 57 or lower, because the OpenTok Network Test cannot access the round-trip time for audio, which is factored into the MOS calculation.

Building the module

To build the module:

$ npm install
$ npm run build

Sample app

See the /sample subdirectory (and the /sample/README.md file) for a sample app.

opentok-network-test-js's People

Contributors

adrice727 avatar behaze avatar dependabot[bot] avatar devsumanmdn avatar dmitryshur avatar jeffswartz avatar kueckelheim avatar mend-for-github-com[bot] avatar michaeljolley avatar miksansegundo avatar msach22 avatar rhainer avatar sailuvejella avatar saraband avatar sebakerckhof avatar vona-ben avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opentok-network-test-js's Issues

Safari 13 OTNetworkTest.testConnectivity

I got two following errors when testConnectivity method is called:
first:

message: "Encountered an unknown error while attempting to subscribe to a session."
name: "SubscribeToSessionError"

second:

OT_TIMEOUT: Unable to subscribe to stream in a reasonable amount of time

environment:

  • OSX 10.14.6
  • Safari 13.0.1 (12.X same result)

package.json:

"opentok-network-test-js": "^2.0.2"
"@opentok/client": "^2.16.3"

code:

var networkTest = new NetworkTest(OT, {
    apiKey: API_KEY,
    sessionId: SESSION_ID,
    token: TOKEN
}

networkTest.testConnectivity()
    .then(results => {
         console.log(results);
    });

Same code works fine on Google Chrome and Firefox. There is some extra code what I need to write? Or maybe I do somethink wrong. Code was tested via http and https - on both same errors.

I copied code from:
https://github.com/opentok/opentok-network-test-js/blob/master/README.md

No camera was found error message return by testQuality method on Safari

With

  • @opentok/client : 2.14.7
  • opentok-network-test-js: 2.0.0

On Safari 11.1, the testQuality method returns that the video is not supported:

audio: {bitrate: 40028.727913688315, packetLossRatio: 0, supported: true, mos: 4.429667135200001}
video: {supported: false, reason: "No camera was found.", mos: 1}

Of course, I allowed the browser to use the camera.
But when I publish the stream, the camera is used successfully:

screen shot 2018-09-11 at 11 53 14

On others browsers (Firefox, Chrome), I don't have this problem.

Installation for my .NET project.

Hey everyone,

Sorry if this is obvious or if I'm just missing something, I'm a little new to this. I'm having trouble installing this for my .NET application. I'm using tokbox and this seems to be the only resource that they point to that helps us create a Precall test application for my clients. I'm stuck at the installation part because I've read that .NET typically uses NuGet packages instead of npm. Any tips on how to use this library in my javascript files?

Thanks!

ScreenSharingCapabilityResponse definition file is not updated to the OT library

Hi,

if I try to use NetworkTest library with the latest OT library, I get an error on Typescript definition.

Network Test d.ts file:

export interface ScreenSharingCapabilityResponse {
extensionInstalled: boolean;
supported: boolean;
supportedSources: {
application: boolean;
screen: boolean;
window: boolean;
};
extensionRegistered?: string;
}

The extensionInstalled value is mandatory in the NetworkTest library but it's not in the @opentok/client library.

networktest.testQuality() -- Unable to Publish (1500) msg: ICEWorkflow (Safari desktop)

On Safari desktop (13.1.1), we're frequently experiencing the error below while calling the testQuality() function of Network Test.

image

We call testQuality(), but it sits waiting and later fails and returns this error.

Our code is below:

 const testaroo = new NetworkTest(OT, conf, { audioOnly })
  const qualityStats = []
  const statsToCollect = 10
  let iteration = 0

  const qualityResults = await testaroo.testQuality(stats => {
    iteration += 1
    onProgress({ wat: 'stats', iteration, statsToCollect, data: stats })
    qualityStats.push(stats)

    if (qualityStats.length === statsToCollect) {
      testaroo.stop()
      return
    }
  }).catch(err => {
    console.log('OT network test error', err)
    testaroo.stop()
  })

Connectivity Test Question (Probable bug)

if (errorHasName(error, OTErrorType.NOT_CONNECTED)) {

catches NOT_CONNECTED (error code: 1010) and UNABLE_TO_PUBLISH (error code: 1500) and every other exception as PublishToSessionError
Documentation of opentok's publish method tells us that this call can throw Connection Failed (error code: 1013) and 1500.

Based on the documentation that call will never throw 1010 which will be represented as PublishToSessionNotConnectedError but it will do a 1013 which will be represented as PublishToSessionError

Continue test when unable to publish - Connectivity

It would be good that if the user does not have a camera connected or camera is unavailable that the test continues to and tests 'subscribing only' connectivity. This is a real scenario we encounter regularly (computers in hospitals, corporate computers with no cams). We allow users to subscribe to other users and connect then via SIP for two way audio communication.

Test duration and abort feature

Hi, I'm looking for two features that would help me a lot:

  1. Ability to set duration for the test. I realise that the longer it runs the more reliable the results but 30 seconds is a long time. A nice approach would be to set getStatsVideoAndAudioTestDuration or something like it from the init method:
const otNetworkTest = new OTNetworkTest(OT, {
      apiKey: apiKey,
      sessionId: precallSessionId,
      token: precallToken,
      testDuration: myDuration,
    });
  1. Ability to abort the test, closing everything down nicely, without having to navigate away. As it is now, in our spa application it just goes on behind the scene which is ofc not optimal. I suggest something simple like:
otNetworkTest.Cancel();

Hope this finds it's way into your very nice module.
Thanks

/Hannes

Quality tests does not work on computers that have two cameras

Hello we are using opentok v2.17.0 and opentok-network-test-js v2.1.0 in my company in order to build a visio application and I am currently having an issue running the quality tests on specific computers.

Here is the error fired by OT.testQuality:
error: { name: "InitPublisherError" stack: "Error: The selected voice or video devices are unavailable. Verify that the chosen devices are not in use by another application. (getUserMedia error: NotReadableError) [......] message: "The selected voice or video devices are unavailable. Verify that the chosen devices are not in use by another application. (getUserMedia error: NotReadableError)" }

After debugging the issue, it occurs that it may be related to the way you handle multiple cameras during the network quality tests. Indeed, this error appears only on windows computers that have two cameras in their system configuration.

I tried the opentok demo (with their network quality test) on theses computers and it works well. In addition, if I bypass the results of the quality tests I am able to launch a visio call without any problem in my application.

Note that, in my app, I require the users' permissions to access their microphone and camera before running the tests. Here are the results of OT.getDevices:
devices: [ {deviceId: "default", label: "", kind: "audioInput"}, {deviceId: "communications", label: "", kind: "audioInput"}, {deviceId: "2d16e5d86f1ed75a45e3a2570d70cf25a954a1f8ae2fe7d65e87175f59f0bfca", label: "", kind: "audioInput"}, {deviceId: "ba4178310f59bb90cc7c2ea75abed80aabb0d1c34b2e471db07c60b42a5ae803", label: "", kind: "videoInput"}, {deviceId: "8b19f13b5b06b798476a4634ab0734c35086daa5da5a3dcf943bd3a4283edce3", label: "", kind: "videoInput"} ]
also OT.getUserMedia does not fire any error and the permissions are allowed.

Do you have any idea of what is causing this issue?

How to use this with AngularJS and Webpack

I'm sure this is me being a chump, but I am using it the way described in the readme:

const OTNetworkTest = require('opentok-network-test-js');

const otNetworkTest = new OTNetworkTest(OT, {
            apiKey: roomData.apiKey, // Add the API key for your OpenTok project here.
            sessionId: roomData.sessionId, // Add a test session ID for that project
            token: roomData.token // Add a token for that session here
          });

But I get this error. I have tried every combination I can think of.

angular.js:13920 TypeError: OTNetworkTest is not a constructor

Thanks,
Simon

Timeout value is not evaluated in testQuality and AudioOnly

Hi,

There is a bug when you set a custom timeout in the OTNetworkTest() constructor for an audio-only test. The user can set a value between 10s and 30s, but the code will always take 10s (because testTimeout for audio-only is 10s).

testTimeout = Math.min(testTimeout, options.timeout, 30000);

Steps to reproduce:

var options = { audioOnly: true, timeout: 15000};
const otNetworkTest = new NetworkTest(OT, sessionInfo, options);
otNetworkTest.testQuality();

Usage with Angular

I'm using the library to do some network tests but I'm noticing that the library isn't using native Promise which will be a problem in an Angular app.

Without using native Promise, I couldn't opt out of Angular Zone and it makes the app unusable due to detectChanges has been called a lot when running network testing.

I have a PR for the issue.

ReferenceError: window is not defined

Followed the readme, installed using NPM, importing using ES6 in react and i get window not defined when i try to instantiate NetworkTest.

What am i missing?

QualityTest never resolves (10-15% of the tests)

We have been using this package "opentok-network-test-js" in production for about half a year now.

A few months ago we got some reports that the network tests were never finishing.

Our initial assumption (based on the code we wrote around error handling) was that the .testConnectivity() part was working as expected

The prime suspect was the testQuality and that the promise was never resolving.

We deployed the following fix in production to monitor the situation

 const forceStopNetwork = () =>
            new Promise(
              (resolve, reject) =>
                (forceStopTimeout.current = setTimeout(
                  () => reject({name: KNOWN_QUALITY_ERRORS.TestTookTooLong}),
                  timeoutWithBufferForDelays
                ))
            );
          
Promise.race([otNetworkTest.current.testQuality(), forceStopNetwork()])

What this piece of code does is the following.

It races the quality test with another promise we have which has significantly higher expected resolution time than the whole timeout configured for the NetworkTest

If our promise fails before the quality test resolves then we throw an error

We expected to see a few incidents here and there but after monitoring the issue for about a week we noticed the following results

UnsupportedBrowser | 2020-07-01 | 2 |  
TestTookTooLong | 2020-07-01 | 128 | <--- these are the cases our new error handling caught (the name of the error is ours)
InitPublisherError | 2020-07-01 | 85 |  
acceptable | 2020-07-01 | 106 |  
poor | 2020-07-01 | 165 |  
excellent | 2020-07-01 | 334

Even though we are currently working around the issue the number of occurrences is alarming.

Do you have any similar reports?

Any suggestions on how we should proceed with this?

Issue with npm package

Hey there, I was excited to find this package and use it to help out with testing network quality for an opentok implementation. However, I am having issues importing the package into our React project.

I noticed that the current package that is installed via npm install opentok-network-test-js, the distribution does not appear to be in working condition. My project's webpack fails to build due to missing packages in the opentok-network-test-js dist folder:
screen shot 2018-05-31 at 12 39 54 pm

Is there any other information I could provide that would be helpful? Thanks!

Q: How to get MOS state during the session?

We want to show a network-level indicator both publisher and each subscriber during the call.

Is it possible by using this package? If it is not, How can we know/calculate the publisher and each subscriber network-level according to result of getStats function?

Strange Connectivity and Quality Test Results

We are using the opentok-network-test-js
"@opentok/client": "^2.16.1", "opentok-network-test-js": "^2.0.2"

Each time the test shows different and unpredictable results that do not correspond to real network connection speed. For example, any speed test from the internet (https://www.speedtest.net for example) shows Download speed > 300 Mbps and Upload speed > 500 Mbps, but at the same time opentok-network-test-js or https://tokbox.com/developer/tools/precall/ shows errors like 'Video or Audio Unsupported, bandwidth too low'.
As a result, the test becomes a failed which is not true.
Сommunicating with Opentok support was useless
Tested from Australia, USA, Canada and Russia

opentok.js:42522 OpenTok:Subscriber:error

I get this error on every call of the testConnectivity method - version 2.0.0 chrome Mac OSX.

otNetworkTest.testConnectivity(results => {
  console.log('finish');      
});

opentok.js:42522 OpenTok:Subscriber:error
Invalid state transition: Event 'disconnect' not possible in state 'disconnected' +0ms

Any ideas?

How to use in Ionic 3+

I request your help for how to use opentok-network-test-js in Ionic 3+. I tried with following code

import { Component, OnInit } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import NetworkTest from 'opentok-network-test-js';
import { TabsPage } from '../pages/tabs/tabs';
import { OT } from "opentok-network-test-js/dist/NetworkTest/types/opentok";

@Component({
  templateUrl: 'app.html'
})
export class MyApp implements OnInit {
  rootPage: any = TabsPage;
  otNetworkTest: NetworkTest;
  OT: OT.Client;

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
    platform.ready()
      .then(() => {
        // Okay, so the platform is ready and our plugins are available.
        // Here you can do any higher level native things you might need.
        statusBar.styleDefault();
        splashScreen.hide();
      })
      .then(() => {
        this.otNetworkTest = new NetworkTest(this.OT, {
          apiKey: 'XXXXXXXXXXXXXXXXXX',
          sessionId: 'XXXXXXXXXXXXXXXXXX',
          token: 'XXXXXXXXXXXXXXXXXX'
        });
      });
  }

  ngOnInit() {
    this.otNetworkTest.testConnectivity().then((results) => {
      console.log('OpenTok connectivity test results', results);
    }).catch(function (error) {
      console.log('OpenTok connectivity test error', error);
    });
  }
}

However, on running with npm start, I get the following run-time error. Can you please tell me how to get around this or if I need a Cordova plugin for this.

Error: An instance of OT, the OpenTok.js client SDK, is required.
    at t (http://localhost:8100/build/vendor.js:123248:14079)
    at new t (http://localhost:8100/build/vendor.js:123248:14238)
    at e.value (http://localhost:8100/build/vendor.js:123248:27375)
    at new e (http://localhost:8100/build/vendor.js:123248:27110)
    at new MyApp (http://localhost:8100/build/main.js:297:30)
    at createClass (http://localhost:8100/build/vendor.js:12859:20)
    at createDirectiveInstance (http://localhost:8100/build/vendor.js:12700:37)
    at createViewNodes (http://localhost:8100/build/vendor.js:14158:53)
    at createRootView (http://localhost:8100/build/vendor.js:14047:5)
    at callWithDebugContext (http://localhost:8100/build/vendor.js:15472:42)

Diagnostics Platform Information

Ionic Framework: 3.9.2
Ionic App Scripts: 3.2.0
Angular Core: 5.2.11
Angular Compiler CLI: 5.2.11
Node: 10.13.0
OS Platform: Windows 10
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36

Unpredictable Test results during Back-to-back tests

We are often seeing "NaN%" returned as a value for Video Packet Loss in multiple tests we have run recently. We are also seeing back-to-back tests deliver significantly different results on the same PC/Mac which is causing distrust in the validity of all tests.

Precall Results Summary 08:06:2020 15:12

Hardware Setup Results:
Video capture device successfully found.
Audio capture device successfully found.
Chrome is supported by OpenTok.
Connectivity Test Results:
Successfully connected to the OpenTok API server.
Successfully connected to the OpenTok Messaging WebSocket.
Successfully connected to the OpenTok logging server.
Quality Test Results:
Video unsupported: bandwidth is too low.
NaN% video packet loss
Video Bitrate: NaN kbps
Audio: Unsupported, bandwidth too low
0% audio packet loss
Audio Bitrate: 24 kbps
General Statistics:
Session ID: 1_MX40NTYwNDg5Mn5-MTU5MTYyNTQ2NzY3M35xYmZ1NzdiR1RTZXY2S0xBWnM3dVFPVlN-fg

Plan B SDP not supported anymore

This test is not working anymore for me since a few days, following Chrome dropping WebRTC Plan B. Could you possibly update the opentok dependency to have it working agin?

Best

Enable Safari for testQuality in isSupportedBrowser

I've been working with this very helpful library, and would love to be able to use the quality test on safari mobile and safari web. I found that adding Safari to the isSupportedBrowser array allows the quality test to run, as long as I am passing it credentials for a tokbox Safari project. Accuracy seems on par with other browsers (though MOS estimate seems inconsistent).

I think perhaps in the testQuality method we might be able to pass in an option for Safari compatible projects i.e. testQuality({isSafariProject: true}) and then add Safari to this list if that is true:

const supportedBrowsers = ['Chrome', 'Firefox', 'Internet Explorer'];

I could work on a PR for this, or perhaps you guys have already done this.

Opentok dependencies with vulnerabilities

$ npm audit fix --force
npm WARN using --force I sure hope you know what you are doing.
up to date in 8.685s
fixed 0 of 2 vulnerabilities in 42761 scanned packages
2 vulnerabilities required manual review and could not be updated

More info │ https://nodesecurity.io/advisories/880
opentok-network-test-js > opentok-solutions-logging > axios

opentok will update this dependency?

Insufficient flexibility in test options

In our use case (which I'm sure is common), we need to establish before the test whether the user is going to publish audio at all, and/or video at all, and if so show which device to use (front/rear camera, say). A user may be connecting just to observe the meeting without publishing anything.

In other words OT.getDevice is performed first by the calling application.

So imo the interface needs options testAudio, testVideo, audioDeviceId (use if testAudio) and videoDeviceId (use if testVideo).

It also needs to report to the calling application the open/close permission dialog events as well as the approve/deny events, so that the calling application can manage the UI appropriately.

I don't see a way to get the required user experience with the classes as presently defined. That's unfortunate, because I really don't think it should be a developer's business to fork and refactor them, but that seems to be the only option for us here.

Also the momentum towards the constraint-based mediaDevices.getUserMedia means that code relying on enumerating and selecting devices is obsolescent; at least as I understand the rather confusing portfolio of specifications.

Cannot find module 'fsevents'

Hi,

I work with Rails 5.2.0 and use Yarn for manage node_module.

When I run "rake assets:precompile" on linux environnement I have error :

Error: Cannot find module 'fsevents'

No problem on macOs.

Error come from file : node_modules/chokidar/lib
"Chokidar" It's a dependency of "Webpack".

Do you have a solution?
Or other solution for use "opentok-network-test-js" without "require" ?

Thnaks,

Setting Timeout Forces Audio-Only Quality Test

When using version 2.0.2, setting the timeout option in the NetworkTest constructor seems to always force the test into audio-only.

I can set audioOnly: false and an audio-video test will occur, but if I add the timeout: 20 option, an audio-only test occurs.

If this is a side-effect/expected behavior, and not a bug, it would be great to include this case in the README.

Progress bar

Is there any way to get the test progress? The time that it takes seems to be random. Also, in the updates received on testQuality I can't find a way to know how many are the steps and what steps are pending.

Any help would be much appreciated.

Report on user denying access to camera.

When the user denies access to the camera/mic, the reported error is: 'Failed to create a local publisher object'. This error object does not have a 'type' that corresponds to a publishing problem (OpenTok.js). As it is a common scenario that the user denies the camera (at least for our clients!), it would be good to have a more specific description and a new type so we can detect when the user has denied access and instruct them appropriately. Thanks.

Server side rendering fails

Using the opentok-network-test-js I faced a problem in server side rendering as it requires "window" to be imported with an ES6 statement.

a similar issue was opened and closed in 2018 (#92)

Would it be possible to avoid to use window on import in the package and only do it at runtime this way, it will only crash when trying to SSR a page containing the network test.

bundle.js not found

I've downloaded pre-test call and tried running.

it says /opentok-network-test-js/sample/bundle.js not found.

As a matter of fact, there is no bundle.js in the code that was downloaded from GitHub.

Can you please help?

Error while building the project

node_modules/opentok-network-test-js/dist/NetworkTest/errors/types.d.ts (22,28): In ambient enum declarations member initializer must be constant expression.

Misspelled Typings

It would be great if we could fix the SESSON_ typings to read SESSION_ 👍

Q : Why am I getting the error 'Bandwidth is too low' on iOS + Safari or Android + Samsung Browser ?

Hi everyone,

We use opentok video services and we have a connectivity test that used opentok-network-test-js. I don't know why but every time we call testConnectivity() function, we get an error 'Bandwidth is too low'. It is odd because on Android + Chrome mobile, we don't get this error.

I have test on https://tokbox.com/developer/tools/precall/ and there is no problem (I don't know if this page is using opentok-network-test).

Could you help me to understand what happens ?

Thank you.

Argument of type 'typeof OT' is not assignable to parameter of type 'Client'.

import { OT } from "opentok-network-test-js/dist/NetworkTest/types/opentok"; not working
import * as OT from "@opentok/client"; not working

new NetworkTest(OT, { // OT giving error Argument of type 'typeof OT' is not assignable to parameter of type 'Client'. how to resolve this im using this in angular
apiKey: apiKey,
sessionId: sessionId, // Add a test session ID for that project
token: token, // Add a token for that session here
});

testQuality() audio/video bitrate differs strongly depending on the browser

I tried to use OTNetworkTest.testQuality() method and it gave me two very different results depending on the browser I tried it on (Same code, same internet connection)

Here's the minimal code I used:

import NetworkTest from 'opentok-network-test-js'

// ...

const otNetworkTest = new NetworkTest(OT, {
  apiKey: 'API_KEY',
  sessionId: 'SESSION_ID',
  token: 'TOKEN',
})

console.error('RES', await otNetworkTest.testQuality())

On chrome (77.0.3865.120 64-bit)

The video bitrate was at 274,712

Screenshot 2019-10-22 at 18 10 49

On Opera

The video bitrate was at 274,712

The video bitrate was at 1,082,284

Screenshot 2019-10-22 at 18 14 13

That's basically a 4x difference
Both test were done on macOS Mojave 10.14.6

Always auto turn to audio-only in testQuality when reaching ending of the testing, bring error of result

OS: MacOS, Windows, iPadOS, iOS
Facing Issue Browsers: Chrome[83.0.4103.116], Edge(chromium)[85.0.545.0], Safari in iPadOS[14.0]
Working Browsers: Safari[13.1.1] in MacOS, Safari in iOS[13.5.1]
Dependency: opentok-network-test-js, version "2.3.0"
Potential bug: testQuality can not stop correctly

Hi,

I am try to work around with both sample webpack application and the Readme code snippet. I found when the timeout or stop() is trigged in testQuality, there is always a chance(3/5 or more) that only turn phase from audio-video to audio-only in testQuality stats. And then raise an alert Invalid state transition: Event 'disconnect' not possible in state 'disconnected' in the console.

The sample bundled javascript also came with the same result by showing the strange waves after the timeout. Then raise same alert Invalid state transition: Event 'disconnect' not possible in state 'disconnected' in the console.

Due to this bug, the result of testing quality will bring as an error result for both audio and video.

Is any help can provide with testQuality()?

Thank you.

Screen Shot 2020-08-04 at 12 29 45 AM

Screen Shot 2020-08-04 at 12 34 05 AM

Is testQuality is not supported for Opera?

Hello,

We are using this tool to precheck the quality of the call before our users call each other. We got a report that for Opera they get a message that the tool fails.

The code:

const otNetworkTest = new NetworkTest(OT, {
    apiKey: this.testApiKey,
    sessionId: this.testSessionId,
    token: this.testToken
}, {
    audioOnly: false,
    timeout: 30000
})

otNetworkTest.testConnectivity().then((connectionResults) => {
       otNetworkTest.testQuality((stats) => {

The message we can see is:

Error: Your current browser (Opera) does not support the audio-video quality test. Please run the test in a supported browser.

I did a quick test with Opera Version:70.0.3728.144 on Mac OS X.

Also the documentation states that Opera is supported.

Hopefully you can help or let us know why it is not working.

Thank you.

Allow to set audio/video device id that is used for testing

First of all - thanks for the great library.

I would like to propose a functionality that will allow setting audio and video device id that will be used during connectivity test. The reason is that sometimes participants happen to have more than one video/audio input devices installed in their system. Often (especially on Windows) happens that some of the devices are broken. We provide a device picker before the network test, where users can pick a working device and we would like to test using those picked devices.

I would be more than happy to implement this by myself and create PR. Looking forward to any guidance from the maintainers. My initial idea was to add second optional parameter (object with audioDeviceId and videoDeviceId optional string fields) to NetworkTest.testConnectivity() that will be passed down to testConectivity() -> checkPublishToSession -> checkCreateLocalPublisher. In checkCreateLocalPublisher i would validate if provided devices are part of availableDevices and use those ids as an audio/video source.

Constructor Error in Angular 2+

I'm using this import statement to instantiate an instance of the test object
import * as OT from '@opentok/client';
import NetworkTest, { ErrorNames } from 'opentok-network-test-js';

const otNetworkTest = new NetworkTest(OT, {
apiKey: '123456', // Add the API key for your OpenTok project here.
sessionId: '1_MX40NzIwMzJ-fjE1MDElGQkJJfn4', // Add a test session ID for that project
token: 'T1==cGFydG5lcXN0PQ==' // Add a token for that session here
});
And it throws:
error TS2345: Argument of type 'typeof OT' is not assignable to parameter of type 'Client'.
Type 'OT.Publisher' is not assignable to type 'Publisher'.
Types of property 'stream' are incompatible.
Type 'OT.Stream' is not assignable to type 'Stream'.
Types of property 'videoDimensions' are incompatible.
Types of property 'width' are incompatible.
Type 'string' is not assignable to type 'number'.

I tried almost everything and anything works

Chrome Android - Can't repeat test twice

Chrome on Android vs 87.0.4280.141

If I try to run a second quality test after the first has finished without restarting the browser I get this failure message. Seems it's not getting released properly:

The selected voice or video devices are unavailable. Verify that the chosen devices are not in use by another application. (getUserMedia error: NotReadableError)

Thanks,
Simon

Error for "npm run build" at building module locally for sample app

Hey guys,

"rm -rf dist && webpack --config webpack.config.js" is not working. The error states that "rm" is no valid command, but it should be. Full error message is:

22 verbose stack Error: command failed
22 verbose stack at ChildProcess. (C:\Users\ban7427\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\promise-spawn\index.js:69:27)
22 verbose stack at ChildProcess.emit (node:events:327:20)
22 verbose stack at maybeClose (node:internal/child_process:1048:16)
22 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5)
23 verbose pkgid [email protected]
24 verbose cwd D:\Basisordner\Uni_Doktor\Testing\node_modules\opentok-network-test-js
25 verbose Windows_NT 10.0.17134
26 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\ban7427\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "build"
27 verbose node v15.0.1
28 verbose npm v7.0.6
29 error code 1
30 error path D:\Basisordner\Uni_Doktor\Testing\node_modules\opentok-network-test-js
31 error command failed
32 error command C:\WINDOWS\system32\cmd.exe /d /s /c "rm -rf dist && webpack --config webpack.config.js"
33 verbose exit 1

My node version is: 15.0.1
npm: 7.0.6

I cloned the main directory (opentok-network-test-js) and ran "npm install". This took some time and yielded some warnings, but I got no errors. The warnings were:

npm WARN ERESOLVE overriding peer dependency
npm WARN Found: [email protected]
npm WARN node_modules/webpack
npm WARN dev webpack@"^4.12.0" from the root project
npm WARN 3 more (karma-webpack, terser-webpack-plugin, webpack-cli)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer webpack@"^1.0.0 || ^2.0.0 || ^3.0.0" from [email protected]
npm WARN node_modules/webpack-dev-middleware
npm WARN webpack-dev-middleware@"^1.12.0" from [email protected]
npm WARN node_modules/karma-webpack
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '0.10 || 0.12 || 4 || 5 || 6' },
npm WARN EBADENGINE current: { node: 'v15.0.1', npm: '7.0.6' }
npm WARN EBADENGINE }
npm WARN deprecated @types/[email protected]: Use the global Promise type instead.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

Do you have any suggestions, what I am doing wrong?

I also tried to run "npm install opentok-network-test-js", open the opentok-network-test-js directory inside these node_modules and ran "npm install" in there. Similar results.

I am thankful for any help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.