Shaka Player Embedded
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Instance Methods | Properties | List of all members
ShakaPlayer Class Reference

#import <ShakaPlayer.h>

Inheritance diagram for ShakaPlayer:

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
(nullable instancetype) - initWithError:
 
(void) - play
 
(void) - pause
 
(void) - getUiInfoWithBlock:
 
(ShakaStats *) - getStats
 
(NSArray< ShakaTrack * > *) - getTextTracks
 
(NSArray< ShakaTrack * > *) - getVariantTracks
 
(void) - load:withBlock:
 
(void) - load:withStartTime:andBlock:
 
(void) - unloadWithBlock:
 
(void) - configure:withBool:
 
(void) - configure:withDouble:
 
(void) - configure:withString:
 
(void) - configure:withData:
 
(void) - configureWithDefault:
 
(BOOL) - getConfigurationBool:
 
(double) - getConfigurationDouble:
 
(nullable NSString *) - getConfigurationString:
 
(void) - selectAudioLanguage:withRole:
 
(void) - selectAudioLanguage:
 
(void) - selectTextLanguage:withRole:
 
(void) - selectTextLanguage:
 
(void) - selectTextTrack:
 
(void) - selectVariantTrack:
 
(void) - selectVariantTrack:withClearBuffer:
 
(void) - destroy
 
(void) - addNetworkFilter:
 
(void) - removeNetworkFilter:
 
(void) - addTextTrack:language:kind:mime:
 
(void) - addTextTrack:language:kind:mime:codec:
 
(void) - addTextTrack:language:kind:mime:codec:label:
 

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::PlayerplayerInstance
 
shaka::media::DefaultMediaPlayermediaPlayer
 
shaka::media::AppleVideoRenderervideoRenderer
 

Detailed Description

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.

Method Documentation

§ addNetworkFilter:()

- (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.

§ addTextTrack:language:kind:mime:()

- (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.

§ addTextTrack:language:kind:mime:codec:()

- (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.

§ addTextTrack:language:kind:mime:codec:label:()

- (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.

§ configure:withBool:()

- (void) configure: (const NSString *)  namePath
withBool: (BOOL)  value 

Applies a configuration.

Parameters
namePathThe path of the parameter to configure. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}}
valueThe value you wish to assign.

Definition at line 503 of file ShakaPlayer.mm.

§ configure:withData:()

- (void) configure: (const NSString *)  namePath
withData: (NSData *)  value 

Applies a configuration.

Parameters
namePathThe path of the parameter to configure. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}}
valueThe value you wish to assign.

Definition at line 515 of file ShakaPlayer.mm.

§ configure:withDouble:()

- (void) configure: (const NSString *)  namePath
withDouble: (double)  value 

Applies a configuration.

Parameters
namePathThe path of the parameter to configure. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}}
valueThe value you wish to assign.

Definition at line 507 of file ShakaPlayer.mm.

§ configure:withString:()

- (void) configure: (const NSString *)  namePath
withString: (const NSString *)  value 

Applies a configuration.

Parameters
namePathThe path of the parameter to configure. I.e. "manifest.dash.defaultPresentationDelay" corresponds to {manifest: {dash: {defaultPresentationDelay: your value}}}
valueThe value you wish to assign.

Definition at line 511 of file ShakaPlayer.mm.

§ configureWithDefault:()

- (void) configureWithDefault: (const NSString *)  namePath

Returns a configuration to the default value.

Parameters
namePathThe 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.

§ destroy()

- (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.

§ getConfigurationBool:()

- (BOOL) getConfigurationBool: (const NSString *)  namePath

Get a configuration.

Parameters
namePathThe 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.

§ getConfigurationDouble:()

- (double) getConfigurationDouble: (const NSString *)  namePath

Get a configuration.

Parameters
namePathThe 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.

§ getConfigurationString:()

- (NSString *) getConfigurationString: (const NSString *)  namePath

Get a configuration.

Parameters
namePathThe 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.

§ getStats()

- (ShakaStats *) getStats

Return playback and adaptation stats.

Definition at line 447 of file ShakaPlayer.mm.

§ getTextTracks()

- (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.

§ getUiInfoWithBlock:()

- (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.

§ getVariantTracks()

- (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.

§ initWithError:()

- (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.

§ load:withBlock:()

- (void) load: (NSString *)  uri
withBlock: (ShakaPlayerAsyncBlock block 

Load the given manifest asynchronously.

Parameters
uriThe uri of the manifest to load.
blockA block called when the operation is complete.

Definition at line 487 of file ShakaPlayer.mm.

§ load:withStartTime:andBlock:()

- (void) load: (NSString *)  uri
withStartTime: (double)  startTime
andBlock: (ShakaPlayerAsyncBlock block 

Load the given manifest asynchronously.

Parameters
uriThe uri of the manifest to load.
startTimeThe time to start playing at, in seconds.
blockA block called when the operation is complete.

Definition at line 491 of file ShakaPlayer.mm.

§ NS_UNAVAILABLE()

- (instancetype) NS_UNAVAILABLE

§ pause()

- (void) pause

Pauses the video.

Definition at line 293 of file ShakaPlayer.mm.

§ play()

- (void) play

Plays the video.

Definition at line 289 of file ShakaPlayer.mm.

§ removeNetworkFilter:()

- (void) removeNetworkFilter: (id<ShakaPlayerNetworkFilter>)  filter

Stops the given object from receiving calls for network requests.

Definition at line 658 of file ShakaPlayer.mm.

§ selectAudioLanguage:()

- (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.

§ selectAudioLanguage:withRole:()

- (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.

§ selectTextLanguage:()

- (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.

§ selectTextLanguage:withRole:()

- (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.

§ selectTextTrack:()

- (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.

§ selectVariantTrack:()

- (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.

§ selectVariantTrack:withClearBuffer:()

- (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.

§ unloadWithBlock:()

- (void) unloadWithBlock: (ShakaPlayerAsyncBlock block

Unload the current manifest and make the Player available for re-use.

Definition at line 498 of file ShakaPlayer.mm.

Property Documentation

§ audioLanguagesAndRoles

- (NSArray< ShakaLanguageRole * > *) audioLanguagesAndRoles
readatomicassign

A list of the audio languages of the current Period.

Definition at line 293 of file ShakaPlayer.h.

§ avPlayer

- (AVPlayer *) avPlayer
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.

§ client

- (id< ShakaPlayerClient >) client
readwriteatomicweak

A client which will receive player events

Definition at line 241 of file ShakaPlayer.h.

§ closedCaptions

- (BOOL) closedCaptions
readwriteatomicassign

Whether the video will display any closed captions present in the asset.

Definition at line 290 of file ShakaPlayer.h.

§ currentTime

- (double) currentTime
readwriteatomicassign

The current time of the video, or 0 if nothing is loaded.

Definition at line 265 of file ShakaPlayer.h.

§ duration

- (double) duration
readatomicassign

The duration of the video, or 0 if nothing is loaded.

Definition at line 259 of file ShakaPlayer.h.

§ ended

- (BOOL) ended
readatomicassign

Whether the video is currently ended.

Definition at line 253 of file ShakaPlayer.h.

§ isAudioOnly

- (BOOL) isAudioOnly
readatomicassign

Whether the video is currently audio-only.

Definition at line 284 of file ShakaPlayer.h.

§ isLive

- (BOOL) isLive
readatomicassign

Whether the video is a livestream.

Definition at line 287 of file ShakaPlayer.h.

§ logLevel

- (ShakaPlayerLogLevel) logLevel
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.

§ mediaPlayer

- media:
readatomicassign

Provided by category ShakaPlayer(Internal).

Definition at line 32 of file ShakaPlayer+Internal.h.

§ muted

- (BOOL) muted
readwriteatomicassign

Whether the audio is currently muted.

Definition at line 271 of file ShakaPlayer.h.

§ paused

- (BOOL) paused
readatomicassign

Whether the video is currently paused.

Definition at line 250 of file ShakaPlayer.h.

§ playbackRate

- (double) playbackRate
readwriteatomicassign

The current playback rate of the video, or 1 if nothing is loaded.

Definition at line 262 of file ShakaPlayer.h.

§ playerInstance

- (Player* ShakaPlayer(Internal)):
readatomicassign

Provided by category ShakaPlayer(Internal).

Definition at line 31 of file ShakaPlayer+Internal.h.

§ playerVersion

- (NSString *) playerVersion
readatomicassign

The version of Shaka Player being used, as a string.

Definition at line 281 of file ShakaPlayer.h.

§ seeking

- (BOOL) seeking
readatomicassign

Whether the video is currently seeking.

Definition at line 256 of file ShakaPlayer.h.

§ textLanguagesAndRoles

- (NSArray< ShakaLanguageRole * > *) textLanguagesAndRoles
readatomicassign

A list of the text languages of the current Period.

Definition at line 296 of file ShakaPlayer.h.

§ videoRenderer

- media:
readatomicassign

Provided by category ShakaPlayer(Internal).

Definition at line 33 of file ShakaPlayer+Internal.h.

§ volume

- (double) volume
readwriteatomicassign

The current volume of the video, or 0 if nothing is loaded.

Definition at line 268 of file ShakaPlayer.h.


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