Skip to content

v0.1.18

Compare
Choose a tag to compare
@gal-orlanczyk gal-orlanczyk released this 06 Mar 15:18
· 417 commits to develop since this release

New Features

  • Added support for mp3 files.

Breaking Changes

This release contains a few breaking changes so please pay attention.

Error Handling

Added error handling and updated documentation.
Better error handling on player objects, you can now receive errors when the player failed to load and observe errors on the player or the plugins.

Objective-C Before:

self.kPlayer = [PlayKitManager.sharedInstance loadPlayerWithPluginConfig: pluginConfig];

Objective-C After:

NSError *error = nil;
self.kPlayer = [PlayKitManager.sharedInstance loadPlayerWithPluginConfig: pluginConfig error: &error];

if (error) {
    // handle error
    if (error.code == PKErrorCode.FailedToCreatePlugin) {
        // handle failed to create plugin
    } else if (error.code == PKErrorCode.MissingPluginConfig) {
        // handle missing plugin config
    }
}

Swift Before:

player = try PlayKitManager.shared.loadPlayer(pluginConfig: pluginConfig)

Swift After:

do {
    player = try PlayKitManager.shared.loadPlayer(pluginConfig: pluginConfig)
} catch let e {
    // handle error
    if e.code == PKErrorCode.failedToCreatePlugin {
        // handle failed to create plugin
    } else if e.code == PKErrorCode.missingPluginConfig {
        // handle missing plugin config
    }
}

For full details on error handling look here

Cocoapods

https://cocoapods.org/pods/PlayKit