Public API (v2.1)

Hints:
protocol in ObjC/Swift is interface in Java; delegate in ObjC/Swift is listener in Java.
All class names in ObjC/Swift starts with prefix "CM" (i.e CMAccessTokenProvider etc).

CameraWizard (v2.1)

class CameraWizard

CameraWizard(CameraWizardDelegate delegate);

Constructs CameraWizard instance.

addDevice(Device device, String cameraName, Long zoneId);

Adds a device to a specific zone specified by zoneId.  For mode details about Device class check CameraSniffer (v3.0) page.

protocol CameraWizardDelegate

@required onAdded(Long cameraId, Device device);

If everything went ok, will get called after the camera has been added.

@required onError(MobileSDKError error, Device device);

Will get called if there's an error in the process of adding a camera.

NuboCamWizard (v2.1)

Hints:

  • **iOS specific:** NuboCamWizard's callback onPreparedForConnection returns nothing.
  • **iOS specific: NuboCamWizard's method connectToCamera takes no parameters. User should connect to Wifi via Settings app, then return to app and call this method.**
  • **iOS specific: For iOS12 and higher you should add Access Wifi Information capability (Target Name - Capabilities) in order to use NuboCamWizard otherwise iOS would not grant SDK access to Wifi information.**
  • **Android specific: NuboCamWizard's callback onPreparedForConnection returns list of available Nubocam Wifi Networks.**
  • **Android specific: NuboCamWizard's method connectToCamera takes WifiNetwork object (returned with onPreparedForConnection callback) as input parameter.**
  • **Android specific: NuboCamWizard has additional method disconnectFromNuboCamWifi.**

class NuboCamWizard

NuboCamWizard(NuboCamWizardDelegate delegate);

Constructs NuboCamWizard instance.

prepareForConnection(Map<String, void *> options);

Prepares for connection process. Options map should contain "cameraId" (of disconnected camera) for restoration process or "zoneId" for adding process.

connectToCamera(WifiNetwork nuboCamWifiNetwork);

Connects to wifi network of chosen NuboCam.

**iOS specific:** user should connect to NuboCam wifi network manually using Settings app. After returning to app he should call this method (without parameters).

 Android specific: list of available wifi networks is returned by prepareForConnection callback. User should use one of returned object to pass as parameter of this function.

Carrier[] getListOfAvailableCarriers();

Returns list of Carriers to which NuboCam can be connected. Array will be empty if mobile setup option is not available.

refreshWifiList();

Refreshes list of WifiNetwork objects to which NuboCam can be connected.

connectCameraToNetwork(NetworkInterface network, String cameraName);

Connects NuboCam to provided network with given camera name (both WifiNetwork and AccessPointName are inherited from NetworkInterface).

cancelCurrentOperation();

Cancels current operation. No callbacks will be triggered.

disconnectFromNuboCamWifi();

Android specific: Disconnects device from NuboCam Wi-Fi access point.

protocol NuboCamWizardDelegate

@required onPreparedForConnection(WifiNetwork[] nuboCamWifiNetworks);

Called when SDK is ready for NuboCam connection.

Android specific: returns list of available NuboCam wifi networks to connect. One of objects should be used with connectToCamera method.

@required onConnectedToCamera(MobileSetupOption option);

Called when SDK established connection with NuboCam. Now user can retrieve list of wifi. Option enumeration determines available mobile setup options.

@optional onWifiListRefreshed(WifiNetwork[] networks);

Returns list of Wifi networks to which NuboCam can be connected.

@optional onDisconnectedFromCameraUnexpectedly();

Will be called if NuboCam will try to connect to cloud with previously setup sim. Expect onFinished or onError callback after this one.

@required onFinished(Long cameraId);

If everything went ok, will get called after the NuboCam has been added/restored.

@required onError(MobileSDKError error);

Will get called if there's an error in the process of adding/restoring NuboCam.

enum MobileSetupOption

case notAvailable

case oldFirmware

case pinRequired

case ownSim 

abstract class NetworkInterface

Empty abstraction which represents some network interface.

class WifiNetwork : NetworkInterface

String getSsid();

Returns SSID of wifi network.

String getEncryption();

Returns encryption of wifi network.

Int getStrengthPercentage();

Returns strength of wifi network in range (0..100].

String password;

Password of wifi network.

class AccessPointName : NetworkInterface

AccessPointName(String name, String username, String password);

Constructs AccessPointName instance.

String getName();

Returns name of access point name.

String getUsername();

Returns username of access point name.

String getPassword(); 

Returns password of access point name.

class Carrier 

String getName();

Returns name of carrier.

String getMcc();

Returns MCC of carrier.

String getMnc();

Returns MNC of carrier.

String getCountryIso();

Returns country ISO of carrier.

AccessPointName[] getAccessPointNamesList(); 

Returns list of APNs of carrier.

CameraStreamer (v2.1)

Hints:

  • **In Android CameraStreamer is rendering video frames directly into Surface while in iOS CameraStreamer returns video frames of desired output type.**
  • **In case of multiple CameraStreamer instances usage it's generally advised to mute audio on all or all except one CameraStreamer instances.**
  • iOS specific: CameraStreamer has additional outputContentType field which determines type of output video frame (currently it can be UIImage or CIImage)****
  • Android specific: CameraStreamer constructor takes Surface parameter (most commonly obtained via TextureView::getSurfaceTexture() method).
  • **Android specific:** takeSnapshot() method is absent because the video decoder works directly with passed Surface object and therefore doesn't have access to raw frames. There is an easy and convenient way to take snapshot though: TextureView::getBitmap() method (the same view that holds the Surface from the previous step).

class CameraStreamer

CameraStreamer(CameraStreamerDelegate delegate);

Constructs CameraStreamer instance.

String rtspUrlString;

String which represents RTSP URL to be streamed. Streamer will start streaming after variable set.

play();

Resumes streaming: footage from pause point, live from current timestamp.

pause();

Pauses streaming (both live and footage).

seekToTime(float time);

Jumps to concrete time in [0 ... duration] range and starts playing (even if footage was paused). In milliseconds. Wouldn't affect live streaming. 

boolean isPlaying();

Returns true if the playback has been started.

boolean isLiveStreaming();

Returns true if streaming is not footage.

float getStartTime();

returns start time of footage stream (0 for live stream), in milliseconds till 1970.

float getEndTime();

returns end time of footage stream (0 for live stream), in milliseconds till 1970.

float getDuration();

returns duration of footage stream (0 for live stream), in milliseconds.

float getPosition();

returns current position in [0 ... duration] range for footage stream or current timestamp for live stream, in milliseconds.

float getBufferTime();

returns buffer time of footage stream (0 for live stream), in milliseconds.

boolean muteAudio;

mutes audio by ignoring the audio stream altogether.

byte[] takeSnapshot();

iOS specific: returns last decoded frame.

FrameDataType outputContentType;

iOS specific: frame's output content type.

protocol CameraStreamerDelegate

@optional onStarted();

Will get called when the playback has been effectively resumed/started.

@optional onPaused();

Will get called when the playback has been paused.

@optional onSoughtToTime(float time);

Will get called when the playback has been sought to given time. 

@optional onEnded();

Will get called when the playback has been ended. Will be called only for footage stream as live stream can't end. 

@optional onDurationChanged(float duration);

Will be called when footage stream duration has been changed. 

@optional onBufferTimeChanged(float bufferTime);

Will be called when footage stream buffer time has been changed.

@required onFrameDataReceived(FrameData frameData);

iOS specific: When a new frame arrives, this method will be called with frame data instance.

@required onError(MobileSDKError error);

Will be called if there is an error in the streaming process.

enum FrameDataType (iOS specific)

case UIImage

case CIImage

class FrameData

FrameDataType getType();

iOS specific: Returns type of frame's data.

byte[] getData();

Returns data associated with frame.

float getTimestamp();

Returns timestamp associated with frame.