paint-brush
Swift 4 IOS App Player Live Stream Video from Nginx, Nginx-RTMP use VLCKitby@tabvn
14,031 reads
14,031 reads

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

by Toan Nguyen DinhDecember 29th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

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

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Swift 4 IOS App Player Live Stream Video from Nginx, Nginx-RTMP use VLCKit
Toan Nguyen Dinh HackerNoon profile picture

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/myProjectpod 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