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

Allows receiving ElementaryMediaTrack events. More...

#include <elementary_media_track_listener.h>

Public Member Functions

virtual ~ElementaryMediaTrackListener ()=default
 
virtual void OnTrackOpen ()
 Fired when the track is ready to accept data. More...
 
virtual void OnTrackClosed (ElementaryMediaTrack::CloseReason)
 
virtual void OnSeek (Seconds)
 
virtual void OnSessionIdChanged (SessionId)
 
virtual void OnAppendError (OperationResult)
 

Detailed Description

Allows receiving ElementaryMediaTrack events.

ElementaryMediaTrack events are delivered via this interface when a listener is registered by ElementaryMediaTrack::SetListener().

See also
ElementaryMediaTrack

Definition at line 25 of file elementary_media_track_listener.h.

Constructor & Destructor Documentation

◆ ~ElementaryMediaTrackListener()

virtual samsung::wasm::ElementaryMediaTrackListener::~ElementaryMediaTrackListener ( )
virtualdefault

Member Function Documentation

◆ OnAppendError()

virtual void samsung::wasm::ElementaryMediaTrackListener::OnAppendError ( OperationResult  )
inlinevirtual

Fired when one of async append methods fail:

Parameters
[in]operation_resultError code representing append error.

Definition at line 95 of file elementary_media_track_listener.h.

◆ OnSeek()

virtual void samsung::wasm::ElementaryMediaTrackListener::OnSeek ( Seconds  )
inlinevirtual

Fired when an associated html::HTMLMediaElement is seeking. This is a result of either a call to html::HTMLMediaElement::SetCurrentTime() or direct user interaction with HTMLMediaElement with controls enabled. New playback time is delivered as an argument to this function.

Seek sequence:

  1. If track is open: ElementaryMediaTrackListener::OnTrackClosed() is fired with a reason argument set to ElementaryMediaTrack::CloseReason::kTrackSeeking.
  2. ElementaryMediaTrackListener::OnSessionIdChanged() is fired indicating the beginning of a new session. Packets with the old SessionId are dropped by the backend. This may fire multiple times if multiple seek operations were performed in a close succession
  3. ElementaryMediaTrackListener::OnSeek() is fired with an argument set to a new playback time. This event may fire multiple times if multiple seek operations were performed in a close succession.
  4. If track was open prior seek operation: ElementaryMediaTrackListener::OnTrackOpen() is fired.

If an associated ElementaryMediaStreamSource is in the ElementaryMediaStreamSource::ReadyState::kOpen state when seeking occurs, it will change it's state to ElementaryMediaStreamSource::ReadyState::kOpenPending for the duration of the sequence above.

Please note this event doesn't fire at the same time that html::HTMLMediaElement's seeking and seeked events. A source of media data should use this event to seek to the new playback position.

Parameters
[in]new_timeA time to which the seek is being performed.
See also
SessionId

Definition at line 71 of file elementary_media_track_listener.h.

◆ OnSessionIdChanged()

virtual void samsung::wasm::ElementaryMediaTrackListener::OnSessionIdChanged ( SessionId  )
inlinevirtual

Fired when id of the current session is changed, which happens when track is closed.

Remarks
This event allows application to efficiently track sessions (as opposed to ElementaryMediaTrack::GetSessionId(), which should be used only to obtain an initial value of session_id).
Parameters
[in]session_idId of new session.
See also
SessionId
ElementaryMediaPacket::session_id
ElementaryMediaTrackListener::OnSeek()

Definition at line 86 of file elementary_media_track_listener.h.

◆ OnTrackClosed()

virtual void samsung::wasm::ElementaryMediaTrackListener::OnTrackClosed ( ElementaryMediaTrack::CloseReason  )
inlinevirtual

Fired when an associated source enters a state that makes this track unable of accepting data. A reason for closing the track is passed as an argument.

Parameters
[in]close_reasonA reason for closing this track.

Definition at line 37 of file elementary_media_track_listener.h.

◆ OnTrackOpen()

virtual void samsung::wasm::ElementaryMediaTrackListener::OnTrackOpen ( )
inlinevirtual

Fired when the track is ready to accept data.

Definition at line 30 of file elementary_media_track_listener.h.


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