Arc XPVideo Config
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?
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
These are the types of streams that can be sent to the player.
Functions
Properties
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.
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.