Skip to content

Commit

Permalink
Bump player version to 3.103.0
Browse files Browse the repository at this point in the history
  • Loading branch information
matamegger committed Feb 14, 2025
1 parent 510d63b commit 02b6731
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,16 @@ private void initializePlayer() {
.configureAnalytics(new AnalyticsConfig(key))
.build();

PlayerViewConfig viewConfig = new PlayerViewConfig(
new UiConfig.WebUi(
"file:///android_asset/bitmovinplayer-ui.css",
null,
"file:///android_asset/bitmovinplayer-ui.js",
true,
false,
null,
UiConfig.WebUi.Variant.TvUi.INSTANCE,
true
),
false,
ScalingMode.Fit,
false,
SurfaceType.SurfaceView
);
PlayerViewConfig viewConfig = new PlayerViewConfig.Builder()
.setUiConfig(
new UiConfig.WebUi.Builder()
.setCssLocation("file:///android_asset/bitmovinplayer-ui.css")
.setJsLocation("file:///android_asset/bitmovinplayer-ui.js")
.setVariant(UiConfig.WebUi.Variant.TvUi.INSTANCE)
.setFocusUiOnInitialization(true)
.build()
)
.build();

playerView = new PlayerView(this, player, viewConfig);

Expand All @@ -85,14 +79,14 @@ private void initializePlayer() {
}

private PlayerConfig createPlayerConfig() {
// Creating a new PlayerConfig
PlayerConfig playerConfig = new PlayerConfig();
// Build a new PlayerConfig
PlayerConfig.Builder playerConfigBuilder = new PlayerConfig.Builder();

PlaybackConfig playbackConfig = new PlaybackConfig();
playbackConfig.setAutoplayEnabled(true);
playerConfig.setPlaybackConfig(playbackConfig);
PlaybackConfig.Builder playbackConfig = new PlaybackConfig.Builder();
playbackConfig.setIsAutoplayEnabled(true);
playerConfigBuilder.setPlaybackConfig(playbackConfig.build());

return playerConfig;
return playerConfigBuilder.build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ protected void onCreate(Bundle savedInstanceState) {
AdvertisingConfig advertisingConfig = new AdvertisingConfig(preRoll, midRoll, postRoll);

// Create a new PlayerConfiguration
PlayerConfig playerConfig = new PlayerConfig();
PlayerConfig.Builder playerConfigBuilder = new PlayerConfig.Builder();

// Add the AdvertisingConfig to the PlayerConfig. Ads in the AdvertisingConfig will be scheduled automatically.
playerConfig.setAdvertisingConfig(advertisingConfig);
playerConfigBuilder.setAdvertisingConfig(advertisingConfig);

// Create new BitmovinPlayerView with our PlayerConfiguration and AnalyticsConfiguration
String key = "{ANALYTICS_LICENSE_KEY}";
Player player = new PlayerBuilder(this)
.setPlayerConfig(playerConfig)
.setPlayerConfig(playerConfigBuilder.build())
.configureAnalytics(new AnalyticsConfig(key))
.build();
playerView = new PlayerView(this, player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ protected void onCreate(Bundle savedInstanceState) {
AdvertisingConfig advertisingConfig = new AdvertisingConfig(companionAdContainerList, adItem);

// Setup the player
PlayerConfig playerConfig = new PlayerConfig();
playerConfig.setAdvertisingConfig(advertisingConfig);
PlayerConfig.Builder playerConfigBuilder = new PlayerConfig.Builder();
playerConfigBuilder.setAdvertisingConfig(advertisingConfig);

String key = "{ANALYTICS_LICENSE_KEY}";
Player bitmovinPlayer = new PlayerBuilder(this)
.setPlayerConfig(playerConfig)
.setPlayerConfig(playerConfigBuilder.build())
.configureAnalytics(new AnalyticsConfig(key))
.build();
bitmovinPlayerView.setPlayer(bitmovinPlayer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,18 @@ protected void onDestroy() {

private PlayerConfig createPlayerConfig() {
// Setup adaptation config
AdaptationConfig adaptationConfig = new AdaptationConfig();
adaptationConfig.setRebufferingAllowed(true);
adaptationConfig.setMaxSelectableVideoBitrate(800_000);
adaptationConfig.setStartupBitrate(1_200_000);
adaptationConfig.setVideoAdaptation(videoAdaptationListener);
AdaptationConfig.Builder adaptationConfigBuilder = new AdaptationConfig.Builder()
.setRebufferingAllowed(true)
.setMaxSelectableVideoBitrate(800_000)
.setInitialBandwidthEstimateOverride(1_200_000L)
.setVideoAdaptation(videoAdaptationListener);


// Assign adaptation to player config
PlayerConfig playerConfig = new PlayerConfig();
playerConfig.setAdaptationConfig(adaptationConfig);
return playerConfig;
PlayerConfig.Builder playerConfigBuilder = new PlayerConfig.Builder();
AdaptationConfig adaptationConfig = adaptationConfigBuilder.build();
playerConfigBuilder.setAdaptationConfig(adaptationConfig);
return playerConfigBuilder.build();
}

private final VideoAdaptation videoAdaptationListener = new VideoAdaptation() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,14 @@ protected void onCreate(Bundle savedInstanceState) {
/*
* Go to https://github.com/bitmovin/bitmovin-player-ui to get started with creating a custom player UI.
*/
PlayerViewConfig viewConfig = new PlayerViewConfig(
new UiConfig.WebUi(
"file:///android_asset/custom-bitmovinplayer-ui.min.css",
null,
"file:///android_asset/custom-bitmovinplayer-ui.min.js",
true,
false,
null,
UiConfig.WebUi.Variant.SmallScreenUi.INSTANCE,
false
),
false,
ScalingMode.Fit,
false,
SurfaceType.SurfaceView
);
PlayerViewConfig viewConfig = new PlayerViewConfig.Builder()
.setUiConfig(
new UiConfig.WebUi.Builder()
.setCssLocation("file:///android_asset/custom-bitmovinplayer-ui.min.css")
.setJsLocation("file:///android_asset/custom-bitmovinplayer-ui.min.js")
.build()
)
.build();

// Create a custom javascriptInterface object which takes over the Bitmovin Web UI -> native calls
Object javascriptInterface = new Object() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,9 @@ public PlayerUI(Context context, Player player) {
this.player = player;

// Create a PlayerViewConfig with a disabled UI
PlayerViewConfig viewConfig = new PlayerViewConfig(
UiConfig.Disabled.INSTANCE,
false,
ScalingMode.Fit,
false,
SurfaceType.SurfaceView
);
PlayerViewConfig viewConfig = new PlayerViewConfig.Builder()
.setUiConfig(UiConfig.Disabled.INSTANCE)
.build();
playerView = new PlayerView(context, player, viewConfig);
playerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
playerView.setKeepScreenOn(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,9 @@ protected void onCreate(Bundle savedInstanceState) {
Player player = new PlayerBuilder(this)
.configureAnalytics(new AnalyticsConfig(key))
.build();
PlayerViewConfig viewConfig = new PlayerViewConfig(
// Disable default Player UI
UiConfig.Disabled.INSTANCE,
false,
ScalingMode.Fit,
false,
SurfaceType.SurfaceView
);
PlayerViewConfig viewConfig = new PlayerViewConfig.Builder()
.setUiConfig(UiConfig.Disabled.INSTANCE)
.build();
playerView = new PlayerView(this,
player,
viewConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ protected void onCreate(Bundle savedInstanceState) {
AdvertisingConfig advertisingConfig = new AdvertisingConfig(preRoll, midRoll, postRoll);

// Create a new PlayerConfiguration
PlayerConfig playerConfig = new PlayerConfig();
PlayerConfig.Builder playerConfigBuilder = new PlayerConfig.Builder();

// Add the AdvertisingConfig to the PlayerConfig. Ads in the AdvertisingConfig will be scheduled automatically.
playerConfig.setAdvertisingConfig(advertisingConfig);
playerConfigBuilder.setAdvertisingConfig(advertisingConfig);

// Create new BitmovinPlayerView with our PlayerConfiguration and AnalyticsConfiguration
String key = "{ANALYTICS_LICENSE_KEY}";
Player player = new PlayerBuilder(this)
.setPlayerConfig(playerConfig)
.setPlayerConfig(playerConfigBuilder.build())
.configureAnalytics(new AnalyticsConfig(key))
.build();
playerView = new PlayerView(this, player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void initializePlayer() {
0.5f
)
);
LiveConfig playerLiveConfig = new LiveConfig();
LiveConfig.Builder playerLiveConfig = new LiveConfig.Builder();
playerLiveConfig.addSynchronizationEntry(
"time.akamai.com",
LiveSynchronizationMethod.Ntp
Expand All @@ -97,14 +97,14 @@ private void initializePlayer() {
sourceConfig.setLiveConfig(sourceLiveConfig);

String analyticsKey = "{ANALYTICS_LICENSE_KEY}";
PlayerConfig playerConfig = new PlayerConfig();
PlaybackConfig playbackConfig = new PlaybackConfig();
playbackConfig.setAutoplayEnabled(true);
playerConfig.setPlaybackConfig(playbackConfig);
playerConfig.setLiveConfig(playerLiveConfig);
PlayerConfig.Builder playerConfigBuilder = new PlayerConfig.Builder();
PlaybackConfig.Builder playbackConfigBuilder = new PlaybackConfig.Builder();
playbackConfigBuilder.setIsAutoplayEnabled(true);
playerConfigBuilder.setPlaybackConfig(playbackConfigBuilder.build());
playerConfigBuilder.setLiveConfig(playerLiveConfig.build());

player = new PlayerBuilder(this)
.setPlayerConfig(playerConfig)
.setPlayerConfig(playerConfigBuilder.build())
.configureAnalytics(new AnalyticsConfig(analyticsKey))
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ protected void onCreate(Bundle savedInstanceState) {
AdvertisingConfig advertisingConfig = new AdvertisingConfig(preRoll, midRoll);

// Creating a new PlayerConfig
PlayerConfig playerConfig = new PlayerConfig();
PlayerConfig.Builder playerConfigBuilder = new PlayerConfig.Builder();
// Assign the AdvertisingConfig to the PlayerConfig
// All ads in the AdvertisingConfig will be scheduled automatically
playerConfig.setAdvertisingConfig(advertisingConfig);
playerConfigBuilder.setAdvertisingConfig(advertisingConfig);

// Create new PlayerView with our PlayerConfig
String key = "{ANALYTICS_LICENSE_KEY}";
Player player = new PlayerBuilder(this)
.setPlayerConfig(playerConfig)
.setPlayerConfig(playerConfigBuilder.build())
.configureAnalytics(new AnalyticsConfig(key))
.build();
playerView = new PlayerView(this, player);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ When you want to develop an own Android application using the Bitmovin Player An
It is recommended to reference a specific version as you can see below:
```
implementation 'com.bitmovin.player:player:3.102.0'
implementation 'com.bitmovin.player:player:3.103.0'
```
#### Additional SDK dependencies
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ext {
// Versions
imaSdkVersion = '3.35.1'
playServicesCastVersion = '21.4.0'
bitmovinPlayerVersion = '3.102.0'
bitmovinPlayerVersion = '3.103.0'
appcompat_version = "1.7.0"
activity_version = "1.9.3"
fragment_version = "1.8.5"
Expand Down

0 comments on commit 02b6731

Please sign in to comment.