Rishat7c / iOS-FPVDemo-Swift

A demo to introduce how to implement the FPV view, take photo and record video using DJI Mobile SDK.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iOS-FPVDemo-Swift

Introduction

This FPVDemo is designed for you to gain a basic understanding of the DJI Mobile SDK. It will implement the FPV view and two basic camera functionalities: Take Photo and Record Video.

Requirements

  • iOS 10.0+
  • Xcode 8.3.2+
  • DJI iOS SDK 4.7.1
  • DJIWidget 1.1

SDK Installation with CocoaPods

Since this project has been integrated with DJI iOS SDK CocoaPods now, please check the following steps to install DJISDK.framework using CocoaPods after you downloading this project:

1. Install CocoaPods

Open Terminal and change to the download project's directory, enter the following command to install it:

sudo gem install cocoapods

The process may take a long time, please wait. For further installation instructions, please check this guide.

2. Install SDK with CocoaPods in the Project

Run the following command in the project's path:

pod install

If you install it successfully, you should get the messages similar to the following:

Analyzing dependencies
Downloading dependencies
Installing DJI-SDK-iOS (4.7.1)
Installing DJIWidget (1.1)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `FPVDemo.xcworkspace` for this project from now on.
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod
installed.

Note: If you saw "Unable to satisfy the following requirements" issue during pod install, please run the following commands to update your pod repo and install the pod again:

pod repo update
pod install

Tutorial

For this demo's tutorial: Creating a Camera Application, please refer to https://developer.dji.com/mobile-sdk/documentation/ios-tutorials/index.html.

DJIWidget Integration

Starting from DJI iOS SDK 4.7, we have replaced the VideoPreviewer with DJIWidget for video decoding. Please add the following line to your Podfile to install it to your Xcode project:

pod 'DJIWidget', '~> 1.0'

Note:

1. Remember to remove the use_frameworks! in the pod file.

2. In order to use the Objective-C header files of the DJIWidget in the swift project, create a new header file in the project and add the following code to add the DJIWidget's header files:

#import <DJIWidget/DJIVideoPreviewer.h>

3. Go to Project -> TARGETS -> Build Settings -> Search “bri” -> Double click "Objective-C Bridging Header" -> Drag the "Header.h" file to the pop-up window to set the path.

Feedback

We’d love to hear your feedback for this demo and tutorial.

Please use Stack Overflow dji-sdk or email dev@dji.com when you meet any problems of using this demo. At a minimum please let us know:

  • Which DJI Product you are using?
  • Which iOS Device and iOS version you are using?
  • A short description of your problem includes debug logs or screenshots.
  • Any bugs or typos you come across.

Contribution

We'd love to accept your contributions to this project. All submissions require code review. We use GitHub pull requests for this process. Consult GitHub Help for more information.

Special thanks to @dwcares for the original contribution.

License

iOS-FPVDemo is available under the MIT license. Please see the LICENSE file for more info.

Join Us

DJI is looking for all kinds of Software Engineers to continue building the Future of Possible. Available positions in Shenzhen, China and around the world. If you are interested, please send your resume to software-sz@dji.com. For more details, and list of all our global offices, please check https://we.dji.com/jobs_en.html.

DJI 招软件工程师啦,based在深圳,如果你想和我们一起把DJI产品做得更好,请发送简历到 software-sz@dji.com. 详情请浏览 https://we.dji.com/zh-CN/recruitment.

About

A demo to introduce how to implement the FPV view, take photo and record video using DJI Mobile SDK.

License:MIT License


Languages

Language:Swift 98.7%Language:Ruby 1.3%