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

Skip to content

jstarfruits/lf.swift

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

181 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lf.swift

iOS向けライブ配信用のライブラリーです。現在、RTMPでの配信をサポートしています。

Install

Cocoapod

pod 'lf'
use_frameworks!

利用方法

RTMP

api自体はAS3のNetConnectionとNetStreamに似せています。

  • flash.net.SharedObject → RTMPSharedObject
  • flash.net.Responder → Responder
  • flash.net.NetConnection → RTMPConnection
  • flash.net.NetStream → RTMPStream
  • AMF0をサポート、AMF3はこれからサポート予定
  • Adobe形式のRTMP認証にも対応しています。下記のフォーマットでユーザー名を渡せます。
  • rtmp://user:[email protected]/appName/instanceName
var rtmpConnection:RTMPConnection = RTMPConnection()
var rtmpStream = RTMPStream(rtmpConnection: rtmpConnection)
rtmpStream.videoGravity = AVLayerVideoGravityResizeAspectFill
rtmpStream.attachAudio(AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeAudio))
rtmpStream.attachCamera(AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo))

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

License

New BSD

Reference

About

iOS用のライブ配信ライブラリー

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Swift 98.2%
  • Batchfile 1.3%
  • Other 0.5%