quickblox-javascript-sdk

JavaScript SDK of QuickBlox cloud backend platform

OTHER License

Downloads
9.1K
Stars
105
Committers
29

Bot releases are visible (Hide)

quickblox-javascript-sdk - 2.13.5

Published by over 3 years ago

Fixes

Fixed error with WebRTC signalling re-initialization
Added throwing "ChatNotConnectedError" if trying to send message via not connected connection

quickblox-javascript-sdk - 2.13.2

Published by almost 4 years ago

Fixes

Fixed condition when to call "on.sessionExpired" callback

quickblox-javascript-sdk - 2.13.1

Published by almost 4 years ago

Fixes

Fixed work of "ping" feature in Node environment

quickblox-javascript-sdk - 2.13.0

Published by almost 4 years ago

Added

Ability to migrate account if “accountKey” was passed

Fixes

Assign ondevicechange handler only if WebRTC is available

quickblox-javascript-sdk - 2.12.9

Published by about 4 years ago

Added

Ping functionality to QB.chat module

quickblox-javascript-sdk - 2.12.8

Published by about 4 years ago

Fixes

WebRTC module

  • Do not end a p2p group call if initiator hung up
  • Do not start waitingReconnectTimer if it was created previously
quickblox-javascript-sdk - 2.12.7

Published by almost 5 years ago

Fixes

WebRTC module

"onCallListener" was called several times with same session

quickblox-javascript-sdk - 2.12.6

Published by about 5 years ago

Ability to disable auto-reject if user already in call added.
To disable auto-reject in config set autoReject property to false(Default is true).
Example:

webrtc: {
    answerTimeInterval: 60,
    autoReject: false,
    incomingLimit: 1,
    dialingTimeInterval: 5,
    disconnectTimeInterval: 30
}
quickblox-javascript-sdk - 2.12.5

Published by sshaforenkoqb about 5 years ago

Dependencies updated;
Bugfix;

quickblox-javascript-sdk - 2.12.4

Published by sshaforenkoqb about 5 years ago

Bug with integration with node.js fixed;

quickblox-javascript-sdk - 2.12.3

Published by sshaforenkoqb about 5 years ago

Dependencies updated:
"lodash": ">=4.17.13",
"lodash.template": ">=4.5.0",
"handlebars": ">=4.1.0",
"js-yaml": ">=3.13.1",
"marked": "^0.6.0",
"ws": ">=3.3.1",
"node.extend": ">=1.1.7",
"cached-path-relative": ">=1.0.2",
"karma": "^4.2.0"

quickblox-javascript-sdk - 2.12.2

Published by sshaforenkoqb almost 6 years ago

An issue with video calls in Safari 11 fixed.

quickblox-javascript-sdk - 2.12.1

Published by AndriiPovelychenko almost 6 years ago

  • Fix of security vulnerabilities in dependencies
quickblox-javascript-sdk - 2.12.0

Published by dimaspirit over 6 years ago

Removed:

  • Remove unused samples (users, roster). All cases will be shown at chat, data, webrtc samples;
  • The window.navigator.onLine check was remove (the check was move to the WebRTC Sample); To make sure that a client has internet connecteion before make a call;

Fixed:

  • during the call (WebRTC session) the WebRTC Sample will be able to switch to other camera, if it is possible and would stop call if all media devices were unplugged;
  • bugs were fixed when user doesn't allow permanent permissions for getUserMedia;

Added:

  • Ability to restore connect to chat by time interval after disconnect, if it wasn't voluntary (Added for node-xmpp-client and nativescript-xmpp-client, updated for Strophe.js client).
    Add a property chatReconnectionTimeInterval to config, by default is 5 sec;
    QB.chat.disconnect() stops reconnection actions;
  • The call of QB.chat.connect(params, callback) when chat is in connecting state (the connection one by one) was blocked, the callback funtion will return an error ('Status.REJECT - The connection is still in the Status.CONNECTING state');
  • QB.webrtc.onDevicesChangeListener() was added - the listener that is called when a media device has been plugged or unplugged;
  • An ability to change audio and video tracks was added (switch cameras), use the method webRTCSession.switchMediaTracks(deviceIds, cb).
    Supported and tested on Firefox from v.60.

Here is code snippet how to replace audio/video tracks:

var switchMediaTracksBtn = document.getElementById('confirmSwitchMediaTracks');

var webRTCSession = QB.webrtc.createNewSession(params);

QB.webrtc.getMediaDevices('videoinput').then(function(devices) {
    var selectVideoInput = document.createElement('select'),
        selectVideoInput.id = 'videoInput',
        someDocumentElement.appendChild(selectVideoInput);

    if (devices.length > 1) {
        for (var i = 0; i !== devices.length; ++i) {
            var device = devices[i],
                option = document.createElement('option');

            if (device.kind === 'videoinput') {
                option.value = device.deviceId;
                option.text = device.label;
                selectVideoInput.appendChild(option);
            }
        }
    }
}).catch(function(error) {
    console.error(error);
});

QB.webrtc.getMediaDevices('audioinput').then(function(devices) {
    var selectAudioInput = document.createElement('select'),
        selectAudioInput.id = 'audioInput',
        someDocumentElement.appendChild(selectAudioInput);

    if (devices.length > 1) {
        for (var i = 0; i !== devices.length; ++i) {
            var device = devices[i],
                option = document.createElement('option');

            if (device.kind === 'audioinput') {
                option.value = device.deviceId;
                option.text = device.label;
                selectAudioInput.appendChild(option);
            }
        }
    }
}).catch(function(error) {
    console.error(error);
});

switchMediaTracksBtn.onclick = function(event) {
    var audioDeviceId = document.getElementById('audioInput').value || undefined,
        videoDeviceId = document.getElementById('videoInput').value || undefined,
        deviceIds = {
            audio: audioDeviceId,
            video: videoDeviceId,
        };

    var callback = function(error, stream) {
            if (err) {
                console.error(error);
            } else {
                console.log(stream);
            }
         };

    // Switch media tracks in audio/video HTML's element (the local stream)
    // replace media tracks in peers (will change media tracks for each user in WebRTC session)
    webRTCSession.switchMediaTracks(deviceIds, callback);
}
quickblox-javascript-sdk - 2.11.0

Published by dimaspirit over 6 years ago

New:

  • Add header 'QB-OS' in all API requests for improving analytics;

Updated:

  • Encode body of all API requests;
    Encode based on this https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters;

  • Rework muc.join method:

    • Rework putting parameters of the muc.join method. Now could pass jid or id of a dialog;
    • Now uses Node.js callbacks approach instead of a returned stanza if you pass 2 arguments to the callback function. If you pass 1 arguments you will get stanza element as before;
QB.chat.muc.join(dialogId, function(error, response) {
   if(error) {
      console.log('Error is null when all is Ok');
  }

  console.log(`response.dialogId` is always contains in response);
});
  • QB.webrtc.onCallStatsReport(session, userId, stats, error) will return new (uptaded) stats:
stats = {
    local: {
        audio: {
            bitrate: 71, // kilobits per second (kbps)
            bytesSent: 226410,
            packetsSent: 1250, 
            timestamp: 1522680935736
        },
        video: {
            frameHeight: 480,
            frameWidth: 640,
            framesPerSecond: 25.8,
            bitrate: 498,  // kilobits per second (kbps)
            bytesSent: 1438862, 
            packetsSent: 1498,
            timestamp: 1522680935736
        },
        candidate: {
            protocol: "udp"
            ip: "192.168.1.179"
            port: 51038
        }
    },
    remote: {
        audio: {
            bitrate: 47, // kilobits per second (kbps)
            bytesReceived: 148211,
            packetsReceived: 1250,
            timestamp: 1522680935736
        },
        video: {
            frameHeight: 480,
            frameWidth: 640,
            framesPerSecond: 30.4,
            bitrate: 533, // kilobits per second (kbps)
            bytesReceived: 1663716,
            packetsReceived: 1498,
            timestamp: 1522680935736
        },
        candidate: {
            protocol: "udp",
            ip: "192.168.1.179",
            port: 51908
        }
    }
}
quickblox-javascript-sdk - 2.10.0

Published by dimaspirit over 6 years ago

Improvements / Updated:

  • Add the opportunity to choose crypto standard (sha1, sha256);
    By default, uses sha1. If you want to use sha256 add hash property to config;
var CONFIG = {
  debug: {mode: 1},
  hash: 'sha256'
};
QB.init(3477, 'ChRnwEJ3WzxH9O4', 'AS546kpUQ2tfbvv', CONFIG);
quickblox-javascript-sdk - 2.9.0

Published by dimaspirit over 6 years ago

Added:

  • Add possibility to set a bandwidth limit for the video call.
    Set the bandwidth at create sssion by QB.webrtc.createNewSession(calleesIds, sessionType, callerID, { bandwidth: Number });.

  • Add DELETE Custom Object by criteria by updated a method QB.data.delete.
    Now the method takes QB.data.delete(className, {string|array|object}, callback) where second parameter an id (String) or a list of ids (Array) or criteria rules (Object) to delete.
    Check out docs for more details;

Updated:

  • Normalize an answer on DELETE Custom Object by criteria for any passed types.
    Check out docs for more details;

  • Update QB.webrtc.onCallStatsReport(session, userId, stats, error) listener;

Samples:

  • Add ability set credentials and endpoints by search param of URL in webRTC sample:
    https//:www.host.com/?appId={Number}&authKey={String}&authSecret={String}&endpoints.api={String}&endpoints.chat={String}.
    Also remove production configuration/app and leave stage app configuration;

  • Add a bandwidth configuration to WebRTC sample;

  • Remove code for "Hack for Firefox" (https://bugzilla.mozilla.org/show_bug.cgi?id=852665) cause we are support FF52+ now;

quickblox-javascript-sdk - 2.8.1

Published by Vladlukhanin over 6 years ago

Fixed:

  • the Fetch API (if a response is an empty body);
  • the header 'Content-Type' in the qbData module;
  • the header 'QB-SDK' for REST API requests;
  • the QB.chat.message.unreadCount() method;
  • the QB.chat.dialog.create() method;
  • the QB.users.listUsers() method;

Samples:

quickblox-javascript-sdk - 2.8.0 - NativeScript support

Published by dimaspirit almost 7 years ago

Improvements:

  • Added fetch API instead $.ajax() and request() (REST API support for NativeScript);
  • Chat adapted for NativeScript enviroments;
  • The MessageProxy and the DialogProxy were remove from qbChat.js to separate modules;

Add:

  • Add stream management test cases;
  • Add link on API ref. in Readme.md.

Fixed:

  • Fix TypeError: Cannot read property 'statusCode' of undefined for Node env;
quickblox-javascript-sdk - 2.7.0

Published by Vladlukhanin almost 7 years ago

Added:

QB.chat.getLastUserActivity(userId) - to send query;
QB.chat.onLastUserActivityListener(userId, seconds) - get last user activity;
  • Support WebRTC in Safari 11 (experimental);

Updated:

  • API Reference:
    • QB.addressbook,
    • QB.content,
    • QB.data,
    • QB.pushnotifications,
    • QB.user;
  • possibilty to get user by phone number;

Removed:

  • QB.chat.privacyList.setAsActive();
  • QB.content.taggetForCurrentUser();

Samples:

  • WebRTC sample - Hide record button if MediaRecorder is unavailable.
Package Rankings
Top 6.17% on Npmjs.org
Top 7.75% on Bower.io
Badges
Extracted from project README
Code Climate npm npm