OTVQuickmark
public class OTVQuickmark : NSObject
Integration Nexguard watermark support on iOS Platform.
-
Can improve the postion of the watermark when using SwiftUI. If you are not using SwiftUI please do not use. Defaults to false.
Declaration
Swift
public var usingSwiftUI: Bool -
MARK: Static API Return the version of SDK
This static method return the version of the SDK
Declaration
Swift
@objc public static func getVersion() -> StringReturn Value
A string with the version of the SDK.
-
Returns a QuickMark view initialized with the specified token, url and an apikey for push or pull mode with interally handheld closures for computeSignatureCb, saveBlobCb, errorCb and messageCb. If token, apiKey and url are nil then its assumed that you are in push mode.
Throws
QMError.badQuickMarkInitif bad parameter for pull mode or push mode.QMError tokenStringIsEmptyif thetokenparameter contains an empty stringQMError.urlStringIsEmptyif theurlparameter contains an empty string when the instance is configured in pull modeQMError.urlStringIsNotAnUrlif the string is a malformed URL: no host, bad character (the url string don’t follow RFC 3986) when the instance is configured in pull modeQMError.urlSchemeIsNotHttpsif the scheme of the url is not https when the instance is configured in pull mode
Declaration
Swift
@objc public init(token: String? = nil, apiKey: String? = nil, url: String? = nil) throws -
Returns a QuickMark view initialized with the specified token, url and an apikey for pull mode and externally handheld closures for computeSignatureCb, saveBlobCb, errorCb and messageCb.
Throws
QMError.badQuickMarkInitif bad parameter for pull mode or push mode.QMError tokenStringIsEmptyif thetokenparameter contains an empty stringQMError.urlStringIsEmptyif theurlparameter contains an empty string when the instance is configured in pull modeQMError.urlStringIsNotAnUrlif the string is a malformed URL: no host, bad character (the url string don’t follow RFC 3986) when the instance is configured in pull modeQMError.urlSchemeIsNotHttpsif the scheme of the url is not https when the instance is configured in pull mode
Declaration
Swift
@objc public init(token: String, apiKey: String, url: String, computeSignatureCb: @escaping (_ inputBuffer: Data) -> Data, saveBlobCb: ((_ blobBuffer: Data) -> Void)? = nil, errorCb: @escaping (_ errorId: QMErrorCode, _ errorMessage: String) -> Void, messageCb: ((_ debugMessage: String) -> Void)? = nil) throwsParameters
tokenAn optional token string that contains the Wartermark identifier. The format of the string depend of the QuickMark server deployment (clear, JWT/ …)
apiKeyAn optional API key string that depends of the QuickMark server deployment
urlAn optionnal Url of the QuickMark server endpoint. This parameter depends of the QuickMark server deployment
computeSignatureCbA closure that compute the signature of a Data buffer and return a signature Data buffer. The implementation of the closure depends of the server deployment and the signature Algorithm used by the server
inputBufferBuffer that contains imput data to sign
saveBlobCbA optional closure that allows to save the last recieved blob
blobBufferBuffer that contains input data to save
errorCbA closure that handle asynchronous error from the QuickMarkView.
errorIdThe QuickMark error code
errorMessageA string that contains error message
messageCbAn optional closure that handle the debug information. This closure should be set only for debug purpose.
debugMessageA string that contains debug information
-
Returns a QuickMark view initialized for push mode and externally handheld closures for computeSignatureCb, saveBlobCb, errorCb and messageCb
Throws
QMError.badQuickMarkInitif bad parameter for pull mode or push mode.QMError tokenStringIsEmptyif thetokenparameter contains an empty stringQMError.urlStringIsEmptyif theurlparameter contains an empty string when the instance is configured in pull modeQMError.urlStringIsNotAnUrlif the string is a malformed URL: no host, bad character (the url string don’t follow RFC 3986) when the instance is configured in pull modeQMError.urlSchemeIsNotHttpsif the scheme of the url is not https when the instance is configured in pull mode
Declaration
Swift
@objc public init(computeSignatureCb: @escaping (_ inputBuffer: Data) -> Data, saveBlobCb: ((_ blobBuffer: Data) -> Void)? = nil, errorCb: @escaping (_ errorId: QMErrorCode, _ errorMessage: String) -> Void, messageCb: ((_ debugMessage: String) -> Void)? = nil) throws
-
Throws
QMError badQuickMarkViewInitif theQuickMarkViewis not well initializedQMError setTokenForbiddenif this method is called with a push mode instanceQMError tokenStringIsEmptyif thenewvaluestring is emptyQMError startFailedif the network request failed after token changed
Declaration
Swift
@objc public func setToken(newValue: String) throwsParameters
newValueAn token string that contains the Wartermark identifier
-
Declaration
Swift
@objc public func setSignKey(signKey: String) -
Disable the bandwidth reduction for the communication with the QuickMark server in pull mode only
This method allows to remove the
surfaceIDquery parameter when the QuickMark Network service make a surface requestThrows
QMError badQuickMarkViewInitif theQuickMarkViewis not well initialized
Declaration
Swift
@objc public func disableBandwithReduction() throws -
Start the communication with the QuickMark server in pull mode only
Throws
QMError badQuickMarkViewInitif theQuickMarkViewis not well initializedQMError badQuickMarkInitif theQuickMarkHelperis not well initializedQMError.startForbiddenwhen the start method is called when the QuickMark view is initialized in push modeQMError.startFailedwhen an errors occurs in the QuickMark network service
Declaration
Swift
@objc public func start() throws -
Pause the Quickmark surface Image updating and the network service when the QuickMark view is initialized in pull mode
This method stops timers of the timelime manager (QuickMarkCore). The image is hidden during the pause. The PNG surface is not updated until the timeline is resumed In pull mode the network service is paused also.
Throws
QMError badQuickMarkViewInitif theQuickMarkViewis not well initializedQMError badQuickMarkInitif theQuickMarkHelperis not well initialized
Declaration
Swift
@objc public func pauseTimeline() throws -
Resume the Quickmark surface Image updating and the network service when the QuickMark view is initialized in pull mode
This method resumes the refresh timer of the image view and the network service is also resumed sif the instance is configured in pull mode
Throws
QMError badQuickMarkViewInitif theQuickMarkViewis not well initializedQMError badQuickMarkInitif theQuickMarkHelperis not well initialized
Declaration
Swift
@objc public func resumeTimeline() throws -
Update blob data for push mode or Download to go
This method allows to update the blob in push mode or in Download To Go. The blob validation is disabled if the
enableDTGModeflag is enableThrows
QMError badQuickMarkViewInitif theQuickMarkViewis not well initializedQMError badQuickMarkInitif theQuickMarkHelperis not well initializedQMError updateBlobForbiddenif this method is called with an instance configured in push modeQMError.blobTooLargeif blob size is larger than 2 MBQMError.blobIsEmptyif blob size is equal to 0QMError.blobIsNotValidYetif the current time is before the blob validity period. Don’t occure if antireplayDisable flag is trueQMError.blobHasExpiredif the current time is after the blob validity period. Don’t occure if antireplayDisable flag is trueQMError.blobHasEmptyTimelineif the blob don’t contain timeline messageQMError.blobHasEmptyTimelineEntryif the blob don’t contain any timeline entry. This error occurs only with a full blobQMError.undefinedPreviousSurfaceIdif the previous surface Id is nilQMError.inconsistentSurfaceIdif the previous surface Id isn’t consistent with the blob surfaceIdQMError.blobProtobuffParsingErrorif blobData deserialization failedQMError.blobIsEmptyif blob size is equal to 0
Declaration
Swift
@objc public func updateBlob(blobData: Data, enableDTGMode: Bool = false) throwsParameters
blobDatablob buffer from QuickMark Server or FileSystem
enableDTGModetrue enable parsing of blob for Downlod to go
-
Return the surfaceId of the latest parsed blob (nil if none)
Declaration
Swift
@objc public func getSurfaceId() -> String?Return Value
return a string that identify a blob. Could be
nilif error or no surface Id -
Declaration
Swift
public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?)
-
Bind OTVQuickmarkView to the playerView and AVPlayerLayer provided.
This method allows the OTVQuickmarkView to bind to the playerView provided It also enables OTVQuickmarkView to mointor the state of playback of the player being used. It also allows the OTVQuickmarkView to follow the videoRect of the content being played and adjust to screen rotation.
Declaration
Swift
@objc public func bind(playerView: UIView, playerLayer: AVPlayerLayer)Parameters
playerViewThe UIView in which the OTVQuickmarkView needs to be binded to
playerLayerThe AVPlayerLayer of the content that is being played with.
-
unbind OTVQuickmarkView from the UIView passed in from the bind function.
This method allows the OTVQuickmarkView to unbindded from the UIView (playerView) provided
Declaration
Swift
@objc public func unbind()
OTVQuickmark Class Reference