Android OpenTV Player SDK  5.21.1.1656233442
 All Classes Namespaces Functions Variables Pages
Watermark Class Reference

Detailed Description

Provides an interface to set up and control a unique watermark on the playback content, powered by the NexGuard-QuickMark SDK.

For further information on the NexGuard-QuickMark SDK please see the integration guide.

Watermark class handles the lifecycle interaction between the QuickMark SDK and the bound OTVVideoView player interface.

The minimum API for using the watermarking interface is 24. This is a minimum requirement from the QuickMark SDK.

Public Member Functions

 Watermark (@NonNull Context context)
 
void setToken (String token)
 Sets the customer system generated token to the Watermark. More...
 
void setUrl (@NonNull String url)
 
void setTenant (String tenant)
 
void setApiKey (String apiKey)
 
void bind (@NonNull OTVVideoView player)
 Binds the Watermark to the passed OTVVideoView object after this call is made, the watermark will be active during playback of the passed OTVVideoView. More...
 
void unbind (@NonNull OTVVideoView player)
 Unbinds the Watermark to the passed OTVVideoView object after this call is made, the watermark will no longer be active during playback of the passed OTVVideoView. More...
 
void addErrorListener (WatermarkErrorListener listener)
 Add an object interfacing WatermarkErrorListener to the Watermark to handle error callbacks Playback of content should be limited based on errors reported. More...
 
void removeErrorListener (WatermarkErrorListener listener)
 Remove an object interfacing WatermarkErrorListener from the Watermark. More...
 
void addMessageListener (WatermarkMessageListener listener)
 Add an object interfacing WatermarkMessageListener to the Watermark to handle message callbacks. More...
 
void removeMessageListener (WatermarkMessageListener listener)
 Remove an object interfacing WatermarkMessageListener from the Watermark. More...
 
OTVVideoView boundPlayer ()
 Returns the instance of the OTVVideoView object which this Watermark is currently bound to. More...
 
void setSecretKey (@NonNull String secretKey)
 set secret key for computing the signature of a blob More...
 
void setSecretAlgorithm (@NonNull String algorithm)
 set algorithm for computing the signature of a blob More...
 
boolean setBlob (@NonNull byte[] blobData, boolean enableDTGMode)
 This method is only used in push mode to pass a blob to process. More...
 
String getSurfaceId ()
 Returns the surface Id of the latest blob processed by the Watermark instance. More...
 

Static Public Member Functions

static Watermark createInPullMode (@NonNull Context context,@NonNull String serverUrl,@NonNull String token,@Nullable String apiKey,@NonNull String secretKey)
 Creates a Watermark set up for pull mode. More...
 
static Watermark createInPushMode (@NonNull Context context,@NonNull String secretKey)
 Creates a Watermark set up for push mode. More...
 

Constructor & Destructor Documentation

Watermark ( @NonNull Context  context)
Parameters
contextThe context
Deprecated:
Default constructor for Watermark in pull mode

Member Function Documentation

void addErrorListener ( WatermarkErrorListener  listener)

Add an object interfacing WatermarkErrorListener to the Watermark to handle error callbacks Playback of content should be limited based on errors reported.

Parameters
listenera WatermarkErrorListener instance
void addMessageListener ( WatermarkMessageListener  listener)

Add an object interfacing WatermarkMessageListener to the Watermark to handle message callbacks.

Parameters
listenera WatermarkMessageListener instance
void bind ( @NonNull OTVVideoView  player)

Binds the Watermark to the passed OTVVideoView object after this call is made, the watermark will be active during playback of the passed OTVVideoView.

Parameters
playerthe OTVVideoView player instance
OTVVideoView boundPlayer ( )

Returns the instance of the OTVVideoView object which this Watermark is currently bound to.

Returns
the OTVVideoView player object currently bound to this Watermark instance
static Watermark createInPullMode ( @NonNull Context  context,
@NonNull String  serverUrl,
@NonNull String  token,
@Nullable String  apiKey,
@NonNull String  secretKey 
)
static

Creates a Watermark set up for pull mode.

Parameters
contextThe context
serverUrlthe URL of the WaterMark server
tokenthe token to pass in the request to the WaterMark server
apiKeythe optional API key to pass in the request to the WaterMark server
secretKeythe secret key for computing the signature of a blob
static Watermark createInPushMode ( @NonNull Context  context,
@NonNull String  secretKey 
)
static

Creates a Watermark set up for push mode.

Parameters
contextThe context
secretKeythe secret key for computing the signature of a blob
String getSurfaceId ( )

Returns the surface Id of the latest blob processed by the Watermark instance.

the return value can be null if an error occurs or no blob has been processed.

Returns
the surface Id
void removeErrorListener ( WatermarkErrorListener  listener)

Remove an object interfacing WatermarkErrorListener from the Watermark.

Parameters
listenera WatermarkErrorListener instance
void removeMessageListener ( WatermarkMessageListener  listener)

Remove an object interfacing WatermarkMessageListener from the Watermark.

Parameters
listenera WatermarkMessageListener instance
void setApiKey ( String  apiKey)
Parameters
apiKeythe string representation of the api key Sets the api key to the Watermark
Deprecated:
boolean setBlob ( @NonNull byte[]  blobData,
boolean  enableDTGMode 
)

This method is only used in push mode to pass a blob to process.

Parameters
blobDataa Watermark blob to process
enableDTGModetrue if enable Download To Go mode.
Returns
true if parsing the blob object successfully
void setSecretAlgorithm ( @NonNull String  algorithm)

set algorithm for computing the signature of a blob

Parameters
algorithmalgorithm name for computing the signature of a blob The default value is "HmacSHA1"
void setSecretKey ( @NonNull String  secretKey)

set secret key for computing the signature of a blob

Parameters
secretKeythe secret key for computing the signature of a blob
void setTenant ( String  tenant)
Deprecated:
Sets the tenant name to the Watermark

the string representation of the tenant name

void setToken ( String  token)

Sets the customer system generated token to the Watermark.

Parameters
tokenthe string representation of the token
void setUrl ( @NonNull String  url)
Parameters
urlthe string representation of the service endpoint URL
Deprecated:
Sets the service endpoint URL to the Watermark
void unbind ( @NonNull OTVVideoView  player)

Unbinds the Watermark to the passed OTVVideoView object after this call is made, the watermark will no longer be active during playback of the passed OTVVideoView.

Parameters
playerthe OTVVideoView player instance