BradmaxPlayerSdk
Instance Methods | Properties | List of all members
BPSPlayer Class Reference

Main bradmax player class. More...

#import <BPSPlayer.h>

Inheritance diagram for BPSPlayer:

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

BPSMPlayerConfigplayerConfig
 
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< BPSPlayerDelegateplayerDelegate
 Player delegate for handling player events.
 

Detailed Description

Main bradmax player class.

Method Documentation

◆ addMediaToPlayback:()

- (void) addMediaToPlayback: (BPSMMedia *)  media

Adds media object into player playback list.

Parameters
mediaMedia object for adding to end of playback list.

◆ getPlaybackList()

- (NSMutableArray *) getPlaybackList

Return player current configured Media playlist.

Returns
array with Media objects.

◆ getVersion()

- (NSString *) getVersion

Get player version.

Returns
verion number as string

◆ load()

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

◆ loadVideoByUrl:()

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

Parameters
mediaSourceUrlVideo stream URL.

◆ loadVideoByUrl:withPosterUrl:()

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

Parameters
mediaSourceUrlVideo stream URL.
posterUrl(optional) Poser image URL for showing before playback.

◆ pause()

- (void) pause

Pause media playback.

IMPORTANT: Requires loading player before (call load or loadVideoByUrl()).

◆ play()

- (void) play

Starts media playback.

IMPORTANT: Requires loading player before (call load or loadVideoByUrl()).

◆ playPause()

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

◆ seek:()

- (void) seek: (double)  position

Seek media to time position in seconds.

IMPORTANT: Requires loading player before (call load or loadVideoByUrl()).

Parameters
positionVideo position to seek in seconds.

◆ setVolume:()

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

Parameters
volumeVolume ratio (0.0 - muted sound, 1.0 - full volume)

Property Documentation

◆ remoteBradmaxPlayerEmbedId

- (NSString*) remoteBradmaxPlayerEmbedId
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";


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