Skip to content

Commit

Permalink
squashed changes
Browse files Browse the repository at this point in the history
  • Loading branch information
daytime-em committed Oct 11, 2024
1 parent 03b8023 commit ba7045c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.mux.stats.sdk.core.model.CustomerViewData
import com.mux.stats.sdk.core.util.UUID
import com.mux.player.MuxPlayer
import com.mux.player.media3.R
import com.mux.player.media3.databinding.ActivityBasicPlayerBinding
import com.mux.player.media3.databinding.ActivityConfigurablePlayerBinding

/**
* A configurable example that uses the normal media3 player UI to play a video in the foreground from
Expand All @@ -30,7 +30,7 @@ import com.mux.player.media3.databinding.ActivityBasicPlayerBinding
*/
class ConfigurablePlayerActivity : AppCompatActivity() {

private lateinit var binding: ActivityBasicPlayerBinding
private lateinit var binding: ActivityConfigurablePlayerBinding
private val playerView get() = binding.player

private val playbackParamsHelper = PlaybackParamsHelper()
Expand All @@ -39,7 +39,7 @@ class ConfigurablePlayerActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityBasicPlayerBinding.inflate(layoutInflater)
binding = ActivityConfigurablePlayerBinding.inflate(layoutInflater)
setContentView(binding.root)

if (savedInstanceState != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,16 @@ import androidx.media3.common.MediaMetadata
import androidx.media3.common.PlaybackException
import androidx.media3.common.Player
import androidx.media3.common.util.UnstableApi
import com.mux.stats.sdk.core.model.CustomData
import com.mux.stats.sdk.core.model.CustomerData
import com.mux.stats.sdk.core.model.CustomerVideoData
import com.mux.stats.sdk.core.model.CustomerViewData
import com.mux.stats.sdk.core.util.UUID
import com.mux.player.MuxPlayer
import com.mux.player.media.MediaItems
import com.mux.player.media.PlaybackResolution
import com.mux.player.media.RenditionOrder
import com.mux.player.media3.PlaybackIds
import com.mux.player.media3.R
import com.mux.player.media3.databinding.ActivityBasicPlayerBinding
import com.mux.player.media3.databinding.ActivityConfigurablePlayerBinding

/**
* Example Activity that enables smart caching
*/
class SmartCacheActivity : AppCompatActivity() {

private lateinit var binding: ActivityBasicPlayerBinding
private lateinit var binding: ActivityConfigurablePlayerBinding
private val playerView get() = binding.player

private val playbackParamsHelper = PlaybackParamsHelper()
Expand All @@ -40,7 +31,7 @@ class SmartCacheActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityBasicPlayerBinding.inflate(layoutInflater)
binding = ActivityConfigurablePlayerBinding.inflate(layoutInflater)
setContentView(binding.root)

if (savedInstanceState != null) {
Expand Down
181 changes: 3 additions & 178 deletions app/src/main/res/layout/activity_basic_player.xml
Original file line number Diff line number Diff line change
@@ -1,191 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".examples.ConfigurablePlayerActivity">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.media3.ui.PlayerView
android:id="@+id/player"
android:layout_width="match_parent"
android:layout_height="320dp"
app:layout_constraintTop_toTopOf="parent" />

<!-- playback ID -->
<TextView
android:id="@+id/basic_player_playback_id_lbl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:layout_marginTop="8dp"
android:text="@string/label_playback_id"
android:textAppearance="@style/TextAppearance.App.PlaybackParamLabel"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/player" />

<EditText
android:id="@+id/basic_player_playback_id_in"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:backgroundTint="@color/Gray30"
android:paddingEnd="24dp"
android:textColor="@color/White"
android:textColorHint="@color/Gray70"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/basic_player_playback_id_lbl" />

<ImageButton
android:id="@+id/playback_id_clear"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginEnd="8dp"
android:background="@null"
android:scaleType="centerInside"
android:src="@drawable/quantum_ic_clear_white_24"
app:layout_constraintBottom_toBottomOf="@id/basic_player_playback_id_in"
app:layout_constraintEnd_toEndOf="@id/basic_player_playback_id_in"
app:layout_constraintTop_toTopOf="@id/basic_player_playback_id_in" />

<!-- custom domain -->

<TextView
android:id="@+id/basic_player_domain_lbl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:layout_marginTop="8dp"
android:text="@string/label_custom_domain"
android:textAppearance="@style/TextAppearance.App.PlaybackParamLabel"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/basic_player_playback_id_in" />

<!-- hint set in code -->
<EditText
android:id="@+id/basic_player_domain_in"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:backgroundTint="@color/Gray30"
android:paddingEnd="24dp"
android:textColor="@color/White"
android:textColorHint="@color/Gray70"
android:textSize="18sp"
android:hint="@string/unspecified_custom_domain"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/basic_player_domain_lbl" />

<ImageButton
android:id="@+id/domain_clear"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginEnd="8dp"
android:background="@null"
android:scaleType="centerInside"
android:src="@drawable/quantum_ic_clear_white_24"
app:layout_constraintBottom_toBottomOf="@id/basic_player_domain_in"
app:layout_constraintEnd_toEndOf="@id/basic_player_domain_in"
app:layout_constraintTop_toTopOf="@id/basic_player_domain_in" />

<!-- playback token -->

<TextView
android:id="@+id/basic_player_playback_token_lbl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="@string/label_playback_token"
android:textAppearance="@style/TextAppearance.App.PlaybackParamLabel"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/basic_player_domain_in" />

<!-- hint set in code -->
<EditText
android:id="@+id/basic_player_playback_token_in"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:backgroundTint="@color/Gray30"
android:hint="@string/unspecified_token"
android:paddingEnd="24dp"
android:textColor="@color/White"
android:textColorHint="@color/Gray70"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/basic_player_playback_token_lbl" />

<ImageButton
android:id="@+id/playback_token_clear"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginEnd="8dp"
android:background="@null"
android:scaleType="centerInside"
android:src="@drawable/quantum_ic_clear_white_24"
app:layout_constraintBottom_toBottomOf="@id/basic_player_playback_token_in"
app:layout_constraintEnd_toEndOf="@id/basic_player_playback_token_in"
app:layout_constraintTop_toTopOf="@id/basic_player_playback_token_in" />

<TextView
android:id="@+id/basic_player_drm_token_lbl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="@string/label_drm_token"
android:textAppearance="@style/TextAppearance.App.PlaybackParamLabel"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/basic_player_playback_token_in" />

<!-- hint set in code -->
<EditText
android:id="@+id/basic_player_drm_token_in"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:backgroundTint="@color/Gray30"
android:hint="@string/unspecified_token"
android:paddingEnd="24dp"
android:textColor="@color/White"
android:textColorHint="@color/Gray70"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/basic_player_drm_token_lbl" />

<ImageButton
android:id="@+id/drm_token_clear"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginEnd="8dp"
android:background="@null"
android:scaleType="centerInside"
android:src="@drawable/quantum_ic_clear_white_24"
app:layout_constraintBottom_toBottomOf="@id/basic_player_drm_token_in"
app:layout_constraintEnd_toEndOf="@id/basic_player_drm_token_in"
app:layout_constraintTop_toTopOf="@id/basic_player_drm_token_in" />

<Button
android:id="@+id/basic_player_update_media_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:layout_marginStart="8dp"
android:text="@string/update_tokens_ids"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/basic_player_drm_token_in" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit ba7045c

Please sign in to comment.