Android OpenTV Player SDK
5.21.1.1656233442
|
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... | |
Watermark | ( | @NonNull Context | context | ) |
context | The context |
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.
listener | a WatermarkErrorListener instance |
void addMessageListener | ( | WatermarkMessageListener | listener | ) |
Add an object interfacing WatermarkMessageListener to the Watermark to handle message callbacks.
listener | a 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.
player | the OTVVideoView player instance |
OTVVideoView boundPlayer | ( | ) |
Returns the instance of the OTVVideoView object which this Watermark is currently bound to.
|
static |
Creates a Watermark set up for pull mode.
context | The context |
serverUrl | the URL of the WaterMark server |
token | the token to pass in the request to the WaterMark server |
apiKey | the optional API key to pass in the request to the WaterMark server |
secretKey | the secret key for computing the signature of a blob |
|
static |
Creates a Watermark set up for push mode.
context | The context |
secretKey | the 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.
void removeErrorListener | ( | WatermarkErrorListener | listener | ) |
Remove an object interfacing WatermarkErrorListener from the Watermark.
listener | a WatermarkErrorListener instance |
void removeMessageListener | ( | WatermarkMessageListener | listener | ) |
Remove an object interfacing WatermarkMessageListener from the Watermark.
listener | a WatermarkMessageListener instance |
void setApiKey | ( | String | apiKey | ) |
apiKey | the string representation of the api key Sets the api key to the Watermark |
boolean setBlob | ( | @NonNull byte[] | blobData, |
boolean | enableDTGMode | ||
) |
This method is only used in push mode to pass a blob to process.
blobData | a Watermark blob to process |
enableDTGMode | true if enable Download To Go mode. |
void setSecretAlgorithm | ( | @NonNull String | algorithm | ) |
set algorithm for computing the signature of a blob
algorithm | algorithm 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
secretKey | the secret key for computing the signature of a blob |
void setTenant | ( | String | tenant | ) |
the string representation of the tenant name
void setToken | ( | String | token | ) |
Sets the customer system generated token to the Watermark.
token | the string representation of the token |
void setUrl | ( | @NonNull String | url | ) |
url | the string representation of the service endpoint URL |
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.
player | the OTVVideoView player instance |