NaCl Player API
NaCl Player API Documentation
|
#include <media_player.h>
Public Types | |
enum | BindToDisplayMode { BindPlayerToDisplay, DoNotBindPlayerToDisplay } |
enum | MediaPlayerMode { MediaPlayerModeDefault, MediaPlayerModeD2TV } |
enum | MediaPlayerDisplayMode { MediaPlayerDisplayModeStretch = 0, MediaPlayerDisplayModeLetterbox = 1 } |
enum | MediaPlayerVr360Mode { MediaPlayerVr360ModeOff = 0, MediaPlayerVr360ModeOn = 1 } |
typedef std::vector< VideoTrackInfo > | VideoTracksList |
typedef std::vector< AudioTrackInfo > | AudioTracksList |
typedef std::vector< TextTrackInfo > | TextTracksList |
Public Member Functions | |
MediaPlayer (BindToDisplayMode=BindPlayerToDisplay, MediaPlayerMode=MediaPlayerModeDefault) | |
MediaPlayer (const MediaPlayer &other) | |
MediaPlayer & | operator= (const MediaPlayer &other) |
void | SetMediaEventsListener (MediaEventsListener *listener) |
void | SetMediaEventsListener (std::shared_ptr< MediaEventsListener > listener) |
void | SetSubtitleListener (SubtitleListener *listener) |
void | SetSubtitleListener (std::shared_ptr< SubtitleListener > listener) |
void | SetBufferingListener (BufferingListener *listener) |
void | SetBufferingListener (std::shared_ptr< BufferingListener > listner) |
void | SetDRMListener (DRMListener *listener) |
void | SetDRMListener (std::shared_ptr< DRMListener > listener) |
bool | BindToDisplay () |
int32_t | AttachDataSource (const MediaDataSource &data_source, const std::function< void(int32_t)> &callback) |
int32_t | AttachDataSource (const MediaDataSource &data_source) |
int32_t | Play (const std::function< void(int32_t)> &callback) |
int32_t | Play () |
int32_t | Pause (const std::function< void(int32_t)> &callback) |
int32_t | Pause () |
int32_t | Stop (const std::function< void(int32_t)> &callback) |
int32_t | Stop () |
int32_t | Seek (TimeTicks time, const std::function< void(int32_t)> &callback) |
int32_t | Seek (TimeTicks time) |
int32_t | SetPlaybackRate (double rate, const std::function< void(int32_t)> &callback) |
int32_t | SetPlaybackRate (double rate) |
int32_t | GetDuration (const std::function< void(int32_t, TimeDelta)> &callback) |
int32_t | GetDuration (TimeDelta &duration) |
int32_t | GetCurrentTime (const std::function< void(int32_t, TimeTicks)> &callback) |
int32_t | GetCurrentTime (TimeTicks ¤t_time) |
int32_t | GetPlayerState (const std::function< void(int32_t, MediaPlayerState)> &callback) |
int32_t | GetPlayerState (MediaPlayerState &) |
int32_t | GetCurrentVideoTrackInfo (const std::function< void(int32_t, const VideoTrackInfo &)> &callback) |
int32_t | GetCurrentVideoTrackInfo (VideoTrackInfo &) |
int32_t | GetVideoTracksList (const std::function< void(int32_t, const VideoTracksList &)> &callback) |
int32_t | GetVideoTracksList (VideoTracksList &) |
int32_t | GetCurrentAudioTrackInfo (const std::function< void(int32_t, const AudioTrackInfo &)> &callback) |
int32_t | GetCurrentAudioTrackInfo (AudioTrackInfo &) |
int32_t | GetAudioTracksList (const std::function< void(int32_t, const AudioTracksList &)> &callback) |
int32_t | GetAudioTracksList (AudioTracksList &) |
int32_t | GetCurrentTextTrackInfo (const std::function< void(int32_t, const TextTrackInfo &)> &callback) |
int32_t | GetCurrentTextTrackInfo (TextTrackInfo &) |
int32_t | GetTextTracksList (const std::function< void(int32_t, const TextTracksList &)> &callback) |
int32_t | GetTextTracksList (TextTracksList &) |
int32_t | SelectTrack (ElementaryStreamType track_type, uint32_t track_index, const std::function< void(int32_t)> &callback) |
int32_t | SelectTrack (ElementaryStreamType track_type, uint32_t track_index) |
int32_t | AddExternalSubtitles (const std::string &file_path, const std::string &encoding, const std::function< void(int32_t, const TextTrackInfo &)> &callback) |
int32_t | AddExternalSubtitles (const std::string &file_path, const std::string &encoding, TextTrackInfo &) |
int32_t | SetSubtitlesDelay (TimeDelta delay, const std::function< void(int32_t)> &callback) |
int32_t | SetSubtitlesDelay (TimeDelta delay) |
int32_t | SetDisplayRect (const Rect &rect, const std::function< void(int32_t)> &callback) |
int32_t | SetDisplayRect (const Rect &rect) |
int32_t | SetDisplayMode (MediaPlayerDisplayMode display_mode, const std::function< void(int32_t)> &callback) |
int32_t | SetVr360Mode (MediaPlayerVr360Mode display_mode, const std::function< void(int32_t)> &callback) |
int32_t | SetVr360Mode (MediaPlayerVr360Mode display_mode) |
int32_t | SetVr360Rotation (float horizontal_angle, float vertical_angle, const std::function< void(int32_t)> &callback) |
int32_t | SetVr360Rotation (float horizontal_angle, float vertical_angle) |
int32_t | SetVr360ZoomLevel (uint32_t zoom_level, const std::function< void(int32_t)> &callback) |
int32_t | SetVr360ZoomLevel (uint32_t zoom_level) |
int32_t | SetDisplayMode (MediaPlayerDisplayMode display_mode) |
int32_t | SetDRMSpecificData (DRMType drm_type, DRMOperation drm_operation, uint32_t drm_data_size, const void *drm_data, const std::function< void(int32_t)> &callback) |
int32_t | SetDRMSpecificData (DRMType drm_type, DRMOperation drm_operation, uint32_t drm_data_size, const void *drm_data) |
MediaPlayer
is type allowing application to control playback state, inquire about playback state. It's also responsible for assigning data source which will feed player with media data.
Assumptions:
PPB_Instance.BindGraphics
). Application must set proper CSS style for embed element with NaCl application (mostly transparent background).Some methods in this class are available in synchronous and asynchronous variant. Both versions perform the same action, the only difference is how results of those actions are reported to the caller. Asynchronous method propagates this result by a provided additional parameter callback
function.
Common constraints:
Definition at line 55 of file media_player.h.
An enum that controls whether the player should be bound to the display at creation. In most cases it should and the default constructor will do that. Only a bound player will display content in the defined area of the screen. However in some use cases (for example when MediaPlayer is used alongside the Pepper Compositor interface) creation of a player without binding it to the display will be needed. Such player can be then bound to the display by the BindToDisplay
method.
Definition at line 64 of file media_player.h.
An enum that controls Media Player display mode. For details, please see descriptions of particular enum values. A default value is MediaPlayerDisplayModeStretch
.
Enumerator | |
---|---|
MediaPlayerDisplayModeStretch | When this mode is set a video will be stretched to match either:
|
MediaPlayerDisplayModeLetterbox | When this mode is set a video will be scaled to fit a player area but will also maintain it's aspect ratio. If player area aspect ratio doesn't match video's aspect ratio, then resulting video will be letterboxed (or pillarboxed). |
Definition at line 82 of file media_player.h.
An enum that controls Media Player mode. Some non-trivial Media Player functions might be supported only if certain MediaPlayerMode
is set.
Definition at line 69 of file media_player.h.
An enum that controls Media Player Vr360 mode. For details, please see descriptions of particular enum values. A default value is PP_MEDIAPLAYERVR360MODE_OFF
.
Definition at line 99 of file media_player.h.
Samsung::NaClPlayer::MediaPlayer::MediaPlayer | ( | BindToDisplayMode | = BindPlayerToDisplay , |
MediaPlayerMode | = MediaPlayerModeDefault |
||
) |
Creates a player with given modes. Default values create a player that can be used in the most typical scenarios.
[in] | BindToDisplayMode | Create a player that is either bound to display or not. See BindToDisplayMode enum description for more details. |
[in] | MediaPlayerMode | Create a player that uses a specified playback mode. |
int32_t Samsung::NaClPlayer::MediaPlayer::AddExternalSubtitles | ( | const std::string & | file_path, |
const std::string & | encoding, | ||
const std::function< void(int32_t, const TextTrackInfo &)> & | callback | ||
) |
Adds external subtitles. Returns ErrorCodes::Success
in case of success and writes added text track information to |subtitles| param. After that newly added subtitles will be activated and SubtitleListener
will be notified about it's texts at the time those texts should be shown.
Please note that player is responsible only for subtitle file parsing. No subtitles are displayed by the player. Application can use SubtitleListener
to get subtitle texts at correct playback times and display them manually.
Constraints: Ability to add external subtitles after attaching data source is implementation dependent. If it is impossible to add external subtitles after data source is attached, this method will fail with ErrorCodes::NotSupported
error code. Therefore this method is guaranteed to succeed only before data source is attached.
[in] | file_path | A path of the subtitles. |
[in] | encoding | Subtitle encoding can be selected:
|
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::FileNotFound
- if provided file_path is invalid.ErrorCodes::BadArgument
- if provided encoding is invalid.ErrorCodes::NotSupported
- if method was called after attaching a data source and such operation is not supported on the current implementation. int32_t Samsung::NaClPlayer::MediaPlayer::AddExternalSubtitles | ( | const std::string & | file_path, |
const std::string & | encoding, | ||
TextTrackInfo & | |||
) |
Synchronously adds external subtitles.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::AttachDataSource | ( | const MediaDataSource & | data_source, |
const std::function< void(int32_t)> & | callback | ||
) |
Attaches the given MediaDataSource
to the player.
You can pass a NULL
object to detach currently attached data source. Reattaching data source will return ErrorCodes::Success
and do nothing.
Attached data source must be valid. Otherwise ErrorCodes::BadArgument
will be returned.
Attaching data source to the player will cause:
[in] | data_source | A MediaDataSource identifying data source to be attached to the player. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. int32_t Samsung::NaClPlayer::MediaPlayer::AttachDataSource | ( | const MediaDataSource & | data_source | ) |
Synchronously attaches the given MediaDataSource
to the player.
For detailed description
bool Samsung::NaClPlayer::MediaPlayer::BindToDisplay | ( | ) |
Binds an unbound player to the display. For more information see the BindToDisplayMode enum description.
int32_t Samsung::NaClPlayer::MediaPlayer::GetAudioTracksList | ( | const std::function< void(int32_t, const AudioTracksList &)> & | callback | ) |
Retrieves information of all audio tracks from the media played from the attached data source.
[in] | callback | A callback to be called upon completion with the list of audio tracks available in the currently attached data source. The list will be empty if the media played form the attached data source doesn't have any audio tracks. |
ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player. int32_t Samsung::NaClPlayer::MediaPlayer::GetAudioTracksList | ( | AudioTracksList & | ) |
Synchronously retrieves information of all audio tracks from the media played from the attached data source.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::GetCurrentAudioTrackInfo | ( | const std::function< void(int32_t, const AudioTrackInfo &)> & | callback | ) |
Retrieves information of the current audio track from the media played from the attached data source.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player.ErrorCodes::NotSupported
- if no video track is available in the media played from the attached data source. int32_t Samsung::NaClPlayer::MediaPlayer::GetCurrentAudioTrackInfo | ( | AudioTrackInfo & | ) |
Synchronously retrieves information of the current audio track from the media played from the attached data source.
For detailed description see description of asynchronous method (one with additional callback argument).
int32_t Samsung::NaClPlayer::MediaPlayer::GetCurrentTextTrackInfo | ( | const std::function< void(int32_t, const TextTrackInfo &)> & | callback | ) |
Retrieves information of the current text/subtitles track from the media played from the attached data source.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player.ErrorCodes::NotSupported
- if no video track is available in the media played from the attached data source. int32_t Samsung::NaClPlayer::MediaPlayer::GetCurrentTextTrackInfo | ( | TextTrackInfo & | ) |
Synchronously retrieves information of the current text/subtitles track from the media played from the attached data source.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::GetCurrentTime | ( | const std::function< void(int32_t, TimeTicks)> & | callback | ) |
Retrieves the current time/position of the media played from the attached data source.
This operation can be performed only if the media player is in MediaPlayerState_Playing
or MediaPlayerState_Paused
states.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player.ErrorCodes::NotSupported
- if the data can't be retrieved due to invalid player state. int32_t Samsung::NaClPlayer::MediaPlayer::GetCurrentTime | ( | TimeTicks & | current_time | ) |
Synchronously retrieves the current time/position of the media played from the attached data source.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::GetCurrentVideoTrackInfo | ( | const std::function< void(int32_t, const VideoTrackInfo &)> & | callback | ) |
Retrieves information of the current video track from the media played from the attached data source.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player.ErrorCodes::NotSupported
- if no video track is available in the media played from the attached data source. int32_t Samsung::NaClPlayer::MediaPlayer::GetCurrentVideoTrackInfo | ( | VideoTrackInfo & | ) |
Synchronously retrieves information of the current video track from the media played from the attached data source.
int32_t Samsung::NaClPlayer::MediaPlayer::GetDuration | ( | const std::function< void(int32_t, TimeDelta)> & | callback | ) |
Retrieves the duration of the media played from the attached data source.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player.ErrorCodes::NotSupported
- if the given operation is not supported by the attached data source (e.g. live content playback). int32_t Samsung::NaClPlayer::MediaPlayer::GetDuration | ( | TimeDelta & | duration | ) |
Synchronously retrieves the duration of the media played from the attached data source.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::GetPlayerState | ( | const std::function< void(int32_t, MediaPlayerState)> & | callback | ) |
Retrieves the current media player state.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. int32_t Samsung::NaClPlayer::MediaPlayer::GetPlayerState | ( | MediaPlayerState & | ) |
Synchronously retrieves the current media player state.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::GetTextTracksList | ( | const std::function< void(int32_t, const TextTracksList &)> & | callback | ) |
Retrieves information of all text/subtitles tracks from the media played from the attached data source.
[in] | callback | A callback to be called upon completion with the list of text/subtitles tracks available in the currently attached data source. The list will be empty if the media played form the attached data source doesn't have any text/subtitles tracks. |
ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player. int32_t Samsung::NaClPlayer::MediaPlayer::GetTextTracksList | ( | TextTracksList & | ) |
Synchronously retrieves information of all text/subtitles tracks from the media played from the attached data source.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::GetVideoTracksList | ( | const std::function< void(int32_t, const VideoTracksList &)> & | callback | ) |
Retrieves information of all video tracks from the media played from the attached data source.
[in] | callback | A callback to be called upon completion with the list of video tracks available in currently attached data source. The list will be empty if the media played form the attached data source doesn't have any video tracks. |
ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player. int32_t Samsung::NaClPlayer::MediaPlayer::GetVideoTracksList | ( | VideoTracksList & | ) |
Synchronously retrieves information of all video tracks from the media played from the attached data source.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::Pause | ( | const std::function< void(int32_t)> & | callback | ) |
Requests to pause playback of media from the data source attached to the media player.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player.ErrorCodes::NotSupported
- if the given operation is not supported by the attached data source. int32_t Samsung::NaClPlayer::MediaPlayer::Pause | ( | ) |
Synchronously requests to pause playback of media from the data source attached to the media player.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::Play | ( | const std::function< void(int32_t)> & | callback | ) |
Requests to start playback of media from the data source attached to the media player.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player.ErrorCodes::NotSupported
- if the given operation is not supported by the attached data source. int32_t Samsung::NaClPlayer::MediaPlayer::Play | ( | ) |
Synchronously requests to start playback of media from the data source attached to the media player.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::Seek | ( | TimeTicks | time, |
const std::function< void(int32_t)> & | callback | ||
) |
Requests to seek media from the attached data source to the given time stamp.
[in] | time | A time stamp from begging of the clip to from which playback should be resumed. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player.ErrorCodes::NotSupported
- if the given operation is not supported by the attached data source. int32_t Samsung::NaClPlayer::MediaPlayer::Seek | ( | TimeTicks | time | ) |
Synchronously requests to seek media from the attached data source to the given time stamp.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::SelectTrack | ( | ElementaryStreamType | track_type, |
uint32_t | track_index, | ||
const std::function< void(int32_t)> & | callback | ||
) |
Selects a track of the given track_type
to be activated for the media played from the attached data source.
Remarks: If activated track is a text track, it will be automatically activated and therefore it's subtitles will be delivered as events to the SubtitleListener
.
[in] | track_type | A type of the stream for which activate track. |
[in] | track_index | An index of the track which has to be activated. A valid track index can be obtained from one of the [Audio/Video/Text]TrackInfo structures returned by a corresponding call to Get[Audio/Video/Text]TracksInfo. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player or passed track_type
or track_index
are not valid. int32_t Samsung::NaClPlayer::MediaPlayer::SelectTrack | ( | ElementaryStreamType | track_type, |
uint32_t | track_index | ||
) |
Synchronously selects a track of the given track_type
to be activated for the media played from the attached data source.
For detailed description
void Samsung::NaClPlayer::MediaPlayer::SetBufferingListener | ( | BufferingListener * | listener | ) |
Attaches a BufferingListener
to the player. After attaching, the plugin will be notified about initial media buffering events.
The listener will be called in the same thread in which this method was called.
Listeners ownership is not taken by NaCl Player and application must control listener's object lifecycle.
[in] | listener | A BufferingListener implementation whose methods will be notified about subscribed events. |
void Samsung::NaClPlayer::MediaPlayer::SetBufferingListener | ( | std::shared_ptr< BufferingListener > | listner | ) |
Deprecated method for backwards compatibility
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::SetDisplayMode | ( | MediaPlayerDisplayMode | display_mode, |
const std::function< void(int32_t)> & | callback | ||
) |
Sets a display mode which will be used by player. If no display mode is set, MediaPlayerDisplayModeStretch
is used.
[in] | display_mode | A display mode to be used. See MediaPlayerDisplayMode enum for possible options. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. int32_t Samsung::NaClPlayer::MediaPlayer::SetDisplayMode | ( | MediaPlayerDisplayMode | display_mode | ) |
Synchronously sets the display mode.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::SetDisplayRect | ( | const Rect & | rect, |
const std::function< void(int32_t)> & | callback | ||
) |
Sets the display region in which video will be displayed. The passed position is relative to the embed/object element of the WebPage associated with the given plugin.
[in] | rect | Video region in which video will be displayed. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. int32_t Samsung::NaClPlayer::MediaPlayer::SetDisplayRect | ( | const Rect & | rect | ) |
Synchronously sets the display region in which video will be displayed.
For detailed description
void Samsung::NaClPlayer::MediaPlayer::SetDRMListener | ( | DRMListener * | listener | ) |
Attaches a DRMListener
to the player. After attaching, the plugin will be notified about DRM related events.
The listener will be called in the same thread in which this method was called.
Listeners ownership is not taken by NaCl Player and application must control listener's object lifecycle.
[in] | listener | A DRMListener implementation whose methods will be notified about subscribed events. |
void Samsung::NaClPlayer::MediaPlayer::SetDRMListener | ( | std::shared_ptr< DRMListener > | listener | ) |
Deprecated method for backwards compatibility
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::SetDRMSpecificData | ( | DRMType | drm_type, |
DRMOperation | drm_operation, | ||
uint32_t | drm_data_size, | ||
const void * | drm_data, | ||
const std::function< void(int32_t)> & | callback | ||
) |
Calls a DRM system specific operation.
[in] | drm_type | A DRM system to be used |
[in] | drm_operation | A DRM specific operation to be performed. |
[in] | drm_data_size | A size of data buffer passed to DRM system. |
[in] | drm_data | A data buffer passed to DRM system. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player. int32_t Samsung::NaClPlayer::MediaPlayer::SetDRMSpecificData | ( | DRMType | drm_type, |
DRMOperation | drm_operation, | ||
uint32_t | drm_data_size, | ||
const void * | drm_data | ||
) |
Synchronously calls a DRM system specific operation.
For detailed description
void Samsung::NaClPlayer::MediaPlayer::SetMediaEventsListener | ( | MediaEventsListener * | listener | ) |
Attaches a MediaEventsListener
to the player. After attaching, the plugin will be notified about media playback related events.
The listener will be called in the same thread in which this method was called.
Listeners ownership is not taken by NaCl Player and application must control listener's object lifecycle.
[in] | listener | A MediaEventsListener implementation whose methods will be notified about subscribed events. |
void Samsung::NaClPlayer::MediaPlayer::SetMediaEventsListener | ( | std::shared_ptr< MediaEventsListener > | listener | ) |
Deprecated method for backwards compatibility
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::SetPlaybackRate | ( | double | rate, |
const std::function< void(int32_t)> & | callback | ||
) |
Sets the playback rate. Pass: |rate| == 1.0 to mark normal playback, 0.0 < |rate| < 1.0 to mark speeds slower than normal, |rate| > 1.0 to mark speeds faster than normal.
[in] | rate | A rate of the playback. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player.ErrorCodes::NotSupported
- if the given operation is not supported by the attached data source. int32_t Samsung::NaClPlayer::MediaPlayer::SetPlaybackRate | ( | double | rate | ) |
Synchronously sets the playback rate.
For detailed description
void Samsung::NaClPlayer::MediaPlayer::SetSubtitleListener | ( | SubtitleListener * | listener | ) |
Attaches a SubtitleListener
to the player. After attaching plugin will be notified about subtitle texts that are parsed by the internal player subtitle parser at the time when they should be displayed. Only notifications regarding texts that originate from active text track are delivered this way. Previously attached listener (if any) is detached.
The listener will be called in the same thread in which this method was called.
Listeners ownership is not taken by NaCl Player and application must control listener's object lifecycle.
[in] | listener | A SubtitleListener implementation whose methods will be notified about subscribed events. |
void Samsung::NaClPlayer::MediaPlayer::SetSubtitleListener | ( | std::shared_ptr< SubtitleListener > | listener | ) |
Deprecated method for backwards compatibility
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::SetSubtitlesDelay | ( | TimeDelta | delay, |
const std::function< void(int32_t)> & | callback | ||
) |
Sets subtitles (text stream) SubtitleListener
event emission delay regarding to the current media time.
[in] | delay | A delay to be set. |
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player. int32_t Samsung::NaClPlayer::MediaPlayer::SetSubtitlesDelay | ( | TimeDelta | delay | ) |
Synchronously sets subtitles (text stream) SubtitleListener
event emission delay regarding to the current media time.
For detailed description
int32_t Samsung::NaClPlayer::MediaPlayer::SetVr360Mode | ( | MediaPlayerVr360Mode | display_mode, |
const std::function< void(int32_t)> & | callback | ||
) |
Set Vr360 mode. This function should be called player idle state.
[in] | player | A PP_Resource identifying the media player. |
[in] | vr360_mode | PP_MediaPlayerVr360Mode |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if parameter was wrong.PP_ERROR_FAILED
- if player was is invalid state. int32_t Samsung::NaClPlayer::MediaPlayer::SetVr360Mode | ( | MediaPlayerVr360Mode | display_mode | ) |
Set Vr360 mode. This function should be called player idle state.
[in] | player | A PP_Resource identifying the media player. |
[in] | vr360_mode | PP_MediaPlayerVr360Mode |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if parameter was wrong.PP_ERROR_FAILED
- if player was is invalid state. int32_t Samsung::NaClPlayer::MediaPlayer::SetVr360Rotation | ( | float | horizontal_angle, |
float | vertical_angle, | ||
const std::function< void(int32_t)> & | callback | ||
) |
Set Vr360 rotation.
[in] | player | A PP_Resource identifying the media player. |
[in] | horizontal_angle | - horizontal angle of rotation in degree range (0.0 to 360.0). |
[in] | vertical_angle | - vertical angle of rotation in degree range (0.0 to 360.0). |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if parameter was wrong. int32_t Samsung::NaClPlayer::MediaPlayer::SetVr360Rotation | ( | float | horizontal_angle, |
float | vertical_angle | ||
) |
Set Vr360 rotation.
[in] | player | A PP_Resource identifying the media player. |
[in] | horizontal_angle | - horizontal angle of rotation in degree range 0.0 to 360.0). |
[in] | vertical_angle | - vertical angle of rotation in degree range (0.0 to 360.0). |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if parameter was wrong. int32_t Samsung::NaClPlayer::MediaPlayer::SetVr360ZoomLevel | ( | uint32_t | zoom_level, |
const std::function< void(int32_t)> & | callback | ||
) |
Set Vr360 zoom.
[in] | player | A PP_Resource identifying the media player. |
[in] | zoom | - zoom level (0 to 100). |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
- if parameter was wrong. int32_t Samsung::NaClPlayer::MediaPlayer::SetVr360ZoomLevel | ( | uint32_t | zoom_level | ) |
Set Vr360 zoom.
[in] | player | A PP_Resource identifying the media player. |
[in] | zoom | - zoom level. |
pp_errors.h
. Meaning of errors:PP_ERROR_BADARGUMENT
-. int32_t Samsung::NaClPlayer::MediaPlayer::Stop | ( | const std::function< void(int32_t)> & | callback | ) |
Requests to stop playback of media from the data source attached to the media player.
[in] | callback | A callback to be called upon completion. |
ErrorCodes::Success
on success, otherwise an error code from ErrorCodes
. Meaning of errors:ErrorCodes::BadArgument
- if no data source is connected to the media player.ErrorCodes::NotSupported
- if the given operation is not supported by the attached data source. int32_t Samsung::NaClPlayer::MediaPlayer::Stop | ( | ) |
Synchronously requests to stop playback of media from the data source attached to the media player.
For detailed description