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() -> String

    Return 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.badQuickMarkInit if bad parameter for pull mode or push mode.
    • QMError tokenStringIsEmpty if the token parameter contains an empty string
    • QMError.urlStringIsEmpty if the url parameter contains an empty string when the instance is configured in pull mode
    • QMError.urlStringIsNotAnUrl if 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 mode
    • QMError.urlSchemeIsNotHttps if 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.badQuickMarkInit if bad parameter for pull mode or push mode.
    • QMError tokenStringIsEmpty if the token parameter contains an empty string
    • QMError.urlStringIsEmpty if the url parameter contains an empty string when the instance is configured in pull mode
    • QMError.urlStringIsNotAnUrl if 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 mode
    • QMError.urlSchemeIsNotHttps if 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) throws

    Parameters

    token

    An optional token string that contains the Wartermark identifier. The format of the string depend of the QuickMark server deployment (clear, JWT/ …)

    apiKey

    An optional API key string that depends of the QuickMark server deployment

    url

    An optionnal Url of the QuickMark server endpoint. This parameter depends of the QuickMark server deployment

    computeSignatureCb

    A 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

    inputBuffer

    Buffer that contains imput data to sign

    saveBlobCb

    A optional closure that allows to save the last recieved blob

    blobBuffer

    Buffer that contains input data to save

    errorCb

    A closure that handle asynchronous error from the QuickMarkView.

    errorId

    The QuickMark error code

    errorMessage

    A string that contains error message

    messageCb

    An optional closure that handle the debug information. This closure should be set only for debug purpose.

    debugMessage

    A 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.badQuickMarkInit if bad parameter for pull mode or push mode.
    • QMError tokenStringIsEmpty if the token parameter contains an empty string
    • QMError.urlStringIsEmpty if the url parameter contains an empty string when the instance is configured in pull mode
    • QMError.urlStringIsNotAnUrl if 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 mode
    • QMError.urlSchemeIsNotHttps if 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

QuickMarkview API

  • Throws

    • QMError badQuickMarkViewInit if the QuickMarkView is not well initialized
    • QMError setTokenForbidden if this method is called with a push mode instance
    • QMError tokenStringIsEmpty if the newvalue string is empty
    • QMError startFailed if the network request failed after token changed

    Declaration

    Swift

    @objc
    public func setToken(newValue: String) throws

    Parameters

    newValue

    An 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 surfaceID query parameter when the QuickMark Network service make a surface request

    Throws

    • QMError badQuickMarkViewInit if the QuickMarkView is not well initialized

    Declaration

    Swift

    @objc
    public func disableBandwithReduction() throws
  • Start the communication with the QuickMark server in pull mode only

    Throws

    • QMError badQuickMarkViewInit if the QuickMarkView is not well initialized
    • QMError badQuickMarkInit if the QuickMarkHelper is not well initialized
    • QMError.startForbiddenwhen the start method is called when the QuickMark view is initialized in push mode
    • QMError.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 badQuickMarkViewInit if the QuickMarkView is not well initialized
    • QMError badQuickMarkInit if the QuickMarkHelper is 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 badQuickMarkViewInit if the QuickMarkView is not well initialized
    • QMError badQuickMarkInit if the QuickMarkHelper is 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 enableDTGMode flag is enable

    Throws

    Declaration

    Swift

    @objc
    public func updateBlob(blobData: Data, enableDTGMode: Bool = false) throws

    Parameters

    blobData

    blob buffer from QuickMark Server or FileSystem

    enableDTGMode

    true 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 nil if error or no surface Id

  • Declaration

    Swift

    public override func observeValue(forKeyPath keyPath: String?,
                                      of object: Any?,
                                      change: [NSKeyValueChangeKey : Any]?,
                                      context: UnsafeMutableRawPointer?)

Callback

  • 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

    playerView

    The UIView in which the OTVQuickmarkView needs to be binded to

    playerLayer

    The 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()