Skip to content

Commit

Permalink
Migrate samples to Media3 (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
nandovelazquez authored Dec 6, 2024
1 parent db445d2 commit ec44812
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.content.res.ColorStateList
import android.graphics.Color
import android.net.Uri
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuItem
Expand All @@ -17,9 +16,12 @@ import android.view.animation.AccelerateInterpolator
import android.view.animation.AlphaAnimation
import android.view.animation.DecelerateInterpolator
import androidx.core.view.MenuItemCompat
import androidx.media3.common.Player
import androidx.media3.exoplayer.ExoPlayer
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.brightcove.audio.sample.databinding.ItemAudioBinding
import com.brightcove.playback.notification.BackgroundPlaybackNotification
import com.brightcove.player.appcompat.BrightcovePlayerActivity
import com.brightcove.player.display.ExoPlayerVideoDisplayComponent
import com.brightcove.player.edge.Catalog
Expand All @@ -28,12 +30,9 @@ import com.brightcove.player.model.Playlist
import com.brightcove.player.playback.PlaybackNotification
import com.brightcove.player.playback.PlaybackNotificationConfig
import com.brightcove.player.view.BrightcoveExoPlayerVideoView
import com.google.android.exoplayer2.ExoPlayer
import com.google.android.exoplayer2.Player
import com.squareup.picasso.Picasso
import com.brightcove.audio.sample.databinding.ActivityAudioOnlyBinding as ViewBinding
import com.brightcove.player.model.Video as Media
import com.brightcove.playback.notification.BackgroundPlaybackNotification


class AudioOnlyActivity : BrightcovePlayerActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.view.View;
import android.widget.ImageButton;

import androidx.media3.common.Player;
import androidx.recyclerview.widget.RecyclerView;

import com.brightcove.playback.notification.BackgroundPlaybackNotification;
Expand All @@ -21,7 +22,6 @@
import com.brightcove.player.playback.PlaybackNotificationConfig;
import com.brightcove.player.view.BrightcoveExoPlayerVideoView;
import com.brightcove.player.view.BrightcovePlayer;
import com.google.android.exoplayer2.Player;

public class MainActivity extends BrightcovePlayer {

Expand Down Expand Up @@ -143,17 +143,17 @@ public void useRepeat(){
if (repeatState == 0){
repeatState = 1;
exoVideoDisplayComponent.getExoPlayer().setRepeatMode(Player.REPEAT_MODE_ONE);
actionRepeatButton.setImageResource(R.drawable.exo_media_action_repeat_one);
actionRepeatButton.setImageResource(R.drawable.ic_repeat_once_white_24dp);
}
else if (repeatState == 1){
repeatState = 2;
exoVideoDisplayComponent.getExoPlayer().setRepeatMode(Player.REPEAT_MODE_ALL);
actionRepeatButton.setImageResource(R.drawable.exo_media_action_repeat_all);
actionRepeatButton.setImageResource(R.drawable.ic_repeat_white_24dp);
}
else if (repeatState == 2){
repeatState = 0;
exoVideoDisplayComponent.getExoPlayer().setRepeatMode(Player.REPEAT_MODE_OFF);
actionRepeatButton.setImageResource(R.drawable.exo_media_action_repeat_off);
actionRepeatButton.setImageResource(R.drawable.ic_repeat_off_white_24dp);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Native Player version.
android.enableJetifier=true
android.useAndroidX=true
anpVersion=9.2.2
anpVersion=10.0.0
org.gradle.jvmargs=-Xmx6g -XX:+UseParallelGC -XX:MaxMetaspaceSize=4g

0 comments on commit ec44812

Please sign in to comment.