Live Video Streaming

Overview

MFiPreviewViewAdapter provides the required APIs to easily display the live video stream on any iOS device. Make sure to connect your iOS device to the ST10C to be able to view the video. The code snippets below show how to start and stop receiving live video stream from the camera.

  1. Start video
    
    MFiAdapter.MFiPreviewViewAdapter.sharedInstance().startVideo(self.previewView) { (result) in
                    if let result = result {
                        print (result)
                    }
                }
    
    
  2. Stop video
    
    MFiAdapter.MFiPreviewViewAdapter.sharedInstance().stopVideo { (result) in
                    if let result = result {
                        print (result)
                    }
                }
    

 

For the start video function, you need to pass a parameter of type YuneecPreviewView, which is a custom class defined in Yuneec-MFiAdapter. For that, you need to define a view in Xcode where you want to display the live video feed and assign it's class to YuneecPreviewView. The below snap shows a view of type YuneecPreviewView, where the video will be displayed.

 

video view

 

Please refer the PreviewViewController in the iOS App to view the complete code of the working example