Swiftpack.co - pbj-apps/Live-ios-sdk as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by pbj-apps.
pbj-apps/Live-ios-sdk 0.6.2
Stream your PBJ.live content from your iOS App.
⭐️ 6
🕓 20 weeks ago
.package(url: "https://github.com/pbj-apps/Live-ios-sdk.git", from: "0.6.2")

Live Player

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

Stream your Live content from your iOS App.


The Live iOS SDK enables you to display your Live content inside your iOS App. The live SDK package is separated in two distinct targets: Live which contains all the "core" code and LiveUI containing UI elements.


In Xcode, select File > Swift packages > Add Package Dependency
and enter Live SDK github url below:



You need to initialize the Live SDK with your credentials on App start.
A good place to do this is typically the AppDelegate.

import Live

// [...]
let live = LiveSDK.initialize(
   apiKey: "YOUR_API_KEY",
   environment: .dev,
   logLevels: .debug)
  • environment is optional and defaults to .prod.
  • logLevels is also optional and defaults to .off.

The whole Live api is accessed via this live object which exposes a classic Combine api returning AnyPublisher<Result, Error>


Before querying any data, you need to authenticate the SDK. This process is asynchonous.

   .sink { 
      // SDK is now authenticated \o/
   .store(in: &cancellables)




Fetch all VoD Categories

live.fetchVodCategories().sink { categories in 
   // categories
.store(in: &cancellables)

Fetch a specific VoD Category

live.fetch(category: category).sink { category in 
   // category
.store(in: &cancellables)


Fetch all playlists

live.fetchVodPlaylists().sink { playlists in 
   // playlists
.store(in: &cancellables)

Fetch a specific playlist

live.fetch(playlist: playlist).sink { playlist in 
   // playlist
.store(in: &cancellables)


Fetch all VoD Videos

live.fetchVodVideos().sink { videos in 
   // videos
.store(in: &cancellables)

Fetch a specific VoD Video

live.fetch(video: vodVideo).sink { video in 
  // video
.store(in: &cancellables)


Search Vod Videos only

live.searchVodVideos(query: query).sink { videos in 
   // videos
.store(in: &cancellables)

Search Vod Videos & Playlists

live.searchVod(query: query).sink { vodItems in 
   // vodItems (VodVideo & VodPlaylist)
.store(in: &cancellables)



Fetch all episodes

live.fetchEpisodes().sink { episodes in 
   // episodes
.store(in: &cancellables)

Fetch a specific episode

live.fetch(episode: Episode).sink { episode in 
   // episode
.store(in: &cancellables)

UI Components

In order to have access to UI elements, you will need to import LiveUI.

UI components provided are 100% build with SwiftUI. For apps that haven't made the switch yet, we also provide a UIKit compatible api.

Live Player


LivePlayer(episode: episode, close: { })


let livePlayerVC = LivePlayerViewController(episode: episode)
livePlayerVC.delegate = self
present(livePlayerVC, animated: true, completion: nil)

Here showId is optional and without it, it would play the first live stream found.

VOD Player


VodPlayer(url: vodUrl, close: {})


let vodPlayerVC = VodPlayerViewController(url: vodUrl)
vodPlayerVC.delegate = self
present(vodPlayerVC, 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 ❤️


Stars: 6
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

20 weeks ago

Add product external id

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