Shaka Player Embedded
|
#import <ShakaPlayer.h>
Properties | |
id< ShakaPlayerClient > | client |
BOOL | paused |
BOOL | ended |
BOOL | seeking |
double | duration |
double | playbackRate |
double | currentTime |
double | volume |
BOOL | muted |
ShakaPlayerLogLevel | logLevel |
NSString * | playerVersion |
BOOL | isAudioOnly |
BOOL | isLive |
BOOL | closedCaptions |
NSArray< ShakaLanguageRole * > * | audioLanguagesAndRoles |
NSArray< ShakaLanguageRole * > * | textLanguagesAndRoles |
AVPlayer * | avPlayer |
shaka::Player * | playerInstance |
shaka::media::DefaultMediaPlayer * | mediaPlayer |
shaka::media::AppleVideoRenderer * | videoRenderer |
Handles loading and playback of media content. The is the control aspect of playback. Use a ShakaPlayerView to display the video frames. This will still load and play content without an active view. This will play audio without a view.
Definition at line 229 of file ShakaPlayer.h.
- (void) addNetworkFilter: | (id<ShakaPlayerNetworkFilter>) | filter |
Adds an object that is called when network requests happen. These are called in the order they are registered.
Definition at line 651 of file ShakaPlayer.mm.
- (void) addTextTrack: | (NSString *) | uri | |
language: | (NSString *) | lang | |
kind: | (NSString *) | kind | |
mime: | (NSString *) | mime | |
Adds the given text track to the current Period. load
must resolve before calling. The current Period or the presentation must have a duration. This returns a Promise that will resolve with the track that was created, when that track can be switched to.
Definition at line 623 of file ShakaPlayer.mm.
- (void) addTextTrack: | (NSString *) | uri | |
language: | (NSString *) | lang | |
kind: | (NSString *) | kind | |
mime: | (NSString *) | mime | |
codec: | (nullable NSString *) | codec | |
Adds the given text track to the current Period. load
must resolve before calling. The current Period or the presentation must have a duration. This returns a Promise that will resolve with the track that was created, when that track can be switched to.
- (void) addTextTrack: | (NSString *) | uri | |
language: | (NSString *) | lang | |
kind: | (NSString *) | kind | |
mime: | (NSString *) | mime | |
codec: | (nullable NSString *) | codec | |
label: | (nullable NSString *) | label | |
Adds the given text track to the current Period. load
must resolve before calling. The current Period or the presentation must have a duration. This returns a Promise that will resolve with the track that was created, when that track can be switched to.
- (void) configure: | (const NSString *) | namePath | |
withBool: | (BOOL) | value | |
Applies a configuration.
namePath | The path of the parameter to configure. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}} |
value | The value you wish to assign. |
Definition at line 503 of file ShakaPlayer.mm.
- (void) configure: | (const NSString *) | namePath | |
withData: | (NSData *) | value | |
Applies a configuration.
namePath | The path of the parameter to configure. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}} |
value | The value you wish to assign. |
Definition at line 515 of file ShakaPlayer.mm.
- (void) configure: | (const NSString *) | namePath | |
withDouble: | (double) | value | |
Applies a configuration.
namePath | The path of the parameter to configure. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}} |
value | The value you wish to assign. |
Definition at line 507 of file ShakaPlayer.mm.
- (void) configure: | (const NSString *) | namePath | |
withString: | (const NSString *) | value | |
Applies a configuration.
namePath | The path of the parameter to configure. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}} |
value | The value you wish to assign. |
Definition at line 511 of file ShakaPlayer.mm.
- (void) configureWithDefault: | (const NSString *) | namePath |
Returns a configuration to the default value.
namePath | The path of the parameter to configure. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}} |
Definition at line 520 of file ShakaPlayer.mm.
- (void) destroy |
Destroys the Shaka Player instance. After calling this, this view should be immediately disposed of.
Definition at line 618 of file ShakaPlayer.mm.
- (BOOL) getConfigurationBool: | (const NSString *) | namePath |
Get a configuration.
namePath | The path of the parameter to fetch. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}} |
Definition at line 524 of file ShakaPlayer.mm.
- (double) getConfigurationDouble: | (const NSString *) | namePath |
Get a configuration.
namePath | The path of the parameter to fetch. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}} |
Definition at line 533 of file ShakaPlayer.mm.
- (NSString *) getConfigurationString: | (const NSString *) | namePath |
Get a configuration.
namePath | The path of the parameter to fetch. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}} |
Definition at line 542 of file ShakaPlayer.mm.
- (ShakaStats *) getStats |
Return playback and adaptation stats.
Definition at line 447 of file ShakaPlayer.mm.
- (NSArray< ShakaTrack * > *) getTextTracks |
Return a list of text tracks available for the current Period. If there are multiple Periods, then you must seek to the Period before being able to switch.
Definition at line 457 of file ShakaPlayer.mm.
- (void) getUiInfoWithBlock: | (void(^)(ShakaPlayerUiInfo *)) | block |
Fetches the current UI info asynchronously. The block is called with the current info. The block is called on the main thread.
Definition at line 406 of file ShakaPlayer.mm.
- (NSArray< ShakaTrack * > *) getVariantTracks |
Return a list of variant tracks available for the current Period. If there are multiple Periods, then you must seek to the Period before being able to switch.
Definition at line 465 of file ShakaPlayer.mm.
- (nullable instancetype) initWithError: | (init()) | NS_SWIFT_NAME |
Creates a new initialized Player object. If there is an error, the error
pointer will be set to an object containing the error information and this returns nil.
- (void) load: | (NSString *) | uri | |
withBlock: | (ShakaPlayerAsyncBlock) | block | |
Load the given manifest asynchronously.
uri | The uri of the manifest to load. |
block | A block called when the operation is complete. |
Definition at line 487 of file ShakaPlayer.mm.
- (void) load: | (NSString *) | uri | |
withStartTime: | (double) | startTime | |
andBlock: | (ShakaPlayerAsyncBlock) | block | |
Load the given manifest asynchronously.
uri | The uri of the manifest to load. |
startTime | The time to start playing at, in seconds. |
block | A block called when the operation is complete. |
Definition at line 491 of file ShakaPlayer.mm.
- (instancetype) NS_UNAVAILABLE |
- (void) pause |
Pauses the video.
Definition at line 293 of file ShakaPlayer.mm.
- (void) play |
Plays the video.
Definition at line 289 of file ShakaPlayer.mm.
- (void) removeNetworkFilter: | (id<ShakaPlayerNetworkFilter>) | filter |
Stops the given object from receiving calls for network requests.
Definition at line 658 of file ShakaPlayer.mm.
- (void) selectAudioLanguage: | (NSString *) | language |
Sets currentAudioLanguage to the selected language and role, and chooses a new variant if need be.
Definition at line 576 of file ShakaPlayer.mm.
- (void) selectAudioLanguage: | (NSString *) | language | |
withRole: | (nullable NSString *) | role | |
Sets currentAudioLanguage and currentVariantRole to the selected language and role, and chooses a new variant if need be.
- (void) selectTextLanguage: | (NSString *) | language |
Sets currentTextLanguage to the selected language and role, and chooses a new text stream if need be.
Definition at line 590 of file ShakaPlayer.mm.
- (void) selectTextLanguage: | (NSString *) | language | |
withRole: | (nullable NSString *) | role | |
Sets currentTextLanguage and currentTextRole to the selected language and role, and chooses a new text stream if need be.
- (void) selectTextTrack: | (const ShakaTrack *) | track |
Select a specific text track. Note that AdaptationEvents are not fired for manual track selections.
Definition at line 597 of file ShakaPlayer.mm.
- (void) selectVariantTrack: | (const ShakaTrack *) | track |
Select a specific track. Note that AdaptationEvents are not fired for manual track selections.
Definition at line 604 of file ShakaPlayer.mm.
- (void) selectVariantTrack: | (const ShakaTrack *) | track | |
withClearBuffer: | (BOOL) | clear | |
Select a specific track. Note that AdaptationEvents are not fired for manual track selections.
Definition at line 611 of file ShakaPlayer.mm.
- (void) unloadWithBlock: | (ShakaPlayerAsyncBlock) | block |
Unload the current manifest and make the Player available for re-use.
Definition at line 498 of file ShakaPlayer.mm.
|
readatomicassign |
A list of the audio languages of the current Period.
Definition at line 293 of file ShakaPlayer.h.
|
readatomicassign |
Gets the current AVPlayer instance used to play src= content. This is only valid after starting playback of src= content. Use the client events to detect when src= content starts. New playbacks will use a new instance.
Definition at line 303 of file ShakaPlayer.h.
|
readwriteatomicweak |
A client which will receive player events
Definition at line 241 of file ShakaPlayer.h.
|
readwriteatomicassign |
Whether the video will display any closed captions present in the asset.
Definition at line 290 of file ShakaPlayer.h.
|
readwriteatomicassign |
The current time of the video, or 0 if nothing is loaded.
Definition at line 265 of file ShakaPlayer.h.
|
readatomicassign |
The duration of the video, or 0 if nothing is loaded.
Definition at line 259 of file ShakaPlayer.h.
|
readatomicassign |
Whether the video is currently ended.
Definition at line 253 of file ShakaPlayer.h.
|
readatomicassign |
Whether the video is currently audio-only.
Definition at line 284 of file ShakaPlayer.h.
|
readatomicassign |
Whether the video is a livestream.
Definition at line 287 of file ShakaPlayer.h.
|
readwriteatomicassign |
The log level of the JavaScript Shaka Player. Logging only works if the Shaka Player JS file is in a debug build.
Definition at line 278 of file ShakaPlayer.h.
|
readatomicassign |
Provided by category ShakaPlayer(Internal).
Definition at line 32 of file ShakaPlayer+Internal.h.
|
readwriteatomicassign |
Whether the audio is currently muted.
Definition at line 271 of file ShakaPlayer.h.
|
readatomicassign |
Whether the video is currently paused.
Definition at line 250 of file ShakaPlayer.h.
|
readwriteatomicassign |
The current playback rate of the video, or 1 if nothing is loaded.
Definition at line 262 of file ShakaPlayer.h.
|
readatomicassign |
Provided by category ShakaPlayer(Internal).
Definition at line 31 of file ShakaPlayer+Internal.h.
|
readatomicassign |
The version of Shaka Player being used, as a string.
Definition at line 281 of file ShakaPlayer.h.
|
readatomicassign |
Whether the video is currently seeking.
Definition at line 256 of file ShakaPlayer.h.
|
readatomicassign |
A list of the text languages of the current Period.
Definition at line 296 of file ShakaPlayer.h.
|
readatomicassign |
Provided by category ShakaPlayer(Internal).
Definition at line 33 of file ShakaPlayer+Internal.h.
|
readwriteatomicassign |
The current volume of the video, or 0 if nothing is loaded.
Definition at line 268 of file ShakaPlayer.h.