Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #461

Merged
merged 8 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ jobs:
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
script: >
./gradlew
:pillarbox-analytics:connectedDebugAndroidTest
:pillarbox-core-business:connectedDebugAndroidTest
:pillarbox-player:connectedDebugAndroidTest
:pillarbox-ui:connectedDebugAndroidTest
# Supported tasks per module
# :pillarbox-analytics:connectedDebugAndroidTest
# :pillarbox-core-business:connectedDebugAndroidTest
# :pillarbox-player:connectedDebugAndroidTest
# :pillarbox-ui:connectedDebugAndroidTest
script: ./gradlew :pillarbox-player:connectedDebugAndroidTest
11 changes: 6 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ accompanist = "0.34.0"
android-gradle-plugin = "8.3.0"
androidx-activity = "1.8.2"
androidx-annotation = "1.7.1"
androidx-compose = "2024.02.01"
androidx-compose = "2024.02.02"
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin
androidx-compose-compiler = "1.5.10"
androidx-core = "1.12.0"
androidx-fragment = "1.6.2"
androidx-leanback = "1.0.0"
androidx-lifecycle = "2.7.0"
androidx-media = "1.7.0"
androidx-media3 = "1.2.1"
androidx-media3 = "1.3.0"
androidx-navigation = "2.7.7"
androidx-paging = "3.2.1"
androidx-test-core = "1.5.0"
androidx-test-ext-junit = "1.1.5"
androidx-test-monitor = "1.6.1"
androidx-test-runner = "1.5.2"
androidx-tv = "1.0.0-alpha10"
coil = "2.5.0"
coil = "2.6.0"
comscore = "6.10.0"
dependency-analysis-gradle-plugin = "1.30.0"
detekt = "1.23.5"
guava = "31.1-android"
json = "20240205"
guava = "32.1.3-android"
json = "20240303"
junit = "4.13.2"
kotlin = "1.9.22"
kotlinx-coroutines = "1.8.0"
Expand Down Expand Up @@ -65,6 +65,7 @@ androidx-test-runner = { module = "androidx.test:runner", version.ref = "android
androidx-tv-foundation = { module = "androidx.tv:tv-foundation", version.ref = "androidx-tv" }
androidx-tv-material = { module = "androidx.tv:tv-material", version.ref = "androidx-tv" }
coil = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }
coil-base = { module = "io.coil-kt:coil-compose-base", version.ref = "coil" }
json = { module = "org.json:json", version.ref = "json" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Expand Down
2 changes: 0 additions & 2 deletions pillarbox-core-business/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ dependencies {
implementation(libs.okhttp.logging.interceptor)
api(libs.tagcommander.core)

testImplementation(project(":pillarbox-player-testutils"))

testImplementation(libs.androidx.media3.test.utils)
testImplementation(libs.androidx.media3.test.utils.robolectric)
testImplementation(libs.androidx.test.core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import ch.srgssr.pillarbox.core.business.integrationlayer.service.MediaCompositi
import ch.srgssr.pillarbox.core.business.tracker.DefaultMediaItemTrackerRepository
import ch.srgssr.pillarbox.core.business.tracker.comscore.ComScoreTracker
import ch.srgssr.pillarbox.player.data.MediaItemSource
import ch.srgssr.pillarbox.player.test.utils.TestPillarboxRunHelper
import ch.srgssr.pillarbox.player.tracker.MediaItemTrackerRepository
import io.mockk.Called
import io.mockk.confirmVerified
Expand Down Expand Up @@ -136,7 +135,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

player.setMediaItem(MediaItemUrn(URN_NOT_LIVE_VIDEO))
player.playWhenReady = true
Expand Down Expand Up @@ -177,7 +176,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

verifyOrder {
commandersAct.enableRunningInBackground()
Expand Down Expand Up @@ -227,7 +226,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

verifyOrder {
commandersAct.enableRunningInBackground()
Expand All @@ -252,7 +251,7 @@ class CommandersActTrackerIntegrationTest {
player.setPlaybackSpeed(2f)

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

verifyOrder {
commandersAct.enableRunningInBackground()
Expand All @@ -276,7 +275,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

clock.advanceTime(5.minutes.inWholeMilliseconds)
player.setPlaybackSpeed(2f)
Expand Down Expand Up @@ -305,7 +304,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

clock.advanceTime(2.minutes.inWholeMilliseconds)
player.playWhenReady = false
Expand Down Expand Up @@ -340,7 +339,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

clock.advanceTime(2.minutes.inWholeMilliseconds)
player.playWhenReady = false
Expand Down Expand Up @@ -386,7 +385,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

clock.advanceTime(2.minutes.inWholeMilliseconds)
player.stop()
Expand Down Expand Up @@ -420,7 +419,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

clock.advanceTime(2.minutes.inWholeMilliseconds)
player.seekTo(30.seconds.inWholeMilliseconds)
Expand Down Expand Up @@ -489,7 +488,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

clock.advanceTime(2.seconds.inWholeMilliseconds)
advanceTimeBy(2.seconds)
Expand Down Expand Up @@ -599,7 +598,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

clock.advanceTime(playTime.inWholeMilliseconds)
advanceTimeBy(playTime)
Expand Down Expand Up @@ -712,7 +711,7 @@ class CommandersActTrackerIntegrationTest {
player.playWhenReady = true

TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY)
TestPillarboxRunHelper.runUntilStartOfMediaItem(player, 0)
TestPlayerRunHelper.playUntilStartOfMediaItem(player, 0)

clock.advanceTime(playTime.inWholeMilliseconds)
advanceTimeBy(playTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ data class DemoItem(

val OnDemandAudio = DemoItem(
title = "On-demand audio stream",
description = "Il lavoro di TerraProject per una fotografia documentaria",
uri = "urn:rsi:audio:8833144"
description = "Nachrichten von 08:00 Uhr - 08.03.2024",
uri = "rn:srf:audio:b9706015-632f-4e24-9128-5de074d98eda"
)

val Expired = DemoItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ data class Playlist(val title: String, val items: List<DemoItem>, val descriptio
imageUrl = "https://ws.srf.ch/asset/image/audio/d91bbe14-55dd-458c-bc88-963462972687/EPISODE_IMAGE"
),
DemoItem(
title = "Il lavoro di TerraProject per una fotografia documentaria",
uri = "urn:rsi:audio:8833144",
title = "Nachrichten von 08:00 Uhr - 08.03.2024",
uri = "urn:srf:audio:b9706015-632f-4e24-9128-5de074d98eda",
description = "On-demand audio stream"
)
)
Expand Down
1 change: 1 addition & 0 deletions pillarbox-demo-tv/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ dependencies {
implementation(libs.androidx.tv.foundation)
implementation(libs.androidx.tv.material)
implementation(libs.coil)
implementation(libs.coil.base)
implementation(libs.kotlin.stdlib)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.leanback)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ import androidx.media3.common.PlaybackParameters
import androidx.media3.common.Player
import androidx.media3.common.util.Assertions
import androidx.media3.common.util.Clock
import androidx.media3.common.util.ConditionVariable
import androidx.media3.common.util.Util
import androidx.media3.exoplayer.ExoPlayer
import androidx.media3.test.utils.robolectric.RobolectricUtil
import androidx.media3.test.utils.robolectric.TestPlayerRunHelper
import java.util.concurrent.TimeoutException
import java.util.concurrent.atomic.AtomicBoolean

Expand Down Expand Up @@ -85,50 +82,4 @@ object TestPillarboxRunHelper {
throw IllegalStateException(player.playerError)
}
}

/**
* Same as [TestPlayerRunHelper.playUntilStartOfMediaItem], but doesn't pause the player afterwards.
*
* @param player The [Player].
* @param mediaItemIndex The index of the media item.
*
* @throws TimeoutException If the [default timeout][RobolectricUtil.DEFAULT_TIMEOUT_MS] is exceeded.
*
* @see TestPlayerRunHelper.playUntilStartOfMediaItem
*/
@Throws(TimeoutException::class)
fun runUntilStartOfMediaItem(player: ExoPlayer, mediaItemIndex: Int) {
verifyMainTestThread(player)
verifyPlaybackThreadIsAlive(player)

val applicationLooper = Util.getCurrentOrMainLooper()
val messageHandled = AtomicBoolean(false)

player
.createMessage { _, _ ->
// Block playback thread until pause command has been sent from test thread.
val blockPlaybackThreadCondition = ConditionVariable()

player.clock
.createHandler(applicationLooper, null)
.post {
messageHandled.set(true)
blockPlaybackThreadCondition.open()
}

try {
player.clock.onThreadBlocked()
blockPlaybackThreadCondition.block()
} catch (e: InterruptedException) {
// Ignore.
}
}
.setPosition(mediaItemIndex, 0L)
.send()
player.play()
RobolectricUtil.runMainLooperUntil { messageHandled.get() || player.playerError != null }
if (player.playerError != null) {
throw IllegalStateException(player.playerError)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object ContentUrls {
const val VOD_DASH_H265 = "https://storage.googleapis.com/wvmedia/clear/hevc/tears/tears.mpd"
const val LIVE_HLS = "https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8?dw=0"
const val LIVE_DVR_HLS = "https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8"
const val AOD_MP3 = "https://srfaudio-a.akamaihd.net/delivery/world/6adee39a-e56e-4b22-9e38-2620ef5556ec.mp3"
const val AOD_MP3 = "https://srfaudio-a.akamaihd.net/delivery/world/af671f12-6f17-415a-9dd8-b8aee24cce8b.mp3"
const val AUDIO_LIVE_MP3 = "https://stream.srg-ssr.ch/m/la-1ere/mp3_128"
const val AUDIO_LIVE_DVR_HLS = "https://lsaplus.swisstxt.ch/audio/couleur3_96.stream/playlist.m3u8"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
*/
package ch.srgssr.pillarbox.ui

import androidx.compose.runtime.Stable
import androidx.media3.common.Player
import kotlinx.coroutines.flow.StateFlow
import kotlin.time.Duration

/**
* Interface used to subscribe to and update the [Player] progression.
*/
@Stable
interface ProgressTrackerState {
/**
* Emits the current progress, which can be either the value being manually set, or the actual [Player] progress.
Expand Down
Loading