2020 API AWARDS WINNER - BEST IN MEDIA APIs LEARN MORE

Migration Guide

  • JavaScript
  • Swift
  • Java

Migrating from 1.x to 2.0

The migration from Voxeet 1.x to 2.0 version includes significant changes. This document guides through all changes in JavaScript methods.

To familiarize with the newest events versions, check the reference documentation.

General changes

// v1.x
voxeet.joinConference()

// v2.x. Use join from the Conference service
VoxeetSDK.conference.join()
VoxeetSDK.conference.on("participantAdded", (participant: Participant) => {})

Changes in the initialization

  • In the 2.0 version, the VoxeetSDK object is used instead of creating a new VoxeetSdk() instance.
// v1.x
const voxeet = new VoxeetSdk();
voxeet.initialize();
...

// v2.x
VoxeetSDK.initialize();
...
  • Opening a session is no longer embedded in the initialize method. To login a user, Voxeet 2.0 uses the open method of the SessionService, after initializing the SDK.
VoxeetSDK.initialize("customerKey", "customerSecret")
try {
  await VoxeetSDK.session.open((participantInfo: ParticipantInfo))
} catch (e) {
  alert("Something went wrong : " + e)
}
let id = VoxeetSDK.session.participant.id

Changes in creating conferences

The create method is now returning the Conference object, not the conference ID.

VoxeetSDK.conference.create({alias}).then((conference: Conference) => {...})

Changes in muting

The toggleMute is no longer used in the 2.0 version. The mute method from the ConferenceService is used instead.

// v1.x
voxeet.toggleMute(...)

// v2.x
VoxeetSDK.conference.mute(participant, isMuted)

Changes in the isUserSpeaking and getUserLevel methods

The isUserSpeaking and getUserLevel are replaced by the isSpeaking and audioLevel methods from the ConferenceService. They now take the Participant object as a parameter, instead of the userId.

// v1.x
voxeet.isUserSpeaking(userId, (isSpeaking) => {
  ...
});

voxeet.getUserLevel(userId, (level) => {
  ...
});

// v2.x
// Get Audio Level of an user
VoxeetSDK.conference.audioLevel(participant, level => {
    // Level is the audio level value of the participant
});

VoxeetSDK.conference.isSpeaking(participant, isSpeaking => {
    // isSpeaking is a boolean to detect if the participant is speaking or not
});

Changes in the FilePresentationService

The getImage, getThumbnail, and updateFilePresentation have been replaced by the image, thumbnail, and update methods from the FilePresentationService. Also, they now take a page number as parameter, instead of the fileId.

// v1.x
voxeet.startFilePresentation({ fileId: "fileId" })

voxeet.getImage({ fileId: "fileId" })

voxeet.getThumbnail({ fileId: "fileId" })

// v2.x
VoxeetSDK.filePresentation.image((page: number))

VoxeetSDK.filePresentation.thumbnail((page: number))

VoxeetSDK.filePresentation.update((page: number))

Migrating from 1.x to 2.0

The migration from Voxeet 1.x to 2.0 version includes significant changes. This document guides through all changes in Swift methods.

Changes in VTUser

  • All VTUser instances in class names are replaced with the VTParticipant that embeds stream arrays and stream types.
// v1.x
// Checks if there is a stream.
if user.hasStream {}
// v2.x
// Checks if there is a stream.
if !participant.streams.isEmpty {}

// Gets a camera stream.
if let stream = participant.streams.first(where: { $0.type == .Camera }) {}

Changes in create and join methods

// v1.x
// Creating a conference.
VoxeetSDK.shared.conference.create(parameters: ["conferenceAlias": "alias", success: { json in
    guard let conferenceID = json?["conferenceId"] as? String else { return }

    // Joining conference.
    VoxeetSDK.shared.conference.join(conferenceID: conferenceID, success: { json in
    }, fail: { error in
    })

}, fail: { error in
})
// v2.x
let options = VTConferenceOptions()
options.alias = "alias"

// Creating a conference.
VoxeetSDK.shared.conference.create(options: options, success: { conference in
    // Joining conference.
    VoxeetSDK.shared.conference.join(conference: conference, success: { conference in
    }, fail: { error in
    })
}, fail: { error in
})

Changes in the VTConferenceDelegate

// v1.x
extension Class: VTConferenceDelegate {
    func participantJoined(userID: String, stream: MediaStream) {
        if !stream.videoTracks.isEmpty {
            videoView.attach(userID: userID, stream: stream)
        }
    }

    func participantUpdated(userID: String, stream: MediaStream) {}
    func participantLeft(userID: String) {}
    func screenShareStarted(userID: String, stream: MediaStream) {}
    func screenShareStopped(userID: String) {}
    func messageReceived(userID: String, message: String) {}
}
// v2.x
extension Class: VTConferenceDelegate {
    func streamAdded(participant: VTParticipant, stream: MediaStream) {
        switch stream.type {
        case .Camera:
            if !stream.videoTracks.isEmpty {
                videoView.attach(participant: participant, stream: stream)
            }
        case .ScreenShare: break
        default: break
        }
    }

    func streamUpdated(participant: VTParticipant, stream: MediaStream) {}
    func streamRemoved(participant: VTParticipant, stream: MediaStream) {}
    func statusUpdated(status: VTConferenceStatus) {}
    func participantAdded(participant: VTParticipant) {}
    func participantUpdated(participant: VTParticipant) {}
}

Changes in naming

  • Many methods and parameters are renamed.

Migrating from 1.x to 2.0.73.19+

The migration from Voxeet 1.x to 2.0 version includes significant changes.

General changes

  • The Conference and User reflect the first step of the new, improved, and easier flow of integration.
  • The Promise integrates inside the SDK together with .then() integration. It is now possible to use Promise transitive calls similar to JavaScript.
VoxeetSdk.conference().create("")
        .then((ThenPromise<CreateConferenceResult, Conference>) result ->
          VoxeetSdk.conference().join(result.conferenceId))
        .then(result -> {
            //TODO manage here the join result
        })
        .error(Throwable::printStackTrace);

Changes in the ConferenceService

VoxeetSDK.conference().join(conferenceId)
.then(result -> {

}).error(error -> {
  if(error instanceof ServerErrorException) {
    ServerErrorException err = (ServerErrorException) error;
    //TODO add management here
  } else {
    //TODO standard exception, to be dealt with
  }
})

Changes related to conference participants

  • The Participant replaced the User instance in all SDK class names.
//v1.x
List<User> users = VoxeetSDK.conference().getUsers();

//v2.x

List<Participant> participants = VoxeetSDK.conference().getParticipants();
  • The getParticipants() (getUsers() in previous versions) replaced the getConferenceUsers().

Changes in services

  • Services can now be used statically from the VoxeetSDK.
//v1.x
VoxeetSDK.getInstance().XXX()

//v2.x
VoxeetSDK.XXX()

//the instance is still available
VoxeetSDK.getInstance()