The PodigeeEmbedKit framework allows you to display information about a podcast hosted on podigee.com in your iOS, macOS or tvOS app. You can get data for the most recent published episode, a specific episode and even a playlist of all published episodes.
The PodigeeEmbedKit MUST only be used with a Podigee Enterprise License.
If you're interested in sales, check out Podigee for Professionals
- iOS 10.0+ / Mac OS X 10.10+ / tvOS 10.0+ / watchOS 3.0+
- Swift 5.0+ / Xcode 10.2+
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapodsTo integrate PodigeeEmbedKit into your Xcode project using CocoaPods, specify it in your Podfile:
platform:ios,'10.0'use_frameworks!pod'PodigeeEmbedKit',:git=>'https://github.com/podigee/PodigeeEmbedKit.git',:branch=>'master'You have to link to the Github repository directly, because it is not publically available in the Cocoapods directory.
Then, run the following command:
$ pod installCarthage
Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthageTo integrate PodigeeEmbedKit into your Xcode project using Carthage, specify it in your Cartfile:
github "podigee/PodigeeEmbedKit" ~> 1.1.0
Swift Package Manager
To use PodigeeEmbedKit as a Swift Package Manager package just add the following in your Package.swift file.
// swift-tools-version:4.2
import PackageDescription
letpackage=Package(
name:"HelloPodigeeEmbedKit",
dependencies:[.package(url:"https://github.com/podigee/PodigeeEmbedKit.git",.upToNextMajor(from:"1.1.0"))],
targets:[.target(name:"HelloPodigeeEmbedKit", dependencies:["PodigeeEmbedKit"])])When you request data you always have to provide the domain of the podcast hosted on Podigee. The domain format is podcast-specific-subdomain.podigee.io, e.g. podcast-news.podigee.io.
Requesting embed data returns
- Podcast Metadata
- Episode Metadata
- Extension settings
If you do not define a specific episode this will return metadata for the most recently published episode of this podcast.
letpodcastDomain="podcast-news.podigee.io"PodigeeEmbedKit.embedDataForPodcastWith(domain: podcastDomain){ result inswitch result {case.failure(let error):breakcase.success(let podcastEmbed):letpodcastTitle= podcastEmbed.podcast.title
letepisode= podcastEmbed.episode
letepisodeTitle= episode.title
letmp3Url= episode.media.mp3 }}The podcastEmbed struct which is returned is defined like this:
publicstructPodcastEmbed:Codable{publicletepisode:Episode?publicletpodcast:Podcastpublicletextensions:Extensions}Extensions include several boolean toggles which can be defined in the Podigee webinterface for external player embeds. Using these settings you can define if the player should show a download button, or the chapter marks for example. It is up to you to use these toggles to actually have an effect on your UI.
Please take a look at the full API documentation for more information.
Handling coverart images
When you want to display a coverart image you can request a specific image size from the API. All coverart images are squares so you only define a custom width.
letepisode= podcastEmbed?.episode
leturl= episode.coverartUrlFor(width:720)You can also request embed information for a specific episode of a podcast. In this case you have to provide the episodePath in addidation to the podcast domain. In this case the path to the episode is 7-podcatcher-in-the-rye.
PodigeeEmbedKit.embedDataForPodcastWith(domain:"podcast-news.podigee.io", episodePath:"7-podcatcher-in-the-rye", complete:{ result inswitch result {case.failure(let error):breakcase.success(let podcastEmbed):lettitle= podcastEmbed?.episode?.title
letsubtitle= podcastEmbed?.episode?.subtitle
letnumber= podcastEmbed?.episode?.number
}})You can also request a list of published episodes. By default this returns the last 10 episodes of the podcast sorted by publish date.
PodigeeEmbedKit.playlistForPodcastWith(domain:"podcast-news.podigee.io", complete:{ result inswitch result {case.failure(let error):breakcase.success(let playlist):letepisodes= playlist.episodes
forepisodein episodes {print(episode.title)}}})Paging
If you need more episodes you can use the paging parameters pageSize and offset to request episodes using multiple requests.
// fetch first 5 episodes
PodigeeEmbedKit.playlistForPodcastWith(domain:"podcast-news.podigee.io", pageSize:5, offset:0, complete:{ result inletplaylist=try? result.get()letepisodes= playlist?.episodes
})
// fetch next 5 episodes
PodigeeEmbedKit.playlistForPodcastWith(domain:"podcast-news.podigee.io", pageSize:5, offset:5, complete:{ result inletplaylist=try? result.get()letepisodes= playlist?.episodes
})The returned episodes count only matches the requested pagesSize if the podcast does have enough published episodes.
Sorting
Episodes can either be sorted by publish date or by episode number. If you do not set the sorting algorithm yourself the episodes are sorted by publish date by default.
PodigeeEmbedKit.playlistForPodcastWith(domain:"podcast-news.podigee.io", sortBy:.episodeNumber, complete:{ result inletplaylist=try? result.get()letepisodes= playlist?.episodes
})You can find the full API documentation in the docs folder:
- Download and extract the repository contents
- Open
docs/index.html
There also is a simple iOS demo project to demonstrate how this framework can be used to display podcast and episode content in an iOS app. You can find the repository of the demo project here.
Podigee @podigee
PodigeeEmbedKit is released under the MIT license. See LICENSE for details.