Clients

The Client SDK

LiveSwitch is available for client-side deployment on almost any modern platform. Download the LiveSwitch release and open the SDK archive, and you will see a list of files and folders. At the root is the LiveSwitch installer that can be deployed on your server or development environment. This executable can install the LiveSwitch Gateway, Media Server, SIP Connector, and Web Example. In the download, under the ClientSDK folder, you'll find a list of folders, each named after a specific platform. Open the folder for your platform, and you will see both an Examples folder and a Libraries folder. There are no surprises here - the Examples folder contains source code for demos that you can use as a starting point to build your own apps, and the Libraries folder contains compiled binaries for the platform to include in your apps.

In the root of the archive, you can inspect the Change.log file for the latest release notes or the README file, which contains information on how to use the SDK.

Building an Example

In the Examples folder, under the ClientSDK folder, the Chat example demonstrates the core features of LiveSwitch, including how to switch between peer-to-peer, SFU and MCU modes. It also demonstrates how to perform token-based authentication, and how to send and display a chat message. To build the example, navigate to the folder for your platform and load the project in an appropriate IDE. For C#, use Visual Studio; for Java/Android use either IntelliJ or Android Studio; and for iOS/macOS, use Xcode.

If you prefer to see the demo in action before building it yourself, there is a public version of this example hosted at https://v1.liveswitch.fm.

Note that when you are running the Xamarin iOS example, you should make sure that the path of the example does not have any spaces. If you try to run this example from a path with spaces, the example will not build.

Client Requirements

Minimum supported version (OS, framework, browser, etc) is affected by the vendor support policy. Where a vendor deprecates support for a particular product version we will do our best to maintain support, but we cannot guarantee that these versions will be fully functional and no further performance optimizations will be performed.

Supported Platforms

Name Minimum Version
Android 5.0 (API Level 21)
iOS 12
macOS 10.11 El Capitan
tvOS 8
Ubuntu LTS
Xamarin.Android 5.0 (API Level 21)
Xamarin.iOS 8
Windows 7

Supported Frameworks and Languages

Name Minimum Version
Java 1.7
.NET 3.5
Objective-C 2.0
Swift 3.0
TypeScript 2.0

Supported Browsers

Name Minimum Version Recommended Version
Chrome 73 Latest
Firefox Latest ESR Latest
Edge 40

Latest

Safari 11 Latest
Internet Explorer 11 11
Chrome (Android) Latest

Latest

Firefox (Android) Latest Latest
Safari (iOS) Latest Latest

Tuning Guide

Depending on the device and network speeds, different media capture and encode settings will result in a better user experience. This guide serves as our best recommendations, and will be updated periodically as new test results emerge.

Platforms

iOS

Minimum and Recommended Requirements

Minimum for two-way, or three-way, video chat - A7 processor or better:

  • iPhone 5S or newer
  • iPad Air
  • iPad Mini 2nd generation or newer

Recommended for three-way video chat or two-way HD video chat - A8 processor or better:

  • iPhone 6 or newer
  • iPad Air 2 or newer
Video Capture Recommendations

If the chipset is A7, set the video preset to AVCaptureSessionPresetLow.

Otherwise, set the video preset to AVCaptureSessionPreset640x480.

// https://github.com/fahrulazmi/UIDeviceHardware/blob/master/UIDeviceHardware.m


- (NSString *) platform
{
    size_t size;
    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
    char *machine = malloc(size);
    sysctlbyname("hw.machine", machine, &size, NULL, 0);
    NSString *platform = [NSString stringWithUTF8String:machine];
    free(machine);
    return platform;
}

- (bool)isA5Chipset
{
    NSString *platform = [self platform];
    return ([platform startsWithValue:@"iPhone4,"] || // iPhone 4S
            [platform startsWithValue:@"iPad2,"] ||   // iPad 2 and Mini
            [platform isEqualToString:@"iPod5,1"]);   // iPod 5
}

- (bool)isA5XChipset
{
    NSString *platform = [self platform];
    return ([platform isEqualToString:@"iPad3,1"] || // iPad 3
            [platform isEqualToString:@"iPad3,2"] ||
            [platform isEqualToString:@"iPad3,3"]);
}

Android

Minimum and Recommended Requirements

Recommended for two-way video chat - 1.4GHz dual-core or better:

  • Google Nexus 4
  • Samsung Galaxy S3

Minimum for three-way video - 1.6GHz quad-core or better:

  • Google Nexus 5
  • Samsung Galaxy S4

Recommended for three-way video chat or two-way HD video chat - 2.4GHz quad-core processor or better:

  • Google Nexus 6
  • Samsung Galaxy S5
Video Capture Recommendations

If the CPU core count is 1, set the video width, height, and frame-rate to 320, 240, and 15.

If the CPU core count is 2, set the video width, height, and frame-rate to 320, 240, and 30.

Otherwise, set the video width, height, and frame-rate to 640, 480, and 30.

// http://stackoverflow.com/questions/30119604/how-to-get-the-number-of-cores-of-an-android-device
private int getNumberOfCores() {
    if(Build.VERSION.SDK_INT >= 17) {
        return Runtime.getRuntime().availableProcessors()
    }
    else {
       // Use saurabh64's answer
       return getNumCoresOldPhones();
    }
}

/**
 * Gets the number of cores available in this device, across all processors.
 * Requires: Ability to peruse the filesystem at "/sys/devices/system/cpu"
 * @return The number of cores, or 1 if failed to get result
 */
private int getNumCoresOldPhones() {
    //Private Class to display only CPU devices in the directory listing
    class CpuFilter implements FileFilter {
        @Override
        public boolean accept(File pathname) {
            //Check if filename is "cpu", followed by a single digit number
            if(Pattern.matches("cpu[0-9]+", pathname.getName())) {
                return true;
            }
            return false;
        }      
    }

    try {
        //Get directory containing CPU info
        File dir = new File("/sys/devices/system/cpu/");
        //Filter to only list the devices we care about
        File[] files = dir.listFiles(new CpuFilter());
        //Return the number of cores (virtual CPU devices)
        return files.length;
    } catch(Exception e) {
        //Default to return 1 core
        return 1;
    }
}

Desktop

Video Capture Recommendations

If the CPU core count is 1, set the video width, height, and frame-rate to 320, 240, and 15.

If the CPU core count is 2, set the video width, height, and frame-rate to 320, 240, and 30.

Otherwise, set the video width, height, and frame-rate to 640, 480, and 30.

Networks

2G / GPRS

  • Average download speed: 50kbps
  • Average upload speed: 25kbps

A connection is generally not possible.

2G / EDGE

  • Average download speed: 100kbps
  • Average upload speed: 50kbps

An audio-only connection may be possible.

  • Recommended Opus encoder bitrate: 32kbps

3G / Basic

  • Average download speed: 200kbps
  • Average upload speed: 100kbps

An audio-only connection should be possible.

  • Recommended Opus encoder bitrate: 32kbps

3G / HSPA

  • Average download speed: 1.5mbps
  • Average upload speed: 0.75mbps

low-quality audio/video connection should be possible.

  • Recommended Opus encoder bitrate: 32kbps
  • Recommended VP8/H.264 encoder bitrate: 256kbps

3G / HSPA+

  • Average download speed: 4mbps
  • Average upload speed: 1.5mbps

An audio/video connection should be possible.

  • Recommended Opus encoder bitrate: 48kbps
  • Recommended VP8/H.264 encoder bitrate: 384kbps

3G / DC-HSPA+

  • Average download speed: 8mbps
  • Average upload speed: 3mbps

A high-quality audio/video connection should be possible.

  • Recommended Opus encoder bitrate: 48kbps
  • Recommended VP8/H.264 encoder bitrate: 512kbps

4G / LTE

  • Average download speed: 15mbps
  • Average upload speed: 7.5mbps

A high-quality audio/video connection should be possible.

  • Recommended Opus encoder bitrate: 64kbps
  • Recommended VP8/H.264 encoder bitrate: 512kbps