Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jldavid/lf-objc

 
 

Repository files navigation

lf.swift

lf is a lIVE fRAMEWORK. iOS Camera/Microphone streaming library via RTMP/HTTP

Install

Cocoapod

pod 'lf'
use_frameworks!

Usage/RTMP

Real Time Messaging Protocol (RTMP). Basic snipet.

var rtmpConnection:RTMPConnection = RTMPConnection()
var rtmpStream = RTMPStream(rtmpConnection: rtmpConnection)
rtmpStream.videoGravity = AVLayerVideoGravityResizeAspectFill
rtmpStream.attachAudio(AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeAudio))
rtmpStream.attachCamera(AVMixer.deviceWithPosition(.Back))

view.addSubview(rtmpStream.view)
rtmpConnection.connect("rtmp://localhost/appName/instanceName")
rtmpStream.publish("streamName")

Settings

var rtmpStream = RTMPStream(rtmpConnection: rtmpConnection)
rtmpStream.videoSettings = [
    "width": 640, // video output width
    "height": 360, // video output height
]

RTMP Auth

var rtmpConnection:RTMPConnection = RTMPConnection()
rtmpConnection.connect("rtmp://username:password@localhost/appName/instanceName")

Usage/HTTP

HTTP Live Streaming (HLS). Your iPhone become a IP Camera. Basic snipet.

httpStream = HTTPStream()
httpStream.syncOrientation = true
httpStream.attachCamera(AVMixer.deviceWithPosition(.Back))

httpStream.publish("hello")

httpService = HTTPService(domain: "", type: "_http._tcp", name: "lf", port: 8080)
httpService.startRunning()
httpService.addHTTPStream(httpStream)

view.addSubview(httpStream.view)

You can see http://ip.address:8080/hello/playlist.m3u8

Class Overview

AS3 lf
flash.net.SharedObject RTMPSharedObject
flash.net.Responder Responder
flash.net.NetConnection RTMPConnection
flash.net.NetStream RTMPStream

License

New BSD

Enviroment

lf iOS Swift CocoaPod
0.2 8.0〜 2.3 0.39.0

Reference

About

iOS Camera/Microphone streaming library via RTMP

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Swift 98.3%
  • Batchfile 1.1%
  • Other 0.6%