Skip to content

v2.2.0-Alpha

Pre-release
Pre-release
Compare
Choose a tag to compare
@jeffswartz jeffswartz released this 20 Jun 22:18
· 345 commits to main since this release

This version of the SDK includes support for working with OpenTok 2.0 archives. (This API does not
work with OpenTok 1.0 archives.)

This version of the SDK includes a number of improvements in the API design. These include a number
of API changes:

  • New OpenTok class -- The name of the main class has changed from OpenTokSDK to OpenTok.
    In the previous version, the constructor was OpenTokSDK().
    In v2.2, it is OpenTok(int apiKey, int apiSecret).

  • CreateSession -- In the previous version, there were two methods to create a session:
    OpenTokSDK.CreateSession(String location) and
    OpenTokSDK.CreateSession(String location, Dictionary<string, object> options).
    These methods returned a string (the session ID).
    In v2.2, the OpenTok class includes one method, which takes two parameters (both optional):
    CreateSession(string location = "", MediaMode mediaMode = MediaMode.ROUTED).
    The mediaMode parameter replaces the p2p.preference setting in the
    previous version. The method returns a Session Object.

  • GenerateToken -- In the previous version, there were two methods:
    OpenTokSDK.GenerateToken(string sessionId) and
    OpenTokSDK.GenerateToken(string sessionId, Dictionary<string, object> options)
    In v2.2, this is replaced with the following method:
    OpenTokSDK.OpenTok.GenerateToken(string sessionId, Role role = Role.PUBLISHER, double expireTime = 0, string data = null).
    All parameters, except the sessionId parameter, are optional.

    Also, the Session class includes a method for generating tokens:
    OpenTokSDK.Session.GenerateToken(Role role = Role.PUBLISHER, double expireTime = 0, string data = null).