Swift 4 IOS App Player Live Stream Video from Nginx, Nginx-RTMP use VLCKit

Create your a simple video player that live streaming video from Nginx RTMP server such at: rtmp://your-domain.com/live/[Stream-key]

VLCKit

VLCKit is a generic multimedia library for any audio or video playback needs on macOS, iOS and tvOS.

It is based on libVLC, the engine of the popular media player VLC.

It supports playback, but also active streaming and media to file conversations on the Mac.

It is open-source software licensed under LGPLv2.1 or later, available in source code and binary form from the VideoLAN website.

Install CocoaPods

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. It has over 41 thousand libraries and is used in over 2.9 million apps. CocoaPods can help you scale your projects elegantly. See the documentation from Official website or Run following command on your terminal.

# Xcode 8 + 9
$ sudo gem install cocoapods

Xcode & Create new Project

Download Xcode Tool from Apple official link in this tutorial i did use Xcode 9.x , Open Xcode and create new single view application. Example save your project at ~/Downloads/myProject

Open Terminal

cd ~/Downloads/myProject
pod init

Edit Podfile

nano Podfile

and insert pod ‘MobileVLCKit’

Your Podfile should look like this, replace “Stream” to your project name

Quite Xcode and run

pod install

Once done open again project in Xcode , remember open file with extension is: .xcworkspace

open myProject.xcworkspace

Watch Video

Youtube: https://www.youtube.com/watch?v=N_u9nsXNvn4
Github: https://github.com/tabvn/video-streaming-service

More by Toan Nguyen Dinh

Topics of interest

More Related Stories