Skip to main content

Player Additional Functions & Configs

Functions

Changing the video

vpplayer.changeVideo(id: "Your Video Id")

Change Custom Video

vpplayer.changeVideo(video: Video())

Helper button onClick event

vpplayer.helperButtonTapped { _ in

}

Setup custom prebid

vpplayer.setupCustomPrebidServer(accountId: "Your account Id", customPrebidServer: "Your prebid server Id", configId: "Your config Id")

Play video

vpplayer.play()

Pause video

vpplayer.pause()

Fullscreen status

vpplayer.checkIfIsFullScreen()

Get video current time

vpplayer.getCurrrentVideoSecond()

Video Ad is Playing

vpplayer.isVideoAdPlaying()

Video is Playing

vpplayer.isVideoPlaying()

Video is Paused

vpplayer.isVideoPaused()

Autoplay is Enabled

vpplayer.isAutoPlayEnabled()

Open Related Video Overlay

vpplayer.openRelatedOverlay()

Close Related Video Overlay

vpplayer.closeRelatedOverlay()

Handle click on Related Overlay

player?.playListVideoShouldPlay(value: { [weak self] videoId in
// handle change Video method
})

Open settings view

vpplayer.openSettings()

Show/Hide fullscreen button

vpplayer.showFullScreenButton()
vpplayer.hideFullScreenButton()

Show/Hide chromecast button

vpplayer.showChromeCastButton()
vpplayer.hideChromeCastButton()
[vpplayer hideChromeCastButton];

Show/Hide sliding panel

vpplayer.showSlidingPanel()
vpplayer.hideSlidingPanel()

Show/Hide logo view

vpplayer.showLogoView()
vpplayer.hideLogoView()

Show/Hide live icon

vpplayer.showLiveIcon()
vpplayer.hideLiveIcon()

Overlays

Add overlay

vpplauer.addOverlay(view: "Your view", identifier: "Identifier for the overlay")

Remove overlay with specific Identifier

vpplayer.removeOverlay(identifier: "Overlay Identifier to remove")

Get overlay with specific Identifier it returns UIView

vpplayer.getOverlay(identifier: "Overlay Identifier")

Configs

To force sound, set config to true

vpplayer.forceSound = true

To show helper button, set config to true

vpplayer.showHelperButton = true