Skip to content

Commit

Permalink
Merge pull request #55 from THEOplayer/release/1.9.3
Browse files Browse the repository at this point in the history
Release 1.9.3
  • Loading branch information
MattiasBuelens authored Dec 17, 2024
2 parents 2e2bbeb + bd67391 commit 139702c
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
> - 🏠 Internal
> - 💅 Polish
## v1.9.3 (2024-12-17)

* 💥 Updated to Jetpack Compose version 1.7.5 ([BOM](https://developer.android.com/jetpack/compose/bom) 2024.11.00).
* 🐛 Fix `SeekBar` not working for livestreams with a large `player.seekable.start(0)`,
such as MPEG-DASH streams that use Unix timestamps for their MPD timeline. ([#52](https://github.com/THEOplayer/android-ui/pull/52))

## v1.9.2 (2024-10-15)

* 🐛 Fix `Player.cast` not available before first source change.
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {

android {
namespace = "com.theoplayer.android.ui.demo"
compileSdk = 34
compileSdk = 35

defaultConfig {
applicationId = "com.theoplayer.android.ui.demo"
minSdk = 21
targetSdk = 33
targetSdk = 35
versionCode = 1
versionName = "1.0"

Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/theoplayer/android/ui/demo/Streams.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ val streams by lazy {
.timeOffset("start")
.build()
).build()
),
Stream(
title = "DASH-IF Livesim",
source = SourceDescription.Builder(
TypedSource.Builder("https://livesim.dashif.org/livesim/testpic_2s/Manifest.mpd")
.build()
).build()
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ android.nonTransitiveRClass=true
android.nonFinalResIds=true
org.gradle.configuration-cache=true
# The version of the THEOplayer Open Video UI for Android.
version=1.9.2
version=1.9.3
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[versions]
gradle = "8.5.2"
gradle = "8.7.3"
kotlin-gradle-plugin = "1.9.25"
ktx = "1.13.1"
lifecycle-compose = "2.8.5"
activity-compose = "1.9.2"
ktx = "1.15.0"
lifecycle-compose = "2.8.7"
activity-compose = "1.9.3"
appcompat = "1.7.0"
compose-bom = "2024.09.00"
compose-bom = "2024.11.00"
junit4 = "4.13.2"
playServices-castFramework = "21.5.0"
ui-test-junit4 = "1.7.0" # ...not in BOM for some reason?
ui-test-junit4 = "1.7.5" # ...not in BOM for some reason?
androidx-junit = "1.2.1"
androidx-espresso = "3.6.1"
androidx-mediarouter = "1.7.0"
dokka = "1.9.20"
theoplayer = "8.2.0"
theoplayer = "8.6.2"

[libraries]
androidx-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "ktx" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Nov 20 16:01:06 CET 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {

android {
namespace = "com.theoplayer.android.ui"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 21
Expand Down
18 changes: 9 additions & 9 deletions ui/src/main/java/com/theoplayer/android/ui/SeekBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fun SeekBar(
colors: SliderColors = SliderDefaults.colors()
) {
val player = Player.current
val currentTime = player?.currentTime?.toFloat() ?: 0.0f
val currentTime = player?.currentTime ?: 0.0
val seekable = player?.seekable ?: TimeRanges.empty()
val duration = player?.duration ?: Double.NaN
val playingAd = player?.playingAd ?: false
Expand All @@ -56,11 +56,9 @@ fun SeekBar(
val casting = player?.castState == PlayerCastState.CONNECTED
val enabled = (seekable.isNotEmpty() && !playingAd) || casting

val valueRange = remember(seekable, duration) {
seekable.bounds?.let { bounds ->
bounds.start.toFloat()..bounds.endInclusive.toFloat()
} ?: run {
0f..(if (duration.isFinite()) duration.toFloat().coerceAtLeast(0f) else 0f)
val seekableRange = remember(seekable, duration) {
seekable.bounds ?: run {
0.0..(if (duration.isFinite()) duration.coerceAtLeast(0.0) else 0.0)
}
}
var seekTime by remember { mutableStateOf<Float?>(null) }
Expand All @@ -71,8 +69,10 @@ fun SeekBar(
Slider(
modifier = modifier.systemGestureExclusion(),
colors = colors,
value = seekTime ?: currentTime,
valueRange = valueRange,
// Seekable start can be very large (e.g. a Unix timestamp), which can lead to precision loss
// when converted to a float. Instead, make the slider always start at zero.
value = seekTime ?: (currentTime - seekableRange.start).toFloat(),
valueRange = 0f..(seekableRange.endInclusive - seekableRange.start).toFloat(),
enabled = enabled,
interactionSource = interactionSource,
thumb = {
Expand Down Expand Up @@ -101,7 +101,7 @@ fun SeekBar(
wasPlayingBeforeSeek = true
it.pause()
}
it.currentTime = time.toDouble()
it.currentTime = seekableRange.start + time.toDouble()
}
},
onValueChangeFinished = {
Expand Down

0 comments on commit 139702c

Please sign in to comment.