mirror of
https://github.com/androidx/media.git
synced 2025-04-29 22:36:54 +08:00
Fix a crash in effect demo when parsing floats
Change a broken link to a remote video PiperOrigin-RevId: 747925636
This commit is contained in:
parent
1ea69ca7be
commit
4e8de288a5
@ -1,9 +1,9 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "Cats -> Dogs",
|
"name": "Dogs Short -> Dogs",
|
||||||
"playlist": [
|
"playlist": [
|
||||||
{
|
{
|
||||||
"uri": "https://html5demos.com/assets/dizzy.mp4"
|
"uri": "https://storage.googleapis.com/exoplayer-test-media-1/mp4/android-screens-10s.mp4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"uri": "https://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv"
|
"uri": "https://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv"
|
||||||
|
@ -90,6 +90,7 @@ import androidx.media3.effect.TextureOverlay
|
|||||||
import androidx.media3.exoplayer.ExoPlayer
|
import androidx.media3.exoplayer.ExoPlayer
|
||||||
import androidx.media3.ui.PlayerView
|
import androidx.media3.ui.PlayerView
|
||||||
import com.google.common.collect.ImmutableList
|
import com.google.common.collect.ImmutableList
|
||||||
|
import java.util.Locale
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
class EffectActivity : ComponentActivity() {
|
class EffectActivity : ComponentActivity() {
|
||||||
@ -364,7 +365,7 @@ class EffectActivity : ComponentActivity() {
|
|||||||
Slider(
|
Slider(
|
||||||
value = effectControlsState.contrastValue,
|
value = effectControlsState.contrastValue,
|
||||||
onValueChange = { newContrastValue ->
|
onValueChange = { newContrastValue ->
|
||||||
val newRoundedContrastValue = "%.2f".format(newContrastValue).toFloat()
|
val newRoundedContrastValue = "%.2f".format(Locale.ROOT, newContrastValue).toFloat()
|
||||||
onEffectControlsStateChange(
|
onEffectControlsStateChange(
|
||||||
effectControlsState.copy(
|
effectControlsState.copy(
|
||||||
effectsChanged = true,
|
effectsChanged = true,
|
||||||
@ -437,7 +438,7 @@ class EffectActivity : ComponentActivity() {
|
|||||||
Slider(
|
Slider(
|
||||||
value = effectControlsState.textOverlayAlpha,
|
value = effectControlsState.textOverlayAlpha,
|
||||||
onValueChange = { newAlphaValue ->
|
onValueChange = { newAlphaValue ->
|
||||||
val newRoundedAlphaValue = "%.2f".format(newAlphaValue).toFloat()
|
val newRoundedAlphaValue = "%.2f".format(Locale.ROOT, newAlphaValue).toFloat()
|
||||||
onEffectControlsStateChange(
|
onEffectControlsStateChange(
|
||||||
effectControlsState.copy(
|
effectControlsState.copy(
|
||||||
effectsChanged = effectControlsState.textOverlayText != null,
|
effectsChanged = effectControlsState.textOverlayText != null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user