BradmaxPlayerSdk
|
Main bradmax player class. More...
#import <BPSPlayer.h>
Instance Methods | |
(void) | - loadVideoByUrl:withPosterUrl: |
Simple API for quick and easy opening video. More... | |
(void) | - loadVideoByUrl: |
Simple API for quick and easy opening video. More... | |
(void) | - addMediaToPlayback: |
Adds media object into player playback list. More... | |
(void) | - clearPlaybackList |
Clears player playback list. | |
(NSMutableArray *) | - getPlaybackList |
Return player current configured Media playlist. More... | |
(void) | - load |
Loads into WebView configured before player. More... | |
(NSString *) | - getVersion |
Get player version. More... | |
(void) | - play |
Starts media playback. More... | |
(void) | - pause |
Pause media playback. More... | |
(void) | - playPause |
Toggle between play and pause. More... | |
(void) | - seek: |
Seek media to time position in seconds. More... | |
(void) | - setVolume: |
Set volume, accept value in range from 0 to 1, example: 0.75. More... | |
(void) | - toggleFullscreen |
Toggle fullscreen mode. | |
Properties | |
BPSMPlayerConfig * | playerConfig |
NSString * | remoteBradmaxPlayerEmbedId |
When this identifier is defined, then player version is loaded from bradmax platform. More... | |
NSString * | localBradmaxPlayerJs |
Set customized bradmax JavaScript player asset file. | |
NSString * | _bradmaxPlayerVersion |
BOOL | _hasPlayerLoaded |
NSMutableArray * | _jsScriptsOnPlayerPageLoad |
BOOL | _isInFullscreen |
CGRect | _fullscreenBackFrame |
UIViewAutoresizing | _fullscreenBackAutoresizingMask |
UIView * | _fullscreenBackSuperview |
NSUInteger | _fullscreenBackIndexInSuperview |
id< BPSPlayerDelegate > | playerDelegate |
Player delegate for handling player events. | |
Main bradmax player class.
- (void) addMediaToPlayback: | (BPSMMedia *) | media |
Adds media object into player playback list.
media | Media object for adding to end of playback list. |
- (NSMutableArray *) getPlaybackList |
Return player current configured Media playlist.
- (NSString *) getVersion |
Get player version.
- (void) load |
Loads into WebView configured before player.
Before load you can setup playlist and general player settings like autoplay. After load complete process (asynchronious task) player API calls are possible.
- (void) loadVideoByUrl: | (NSString *) | mediaSourceUrl |
Simple API for quick and easy opening video.
Only stream URL is required (mediaSourceUrl). Type of stream will be automatically detected by player.
mediaSourceUrl | Video stream URL. |
- (void) loadVideoByUrl: | (NSString *) | mediaSourceUrl | |
withPosterUrl: | (NSString *) | posterUrl | |
Simple API for quick and easy opening video.
Only stream URL is required (mediaSourceUrl). Type of stream will be automatically detected by player. When posterUrl is passed, then poster image will be present on player area, before starting playback.
mediaSourceUrl | Video stream URL. |
posterUrl | (optional) Poser image URL for showing before playback. |
- (void) pause |
Pause media playback.
IMPORTANT: Requires loading player before (call load or loadVideoByUrl()).
- (void) play |
Starts media playback.
IMPORTANT: Requires loading player before (call load or loadVideoByUrl()).
- (void) playPause |
Toggle between play and pause.
If player is in ‘pause’ state, this command will start media playback. If player is in ‘play’ state, this command will pause media playback. IMPORTANT: Requires loading player before (call load or loadVideoByUrl()).
- (void) seek: | (double) | position |
Seek media to time position in seconds.
IMPORTANT: Requires loading player before (call load or loadVideoByUrl()).
position | Video position to seek in seconds. |
- (void) setVolume: | (double) | volume |
Set volume, accept value in range from 0 to 1, example: 0.75.
MPORTANT: Requires loading player before (call load or loadVideoByUrl()).
volume | Volume ratio (0.0 - muted sound, 1.0 - full volume) |
|
readwriteatomic |
When this identifier is defined, then player version is loaded from bradmax platform.
This identifier can be found on bradmax player on "get embed code" page. In iframe embed code there is a src parameter with URL with form "https://bradmax.com/client/embed-player/[PLAYER_BUILD_ID]?mediaUrl=[MEDIA_URL]" eg. "https://bradmax.com/client/embed-player/d5a43836d238bb46d0a0b046267175975a9d6222_4013?mediaUrl=https%3A%2F%2Fbradmax.com%2Fstatic%2Fvideo%2Ftears_of_steel.mp4"
Searched [PLAYER_BUILD_ID] is placed just after "/embed-player/" text. Just copy it and call setRemoteBradmaxPlayerEmbedId(). For example above it would be player.remoteBradmaxPlayerEmbedId = "d5a43836d238bb46d0a0b046267175975a9d6222_4013";