Swiftpack.co -  Package - pbj-apps/Live-ios-sdk
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
pbj-apps/Live-ios-sdk
Stream your PBJ.live content from your iOS App.
.package(url: "https://github.com/pbj-apps/Live-ios-sdk.git", from: "0.2.6-beta")

Live Player

Live Platform: iOS 13+ Language: Swift 5 Swift Package Manager compatible Build status GitHub tag

Stream your PBJ.live content from your iOS App.

Stream to your iOS app in 5 simple steps

1. Import the Live-ios-sdk package

Xcode > File > Swift packages > Add Package Dependency

https://github.com/pbj-apps/Live-ios-sdk

2. Initialize the LivePlayerSDK with your credentials on App start

A good place to do this is typically the AppDelegate.

import Live

// [...]

LiveSDK.initialize(apiKey: "YOUR_API_KEY")

3. (Optional) Check if there is a live episode beforehand

Typical usage is that you have a "Watch live" button that you only want to show if there is an actual episode currently live.

LiveSDK.isEpisodeLive { isLive, error in			
    // -> isLive is true if there is any episode live.
    // Show player here. (step 4)
}

You can also pass your showID as a parameter to query live episodes, but this time for a specific show. You can find your showId in your web dashboard. Select the show you want and grab it's id from the browser's url.

This api exists with both callbacks and Combine publishers so your are free to choose the version that fits best with your app.

4. Create a LivePlayerViewController

let livePlayerVC = LivePlayerViewController() // Optionally pass a showId.
livePlayerVC.delegate = self

Without a showId parameter, the player will display the first live show it finds.

5. Present it like you would any UIViewController

present(livePlayerVC, animated: true, completion: nil)

Example App

Checkout the example App provided in this repository to see a typical integration. With the test app, you can input your Organization api key and battle test your own environment.

Got a question? Found an issue?

Create a github issue and we'll help you from there ❤️

GitHub

link
Stars: 3
Last commit: 3 weeks ago

Release Notes

0.2.6-beta
3 weeks ago
  • Adds Support for featured products by the streamer during a livestream.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco