-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* SimpleOVPMediaProvider: simplify common OVP use cases. And a minor fix to OVPSessionManager's init. * Minor warning fixes. * Replaced Simple MediaEntryProvider with a Simple SessionProvider. This approach is more versatile, and allows other components to use the simple session provider. * Fixed typo (startAnonymouseSession ==> startAnonymousSession).
- Loading branch information
Showing
9 changed files
with
62 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// Created by Noam Tamim on 09/02/2017. | ||
// | ||
// | ||
|
||
import UIKit | ||
|
||
/** | ||
A SessionProvider that just reflects its input parameters -- baseUrl, partnerId, ks. | ||
Unlike the full OVPSessionManager, this class does not attempt to manage (create, renew, validate, clear) a session. | ||
The application is expected to provide a valid KS, which it can update as required via the `ks` property. For some | ||
use cases, the KS can be null (anonymous media playback, if allowed by access-control). Basic usage with a OVPMediaProvider: | ||
let mediaProvider = OVPMediaProvider(SimpleOVPSessionProvider(serverURL: "https://cdnapisec.kaltura.com", | ||
partnerId: 1851571, | ||
ks: applicationKS)) | ||
mediaProvider.set(entryId: "0_pl5lbfo0").loadMedia { (entry) in | ||
print("entry:", entry.data ?? "<nil>") | ||
} | ||
*/ | ||
public class SimpleOVPSessionProvider: SessionProvider { | ||
public let serverURL: String | ||
public let partnerId: Int64 | ||
public var ks: String? | ||
|
||
/** | ||
Build an OVP SessionProvider with the specified parameters. | ||
- Parameters: | ||
- serverURL: Kaltura Server URL, such as `"https://cdnapisec.kaltura.com"`. | ||
- partnerId: Kaltura partner id. | ||
- ks: Kaltura Session token. | ||
*/ | ||
public init(serverURL: String, partnerId: Int64, ks: String?) { | ||
self.serverURL = serverURL | ||
self.partnerId = partnerId | ||
self.ks = ks | ||
} | ||
|
||
public func loadKS(completion: @escaping (Result<String>) -> Void) { | ||
completion(Result(data: ks, error: nil)) | ||
} | ||
} |