The BridPlayer is a core component of our SDK and provides a simple and intuitive interface for managing media playback in your app. With the BridPlayer, you can easily load new media, control playback, and register event listeners to track and handle various player events.
Prepare Frame Layout
First, add the FrameLayout holder in your layout where you want player to show.
<FrameLayout android:id="@+id/bridVideoHolder" android:layout_width="match_parent" android:layout_height="wrap_content" />
Then in your Activity code just instantiate new Brid Player in that layout:
val videoHolder: FrameLayout = findViewById(R.id.bridVideoHolder) val bridPlayer: BridPlayer = BridPlayerBuilder(this, videoHolder).build()
FrameLayout videoHolder = findViewById(R.id.videoHolder); BridPlayer bridPlayer = new BridPlayerBuilder(this, videoHolder).build();
As shown in the example above, to create a BridPlayer object, you need to create a new BridPlayerBuilder object and pass it the context of your activity and the FrameLayout where the player will be displayed.
You can configure various parameters of the player using the methods provided by the BridPlayerBuilder class. A detailed description of all available parameters is provided in the following section.
Load video or playlist:
bridPlayer.loadVideo(playerId, videoId); bridPlayer.loadPlaylist(playerId, playlistId);
The playerID, videoID, and playlistID are generated from our platform, and in order to use them, you must have an active subscription to one of our plans.
Updated about 2 months ago