libbambuser
0.9.26
|
#import <libbambuserplayer.h>
Instance Methods | |
(id) | - init |
Used to initialise the BambuserPlayer view. | |
(void) | - playVideo: |
(void) | - stopVideo |
(void) | - pauseVideo |
(void) | - playVideo |
(void) | - seekTo: |
Properties | |
id< BambuserPlayerDelegate > | delegate |
Set this to the object that conforms to the BambuserPlayerDelegate protocol, to receive updates about playback. | |
NSString * | resourceUri |
NSString * | broadcastId |
NSString * | applicationId |
enum BroadcastState | requiredBroadcastState |
enum BambuserPlayerState | status |
NSError * | error |
BOOL | canPause |
double | playbackPosition |
BOOL | live |
CGSize | resolution |
BOOL | VODControlsEnabled |
enum VideoScaleMode | videoScaleMode |
BOOL | timeShiftModeEnabled |
double | seekableStart |
double | seekableEnd |
float | volume |
The audio playback volume for the BambuserPlayer, ranging from 0.0 through 1.0 on a linear scale. More... | |
LatencyMeasurement | endToEndLatency |
Get the current measured end-to-end latency when playing a live broadcast. More... | |
This is the main class for using the player library. Implement the BambuserPlayerDelegate to receive callbacks from a BambuserPlayer instance. By handing BambuserPlayer a broadcast's resourceUri, it plays that broadcast. A resourceUri is a signed Uri that can be requested through the Bambuser Metadata API.
A broadcast is in a defined BambuserPlayerState. Archived broadcasts (or live broadcasts in timeshift mode) can be paused or stopped. Live broadcasts can only be stopped. If the parent application is sent to background an archived broadcast (or live broadcasts in timeshift mode) is paused and a live broadcast is stopped.
After kBambuserPlayerStateStopped or kBambuserPlayerStateError has been entered the BambuserPlayer instance is no longer usable. To start playback again create a new instance of BambuserPlayer.
BambuserPlayer does not configure the app's AVAudioSession. It is up to the implementer to set appropriate category and mode for its use case. Read more about configuring an AVAudioSession in Apple's documentation.
- (void) pauseVideo |
- (void) playVideo |
Resume playback of a broadcast that has been paused. This is only available for archived or live broadcasts in timeshift mode. For live broadcasts, playback must be requested via the playVideo: method.
- (void) playVideo: | (NSString *) | resourceUri |
Request the BambuserPlayer to start playing a broadcast with the supplied resource uri, which is a signed URI received from the Bambuser Metadata API.
This method can only be called once. Subsequent calls to this method have no effect.
resourceUri | The resource uri associated with the broadcast to be loaded. |
- (void) stopVideo |
Stops and terminates playback of a broadcast. To start playback again create a new instance of BambuserPlayer.
|
readwritenonatomicretain |
Contains the Bambuser Application ID necessary to make authorized requests.
This property can only be set before calling playVideo:. If set after it has no effect.
|
readnonatomicassign |
Returns the broadcastId for the currently loaded broadcast. Available after status has changed from kBambuserPlayerStateLoading to kBambuserPlayerStateBuffering or kBambuserPlayerStatePlaying.
|
readnonatomicassign |
Returns YES if the BambuserPlayer has loaded an archived broadcast (or a live broadcast in timeshift mode) and is in a state that supports pause/play/seeking, NO otherwise.
|
readnonatomicassign |
Get the current measured end-to-end latency when playing a live broadcast.
During a live broadcast, the broadcaster and BambuserPlayer can synchronize their clocks with the servers and the player can determine the current end-to-end latency.
End-to-end latency measurements may take a while before appearing and may not be available for all broadcasts, as it requires successful clock synchronization and needs to be supported by the broadcast source too.
|
readnonatomicassign |
Is set when BambuserPlayerState is kBambuserPlayerStateError. Is nil in any other BambuserPlayerState.
|
readnonatomicassign |
This boolean property indicates whether the broadcast loaded for playback is currently live or not. Available after status has changed from kBambuserPlayerStateLoading to kBambuserPlayerStateBuffering or kBambuserPlayerStatePlaying. The value is not updated later. Live broadcasts, unless timeShiftModeEnabled is set to YES, cannot be paused nor seeked in.
|
readnonatomicassign |
|
readwritenonatomicassign |
Set the broadcast state accepted when loading the broadcast for playback. For example, this can be used to ensure that the player will only play the provided broadcast while its status is still live, prohibiting playback of an archived file, or vice versa. Default value is kBambuserBroadcastStateAny.
This property can only be set before calling playVideo:. If set after it has no effect.
|
readnonatomicassign |
Returns the original resolution of the broadcast Available after status has changed from kBambuserPlayerStateLoading to kBambuserPlayerStateBuffering or kBambuserPlayerStatePlaying. Value is not updated later. Returns (0,0) until it is known.
|
readnonatomicassign |
Returns the resourceUri for the currently loaded broadcast, nil if playVideo: has not been called.
This value is set in playVideo: when starting playback of a broadcast.
|
readnonatomicassign |
|
readnonatomicassign |
|
readnonatomicassign |
|
readwritenonatomicassign |
This boolean property is used to enable seeking during a live broadcast. The default value is NO, as the timeshift mode has trade-offs: it adds additional latency, and is mainly suited for broadcasts with reasonable duration. This should only be enabled if seeking in live content is actually required.
This property can only be set before calling playVideo:. If set after it has no effect.
|
readwritenonatomicassign |
An enum that specifies how the video is displayed within the bounds of the BambuserPlayer's view. The default value is VideoScaleAspectFill.
|
readwritenonatomicassign |
|
readwritenonatomicassign |
The audio playback volume for the BambuserPlayer, ranging from 0.0 through 1.0 on a linear scale.
A value of 0.0 indicates silence; a value of 1.0 (the default) indicates full audio volume for the BambuserPlayer.
Setting this property outside the valid range of 0.0 - 1.0 will cap the volume to 0.0 or 1.0.