Skip to content

Required changes for working with BE API

maxkutsanov edited this page Jan 9, 2025 · 1 revision

Overview

The CloudSDK now supports the BE API - https://be.vaplatform.ru/docs#/ In essence, this is a layer between the client and the CNVR API (VXG) with its own authorization and scaling capabilities. Scaling here means the ability to dynamically connect additional CNVR instances depending on the load on the system as a whole. This API also provides access to several third-party (not related to CNVR) services, such as sleep service, etc.

We tried to maintain backward compatibility as much as possible, but since a lot of the necessary information was contained in the VXG input token, we had to add several additional settings.

Required improvements

  1. Configure the backend url
for the class
    [CloudBackendConfig defaultConfig:@"https://be.vaplatform.ru/" headers:nil];
    player = [[CloudPlayerSDK alloc] initWithParams:videoView config:conf protocol_callback:self];
for instance
    CBackendConfig* backend = [[CBackendConfig alloc] init];
    backend.url = @"https://be.vaplatform.ru/";
    ...
    player = [[CloudPlayerSDK alloc] initWithParams:backend view:videoView config:conf protocol_callback:self];
or
    player = [[CloudPlayerSDK alloc] initWithParams:videoView config:conf protocol_callback:self];
    [player getBackendConfig].url = @"https://be.vaplatform.ru/";
  1. Add explicit parameters previously hidden in the VXG token
at startup
    CSourceParams* params = [[CSourceParams alloc] init];
    params.identityId = @"14909c55-c55a-4762-a272-69ca22943527";
    params.cameraId = @"1064873";
    params.cameraShareToken = @"";
    int rc = [player setSource:token withParams:params];

during workflow
    int rc = [player setSource: token];
    ...
    // after SOURCE_CHANGED notify
    ...
    CSourceParams* params = [[CSourceParams alloc] init];
    params.identityId = @"14909c55-c55a-4762-a272-69ca22943527";
    params.cameraId = @"1064873";
    params.cameraShareToken = @"";
    int rc = [player updateSource:params];

All CloudSDK methods should work as before, provided that all the necessary parameters for the selected method: identityId, cameraId, cameraShareToken - are configured!

Clone this wiki locally