Rendering Live View

Access the Webrtc view to show the Live View

To render the Live Stream or access the Live View, add below view:

let liveView = liveViewObject.remoteView

Connect/disconect live view

To connect live view you will need

  • localView (optional): If user video needs to be sent to camera for 2 way video camera.
  • autoDisconnectTime (optional): If live view needs to be auto disconnect after defined time period.
  • playbackEndTime (optional): If SD card playback needs to be ended after defined time.
liveViewObject.connect(localView: localView,
    autoDisconnectTime: <Time in senconds>,
    playbackEndTime: <Epoch time>)

To disconnect live view you will need

  • localView (optional): If user video needs to be sent to camera for 2 way video camera.
liveViewObject.disconnect(localView: localView)

Observing the status of Live View

To observer the status of the Live View, The following observer can be used:

liveViewObject.onConnected {
    // status is updated when ever live is connected
}

liveViewObject.onLiveViewTerminate {
    // status is updated when ever live is terminated
}

liveViewObject.onError {
    // status is updated when ever error occurs 
}

liveViewObject.onReconnect {
    // status is updated when ever live is reconnected
}

liveViewObject.onTimeout {
    // status is updated when ever live is timed out
}

liveViewObject.onDataChannelMessage {
    // status is updated when ever there is a message from data channel
}

liveViewObject.onDataChannelOpen {
    // status is updated when ever data channel is open
}

liveViewObject.onDeviceRefresh {
    // status is updated when ever devices is refreshed by SDK
}

liveViewObject.onFrameTimeout {
    // status is updated when ever live is frame timed out
}

liveViewObject.onStreamEnded {
    // status is updated when ever live stream ends
}

liveViewObject.onStreamFailed {
    // status is updated when ever live stream fails
}