ArcXPVideoConfig

class ArcXPVideoConfig

This class is used to define a configuration to be used by the ArcMediaPlayer.

How does it relate to other important Video SDK classes?

Once an object is created it can be passed into the media player using the configureMediaPlayer() method. This object is also created in the media player and populated using the setter methods that mirror the methods in the configuration object

What are the core components that make it up?

ArcXPVideoConfig.Builder

How is this class used?

Use the ArcXPVideoConfig.Builder to create an ArcMediaPlayerConfig object.

val mediaPlayer = MediaPlayer.createPlayer(this)
val config = ArcMediaConfig.Builder()
.setActivity(this)
.setVideoFrame(arcVideoFrame)
.enablePip(true)
.setViewsToHide(view1, view2, view3 ….)
...
.build()

mediaPlayer.configureMediaPlayer(config)

SetPreferredStreamType and setMaxBitRate

An ArcVideoStreamObject can return multiple streams that each have a different video type and bit rate. The stream to play will be chosen based on a preferred stream type and a maximum bit rate that is desired. The preferred streams have a hierarchy that is HLS, TS, MP4, GIF, GIF-MP4. The algorithm to choose the correct stream will loop through all available streams of the preferred type. Of those it will find the one that does not exceed the given max bit rate. If a stream of the preferred type does not exist then it will go to the next preferred stream type and repeat the search, working its way down until it finds a stream that does not exceed the bit rate. For example, if the preferred type is set to TS and there are no TS streams in the object then it will repeat the search using MP4, then GIF, then GIF-MP4.

Adding Overlays

One or more views can be added on top of the video view using the configuration option addOverlay(). This method takes a tag name for the view as well as the view. The client app will still have a pointer to the overlays so they can then control the visibility or other parameters of the views from within the client code. This method can be called multiple times in order to add multiple overlays. The views can be retrieved and removed through the media player as follows:

    mediaPlayer.getOverlay(tag)
mediaPlayer.removeOverlay(tag)

Adding Ad Params

A single ad parameter can be added using the method addAdParam(key, value). Multiple calls to this method can be made. This method takes a key and a value and will be added to the call as a JSON entry of the format

    { “adParams” : {
“key1”: “value1”,
“key2”: “value2”
}
}

Types

Link copied to clipboard
class Builder

This is the builder class for ArcMediaPlayerConfig objects.

Link copied to clipboard
enum CCStartMode : Enum<ArcXPVideoConfig.CCStartMode>
Link copied to clipboard

These are the types of streams that can be sent to the player.

Link copied to clipboard
enum VideoResizeMode : Enum<ArcXPVideoConfig.VideoResizeMode>

Functions

Link copied to clipboard
fun enableClosedCaption(): Boolean
Link copied to clipboard

Properties

Link copied to clipboard
val activity: Activity? = null

The parent activity for the player. This must be set.

Link copied to clipboard
val adConfig: AdConfig?
Link copied to clipboard
val adConfigUrl: String?
Link copied to clipboard
val adParams: HashMap<String, String>

Add a single ad parameter to be sent to MediaTailor. Multiple calls to this method can be made. This method takes a key and a value and will be added to the call as a JSON entry of the format { “adParams” : { “key1”: “value1”, “key2”: “value2” } }

Link copied to clipboard
var arcCastManager: ArcCastManager?

Sets the cast manager for enabling Chromecast.

Link copied to clipboard
val artworkUrl: String? = null

The artwork picture address that will be used by Chromecast

Link copied to clipboard
val ccStartMode: ArcXPVideoConfig.CCStartMode

CCStartMode has the following values: ON - Closed Captioning is on by default but can be turned off. OFF - Closed Captioning is off by default but can be turned on. DEFAULT - Closed Captioning follows the Captioning Service setting of the device. Works for Android 19 and above only.

Link copied to clipboard
val controlsShowTimeoutMs: Int?

Set the amount of time the player controls are shown before disappearing.

Link copied to clipboard
val disableErrorOverlay: Boolean = false

Disable Error overlaying video, if you don't want this feature and want to do your own error display

Link copied to clipboard
val exoplayerVersion: String
Link copied to clipboard
val isAutoShowControls: Boolean = true

Determines if the player controls show automatically when playback ends. Default is true.

Link copied to clipboard
val isAutoStartPlay: Boolean = true

Automatically start playing the video after it becomes ready. Default value is true.

Link copied to clipboard
val isDisableControls: Boolean = false

set this to true when you do not want any playback controls to appear at any time this disables all the button listeners and should not display controls ever default is false

Link copied to clipboard
val isEnableAds: Boolean = false

This flag indicates if ads should not be shown as part of the video content. This is for Google IMA ads only. Default value = false.

Link copied to clipboard
val isEnableClientSideAds: Boolean

Enable client side ad reporting.

Link copied to clipboard
val isEnableOmid: Boolean = false
Link copied to clipboard
val isEnablePAL: Boolean = false
Link copied to clipboard
val isEnablePip: Boolean = false

Enable picture-in-picture(PIP). If it is on then the video controls will have a pip menu button. PIP will occur when the button is pressed or the user presses the back button while a video is playing. Default value = false.

Link copied to clipboard
val isEnableServerSideAds: Boolean = false

Make the server call to enable server side ads. Will only work with ArcVideoStream objects that have ads enabled. Default is false.

Link copied to clipboard
val isFocusSkipButton: Boolean = true

Place focus on the skip button when it is shown during skippable ads. This is for Google IMA ads only. Default is true.

Link copied to clipboard
val isHideControlsWithTouch: Boolean = false

Disable showing the player controls when the user touches the screen. This will require the user to handle video player touches. Default is false.

Link copied to clipboard
val isKeepControlsSpaceOnHide: Boolean = true
Link copied to clipboard
val isLoggingEnabled: Boolean = false

Turn on enhanced logging that will show up in the logcat log. Default value is false.

Link copied to clipboard
val isShowClosedCaptionTrackSelection: Boolean = true

If true then the track selection dialog will be shown that allows the user to select the closed captioning track. If false then the CC button will toggle between off and the default CC track. Default is true.

Link copied to clipboard
val isShowCountDown: Boolean = true

Show or hide the countdown text on the video progress bar on the player control bar. Default is true.

Link copied to clipboard
val isShowProgressBar: Boolean = true

Show or hide the player video progress bar including the countdown text on the player control bar. Default is true.

Link copied to clipboard
val isShowSeekButton: Boolean

Show or hide the rewind and fast forward buttons on the player control bar. Default is true.

Link copied to clipboard
val isStartMuted: Boolean = false

Start the video muted. Default is false.

Link copied to clipboard
val isUseFullScreenDialog: Boolean = false

Fullscreen can be displayed in two different ways, as a dialog or by expanding the layout_height and layout_width parameters of the ArcVideoFrame to match_parent. This method determines if the dialog should be used. Default setting is false. If your layout has the ArcVideoFrame element a direct child of the root view then setting this to false will work because the frame will expand to the full size of the screen. If your layout has the ArcVideoFrame as a child of a view that is not the root view and that parent is not the full size of the screen then you should use a dialog because expanding the height and width of the video frame will not take up the whole screen. Default value is false.

Link copied to clipboard
val maxBitRate: Int

The maximum bit rate of the video to play when there are multiple streams to choose from. This is used in conjunction with the setPreferredStreamType() method.

Link copied to clipboard
val mShowClosedCaption: Boolean = false

Show or hide the closed caption button on the player control bar. Default is false.

Link copied to clipboard
val omidPartnerName: String
Link copied to clipboard
val omidPpid: String
Link copied to clipboard
val omidVersionName: String
Link copied to clipboard
val overlays: HashMap<String, View>

One or more views can be added on top of the video view. This method takes a tag name for the view as well as the view. The client app will still have a pointer to the overlays so they can then control the visibility or other parameters of the views from within the client code.

Link copied to clipboard
val palPartnerName: String
Link copied to clipboard
val palPpid: String
Link copied to clipboard
val palVersionName: String
Link copied to clipboard
val shouldDisableNextButton: Boolean = false

if either of these are enabled, the corresponding button will be disabled. main use case here is disabling next button at end of (app-managed) playlist when there is no next video. Default behavior for previous button on first entry in list is to replay that entry, but perhaps you would rather disable the previous button.

Link copied to clipboard
val shouldDisablePreviousButton: Boolean = false
Link copied to clipboard
val showFullScreenButton: Boolean

if enabled will show fullscreen button to toggle full screen mode

Link copied to clipboard
val showNextPreviousButtons: Boolean = false

if enabled will show next/previous buttons and call back clicks if playing single video, the call backs must perform any desired functionality if playing playlist via findbyUUids (and mVideos.size 1), will show regardless of this boolean and have functionality with that (sdk-managed) playlist.

Link copied to clipboard
val showTitleOnController: Boolean

if enabled will show video title when controls are displayed

Link copied to clipboard
val showVolumeButton: Boolean

if enabled will show volume button to toggle mute

Link copied to clipboard
val userAgent: String? = null

The string that is used as the User-Agent key that can be attached to the header of the call to enable server side ads.

Link copied to clipboard
val videoFrame: ArcVideoFrame? = null

The ArcVideoFrame object for the player. This must be set.

Link copied to clipboard
val videoResizeMode: ArcXPVideoConfig.VideoResizeMode

Resize mode for the video.

Link copied to clipboard
var viewsToHide: List<View>?

This is a variable size list of views that will be hidden when PIP occurs. All views that are visible on the screen with the exception of the ArcVideoFrame should be listed here. The views in this list will be set to GONE when PIP occurs so that only the video frame is showing.