Tizen WASM Player
Tizen TV WebAssembly Media Player extension allowing for a low-level elementary media stream playback.
samsung::wasm::MediaKey Class Referencefinal

Class representing an instance of media keys used to decrypt content. More...

#include <media_key.h>

Public Types

using SetupFinishedCallback = std::function< void(OperationResult, MediaKey)>
 

Public Member Functions

 MediaKey ()
 
 MediaKey (const MediaKey &)=delete
 
 MediaKey (MediaKey &&other)
 
MediaKeyoperator= (const MediaKey &)=delete
 
MediaKeyoperator= (MediaKey &&)
 
 ~MediaKey ()
 
bool IsValid () const
 

Static Public Member Functions

static Result< void > SetupEncryption (const DRMConfig &config, SetupFinishedCallback on_finished)
 

Friends

class ElementaryMediaTrack
 

Detailed Description

Class representing an instance of media keys used to decrypt content.

Definition at line 71 of file media_key.h.

Member Typedef Documentation

◆ SetupFinishedCallback

Definition at line 73 of file media_key.h.

Constructor & Destructor Documentation

◆ MediaKey() [1/3]

samsung::wasm::MediaKey::MediaKey ( )

Default constructor, creates an invalid MediaKey object. A valid MediaKey object can be created with MediaKey::SetupEncryption().

◆ MediaKey() [2/3]

samsung::wasm::MediaKey::MediaKey ( const MediaKey )
delete

◆ MediaKey() [3/3]

samsung::wasm::MediaKey::MediaKey ( MediaKey &&  other)

◆ ~MediaKey()

samsung::wasm::MediaKey::~MediaKey ( )

Member Function Documentation

◆ IsValid()

bool samsung::wasm::MediaKey::IsValid ( ) const

Returns true if this instance is valid. This method should be called after constructor to ensure the object was initialized properly. If object is invalid all method calls will fail.

Returns
true if this instance is valid, otherwise false.

◆ operator=() [1/2]

MediaKey& samsung::wasm::MediaKey::operator= ( const MediaKey )
delete

◆ operator=() [2/2]

MediaKey& samsung::wasm::MediaKey::operator= ( MediaKey &&  )

◆ SetupEncryption()

static Result<void> samsung::wasm::MediaKey::SetupEncryption ( const DRMConfig config,
SetupFinishedCallback  on_finished 
)
static

Asynchronously creates MediaKey instance and passes it as an argument to on_finished. If setting up the encryption fails, media keys won't be valid.

Parameters
[in]configAn object containing DRM's configuration.
[in]on_finishedA callback notifying end of encryption setup. The callback receives OperationResult informing of the result of the operation and a newly created MediaKeys object if no error occurred.
Returns
Result<void> with operation_result field set to OperationResult::kSuccess on success, otherwise a code describing the error.

Friends And Related Function Documentation

◆ ElementaryMediaTrack

friend class ElementaryMediaTrack
friend

Definition at line 114 of file media_key.h.


The documentation for this class was generated from the following file: