TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Mar 2018 |
SPMSupports SPM | ✗ |
Maintained by Ashari Juang, Ahmad Athaullah.
Depends on: | |
LFLiveKit | = 2.6 |
Alamofire | = 4.5.1 |
SwiftyJSON | = 3.1.4 |
Qiscus Streaming SDK is a product that makes adding voice calling and/or instant messaging to mobile apps easy. It handles all the complexity of signaling and audio management while providing you the freedom to create a stunning user interface.
Below is a step-by-step guide on setting up the Qiscus Streaming SDK for the first time
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
def import_pods
pod 'QiscusStreaming'
end
target 'Your Target' do
platform :ios, '8.0'
import_pods
end
Add to your project Info.plist
<key>NSCameraUsageDescription</key>
<string>..</string>
<key>NSMicrophoneUsageDescription</key>
<string>..</string>
Init Qiscus at your application class with your API key
QiscusStreaming(withConfig: config)
Parameters:
import QiscusStreaming
let config = StreamConfig()
config.AppId = "Your_app_id"
client = QiscusStreaming(withConfig: config)
Above is our demo API key with limited feature. To get your API key with full features, please contact us.
Before user can start streaming each other, they must create link streaming
QiscusStreaming.createStream(title: String, tags: [String], completion: @escaping (Stream?) -> Void)
Parameters:
let config = StreamConfig()
config.AppId = "Your_app_id"
client = QiscusStreaming(withConfig: config)
client?.createStream(title: "streaming", tags: ["test"]) { (stream) in
print("stream url : \(stream?.streamUrl)")
}
Stream object:
Start video streaming
let config = StreamConfig()
config.AppId = "Your_app_id"
client = QiscusStreaming(withConfig: config)
client?.buildStream(streamUrl: url!, completionHandler: { (target, error) in
self.present(target, animated: true, completion: nil)
})
You can obtain stream_url from stream object.
import QiscusStreaming
var client : QiscusStreaming?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
buttonStream.addTarget(self, action: #selector(self.tapSample(_:)), for: UIControlEvents.touchUpInside)
buttonLive.addTarget(self, action: #selector(self.goStream(_:)), for: UIControlEvents.touchUpInside)
let config = StreamConfig()
config.AppId = "a3d2QkJXQ2M1YTdrTW1PYnVJSmJiUVczTkxmS3BRc05nYnRCOHRGUw=="
client = QiscusStreaming(withConfig: config)
}
func tapSample(_ sender: Any) {
client?.createStream(title: "streaming", tags: ["test"]) { (stream) in
print("stream url : \(stream?.streamUrl)")
self.urlTextField.text = stream?.streamUrl
}
}
func goStream(_ sender: Any) {
//
let url = self.urlTextField.text
client?.buildStream(streamUrl: url!, completionHandler: { (target, error) in
//
self.present(target, animated: true, completion: nil)
})
}
You can test live streaming using VLC(https://www.videolan.org/vlc/).
Open Vlc, file, open network and put stream url after call method QiscusStream.createStream