OTVSSPLicenseDelegate
public class OTVSSPLicenseDelegate : OTVCommonLicenseDelegate
OTVSSPLicenseDelegate
is a default implementation of SSP with SSM Service.
-
Set the type for the HTTP requesting headers
Declaration
Swift
@objc public func setHTTPHeaderType(type: String)
Parameters
type
String value of HTTP header type. Defaults to nv-authorizations. If an empty string is passed it was also default to nv-authorizations
-
Creates an instance of
OTVSSPLicenceDelegate
.Declaration
Swift
@objc public init(certificateURL: URL, licenseURL: URL, ssmServerURL: URL?, syncSSMSetupTeardown: Bool)
Parameters
certificateURL
URL of certificate file.
licenseURL
URL of license request.
ssmServerURL
Optional URL of SSM service request. Default is nil if SSM service not required.
syncSSMSetupTeardown
If ssmServerURL is provided this defines whether the setup and teardown network requests block the main thread or not. Default is to block.
-
Creates an instance of
OTVSSPLicenceDelegate
.Declaration
Swift
@objc public convenience init(certificateURL: URL, licenseURL: URL, ssmServerURL: URL?)
Parameters
certificateURL
URL of certificate file.
licenseURL
URL of license request.
ssmServerURL
Optional URL of SSM service request.
-
Creates an instance of
OTVSSPLicenceDelegate
.Declaration
Swift
public convenience override init(certificateURL: URL, licenseURL: URL)
Parameters
certificateURL
URL of certificate file.
licenseURL
URL of license request.
-
Declaration
Swift
override public func generateHTTPHeaders(assetID: String) -> [String : String]?
-
Declaration
Swift
override public func getLicenseRequestUrl() -> URL
-
Declaration
Swift
override public func getCkcFromLicenseResponse(response: [String : Any]) -> String?
-
Declaration
Swift
public override func ckcMessageWith(spc: Data, assetID: String, session: AVContentKeySession, keyRequest: AVContentKeyRequest) -> Data?
-
Set the token and the url which associated with the stream.
Note
If repeated license request require a new media token please use setToken() as any repeated license request will use the original token set from this function.Declaration
Swift
@objc public func setStream(token: OTVMediaToken, with url: URL, success: @escaping () -> Void = { /* Default Empty Closure */ }, failure: @escaping () -> Void = { /* Default Empty Closure */ })
Parameters
token
the stream’s SSP specific media token.
url
URL of the stream.
success
closure for when the stream token and url are sucessfully set. Default to empty.
failure
closure for when the stream token and url fail to be set. Default to empty.
-
Application to set the initial stream token and callback which will be used by SDK to request for a new SSP content token, when a new license is requested.
Note
If repeated license requests do not need a new media token, please use setStream() as this function will request a new media token for each licnese request after the first.Declaration
Swift
@objc public func setToken(initialToken: OTVMediaToken, tokenCallback: @escaping () -> (String))
Parameters
initialToken
The stream’s SSP specific media token to be used for the initial playback
tokenCallback
Callback to be used to request the new media token. This callback is fired when a new licnese request is generated.