iOS SDK API Reference

πŸ“˜

Call methods

You must first initialise your player, and then call methods. You can also call on specified event.

Brid SDK remove player

destroy

[self.player destroy];
player.destroy()

Brid SDK playback methods

play

Set player to play video content

[self.player play];
player.play()

pause

Set player to pause video content

[self.player pause];
player.pause()

mute

Set player to mute

[self.player mute];
player.mute()

unmute

Set player to unmute

[self.player unmute];
player.unmute()

next

Call next video from playlist

[self.player next];
player.next()

previous

Call previous video from playlist

[self.player previous];
player.previous()

stop

Player stop video

[self.player stop];
player.stop()

seetToTime

Seek to time on video.

[self.player seekToTime:(float)time];
player.seekToTime(float)

autoHideControls

A Boolean value that determines whether the player will auto hide controls.

[self.player autoHideControls:(BOOL)isHidden];
player.autoHideControls(isHidden: bool)

hideControls

Hide controls.

[self.player hideControls];
player.hideControls()

showControls

Hide controls.

[self.player showControls];
player.showControls()

controlAutoplay

Enables the client to take control over autoplay.

[self.player controlAutoplay:(BOOL)setAutoplay];
player.controlAutoplay(setAutoplay: bool)

enableAdControls

Set custom controls for Ad

[self.player enableAdControls:(BOOL)setAutoplay];
player.enableAdControls(setAutoplay: bool)

showPoster

Show poster.

[self.player showPoster];
player.showPoster()

hidePoster

Hide poster.

[self.player hidePoster];
player.hidePoster()

instantPlayVideo

Play video content, setter type video object.

[self.player instantPlayVideo:(VideoData *)video];
player.instantPlayVideo(VideoData)video

setCornerRadius

Player corner radius size

[self.player setCornerRadius:(int)corner];
player.setCornerRadius(corner :int)

Brid SDK getter methods

isAutoplay

Check if player is autoplay.

[self.player isAutoplay];
player.isAutoplay()

isFullscreen

Check if player is in fullscreen, return type boolean

[self.player isFullscreen];
player.isFullscreen()

isPlayerInView

Check if player is first in view on screen, return type boolean

[self.player isPlayerInView];

πŸ“˜

Information

If 1px (pixel) view is in front of Brid Player, mothod isPlayerInView will return false

isPaused

Return current time of video, return type double

[self.player isPaused];
player.isPaused()

isRepeated

Return current time of video, return type double

[self.player isRepeated];
player.isRepeated()

getCurrentTime

Return current time of video, return type double

[self.player getCurrentTime];
player.getCurrentTime()

getDuration

Return duration of video, return type double

[self.player getDuration];
player.getDuration()

getMuted

Check is player muted, return type double

[self.player getMuted];
player.getMuted()

getVolume

Check current player volume, return type float

[self.player getVolume];
player.getVolume()

getCurrentIndex

Get current video index from playlist, return type boolean NSInteger

[self.player getCurrentIndex];
player.getCurrentIndex()

getPlaylist

Get current playlist, return type array of Brid VideoData object

[self.player getPlaylist];
player.getPlaylist()

getSource

Get current video url, return type NSString

[self.player getSource];
player.getSource()

getVideo

Get current video object, return type Brid VideoData object

[self.player getVideo];
player.getVideo()

Brid SDK setters methods

setVolume

Set volume on player, setter type float. Float number for volume is from 0.0 to 1.0

[self.player setVolume:float];
player.setVolum(float)

playByIndex

Play video content by index in playlist, setter type NSInteger

[self.player playByIndex: Int];
player.play(by: Int)

setVideo

Set custom video object.

[self.player setVideo:<video: VideoData>];
player.setVideo(<video: VideoData>)

πŸ“˜

Creating video object

setVideoUrl

Set custom video from url

[self.player setVideoUrl:<url: String>];
player.setVideoUrl(<url: String>)

setPlaylist

Set external JSON

[self.player setPlaylist:<url: URL>];
player.setPlaylist(<url: URL>)

setFullscreenON

Set player to fullscreen. This method will only trigger once per init of player instance.

[self.player setFullscreenON];
player.setFullscreenON()

setFullscreenOFF

Set player to view. This method will only trigger once per init of player instance.

[self.player setFullscreenOFF];
player.setFullscreenOFF()

Brid SDK ad methods

isAdInProgress

Check if ad is in progress, return type boolean

[self.player isAdInProgress];
player.isAdInProgress()

getAdDuration

Return duration time of current ad.

[self.player getAdDuration];
player.getAdDuration()

getAdCurrentTime

Return current time of current ad.

[self.player getAdCurrentTime];
player.getAdCurrentTime()

playAd

Immediately starts to play an ad using the vast plugin.

[self.player playAd:(AdData *)ad];
player.playAd(setAd(ad: AdData))

playAdTagUrl

Instantly play ad from ad URL.

[self.player playAdTagUrl:(NSURL *_Nullable)url];
player.playAd(playAdTagUrl(url: URL))

scrollOnAd

If player is in scrollView, and ad is running, enable this for scrolling.

[self.player scrollOnAd:(BOOL)enabled];
player.scrollOnAd(enabled: bool)

Custom UI

Set custom image for buttons on player

//Image for init button
[self.player setCustomInitButton:(UIImage *)image];

//Image for progress bar color
[self.player setProgressbarColor:(UIColor *_Nullable)color background:(UIColor * _Nullable)backgroundColor];

 //Image for custom button for Play/Pause/Replay
[self.player setCustomButtonPlay:(UIImage *)play pause:(UIImage *)pause replay:(UIImage *)replay];

//Image for custom button for Mute/Unmute
[self.player setCustomImageMute:(UIImage *_Nullable)mute unmute:(UIImage *_Nullable)unmute];

//Image for custom button for Next/Previous
[self.player setCustomImageNext:(UIImage *_Nullable)next previous:(UIImage *_Nullable)previous];

//Image for custom button for Share
[self.player setCustomImageShare:(UIImage *_Nullable)share];

//Image for custom button for Playlist
[self.player setCustomImagePlaylist:(UIImage *_Nullable)playlist];

//Image for custom button for Cogwheel
[self.player setCustomImageCogwheel:(UIImage *_Nullable)cogwheel];

//Image for custom button for Caption Open/Close
[self.player setCustomCaptionsImageOpen:(UIImage *_Nullable)open close:(UIImage *_Nullable)close];

//Image for custom button for Fullscreen
[self.player setCustomImageFullscreen:(UIImage *_Nullable)fullscreen];

//Image for custom button for all customizable UI elements
[self.player setCustomSkin:(UIImage *_Nullable)initButton
                      play:(UIImage *_Nullable)play
                     pause:(UIImage *_Nullable)pause
                    replay:(UIImage *_Nullable)replay
                      mute:(UIImage *_Nullable)mute
                    unmute:(UIImage *_Nullable)unmute
                      next:(UIImage *_Nullable)next
                  previous:(UIImage *_Nullable)previous
                     share:(UIImage *_Nullable)share
                  playlist:(UIImage *_Nullable)playlist
                   cogweel:(UIImage *_Nullable)cogwheel
               captionOpen:(UIImage *_Nullable)captionOpen
              captionClose:(UIImage *_Nullable)captionClose
                fullscreen:(UIImage *_Nullable)fullscreen];
//Image for init button
player.setCustomInitButton(UIImage?)

//Image for progress bar color
player.setProgressbarColorsetProgressbarColor(<#T##color: UIColor?##UIColor?#>, background: <#T##UIColor?#>)

 //Image for custom button for Play/Pause/Replay
player.setCustomButtonPlay(<#T##play: UIImage?##UIImage?#>, pause: <#T##UIImage?#>, replay: <#T##UIImage?#>)

//Image for custom button for Mute/Unmute
player.setCustomImageMute(<#T##mute: UIImage?##UIImage?#>, unmute: <#T##UIImage?#>)

//Image for custom button for Next/Previous
player.setCustomImageNext(<#T##next: UIImage?##UIImage?#>, previous: <#T##UIImage?#>)

//Image for custom button for Share
player.setCustomImageShare(<#T##share: UIImage?##UIImage?#>)

//Image for custom button for Playlist
player.setCustomImagePlaylist(<#T##playlist: UIImage?##UIImage?#>)

//Image for custom button for Cogwheel
player.setCustomImageCogwheel(<#T##cogwheel: UIImage?##UIImage?#>)

//Image for custom button for Caption Open/Close
player.setCustomCaptionsImageOpen(<#T##open: UIImage?##UIImage?#>, close: <#T##UIImage?#>)

//Image for custom button for Fullscreen
player.setCustomImageFullscreen(<#T##fullscreen: UIImage?##UIImage?#>)

//Image for custom button for all customizable UI elements
 player.setCustomSkin(<#T##initButton: UIImage?##UIImage?#>, 
                          	     play: <#T##UIImage?#>,
                      			pause: <#T##UIImage?#>, 
                               replay: <#T##UIImage?#>,
                                 mute: <#T##UIImage?#>,
                               unmute: <#T##UIImage?#>,
                                 next: <#T##UIImage?#>,
                             previous: <#T##UIImage?#>,
                                share: <#T##UIImage?#>,
                             playlist: <#T##UIImage?#>,
                              cogweel: <#T##UIImage?#>,
                          captionOpen: <#T##UIImage?#>,
                         captionClose: <#T##UIImage?#>,
                           fullscreen: <#T##UIImage?#>)

Custom Font

Set custom font for player.

Add the Custom Font File: Place the .ttf file (e.g., UbuntuSans-Italic-VariableFont.ttf) at the root of your Xcode project.

Register the Font in Info.plist:

Open the Info.plist file.
Add a new key named Fonts provided by application.
Set the type to Array.
Add an item with the name of your font file as a String (e.g., UbuntuSans-Italic-VariableFont.ttf).
Initialize and Use the Font in Your Controller:

In your view controller, initialize the font.
Apply this font to your player by calling [player setCustomFontByName:font];.
Ensure that the font is correctly named and the file is included in your project’s build phase under "Copy Bundle Resources".

UIFont *font = [UIFont fontWithName:@"UbuntuSans-Italic-VariableFont" size:10];
[player setCustomFontByName:font];
 let font = UIFont(name: "UbuntuSans-Italic-VariableFont", size: 10)
 player.setCustomFontByName(font)