Orhan Uckulac
12/05/2023, 1:04 AMval scalingEffect = ScaleAndRotateTransformation.Builder()
.setRotationDegrees(50f)
.build()
val testEffects = Effects(listOf(), listOf(scalingEffect))
val exoPlayer = remember(context) {
ExoPlayer.Builder(context).build().also { exoPlayer->
exoPlayer.setMediaItem(editedMediaItem.mediaItem)
exoPlayer.setVideoEffects(testEffects.videoEffects)
exoPlayer.playWhenReady = true
exoPlayer.addListener(object : Player.Listener {
@Deprecated("Deprecated in Java")
override fun onPlayerStateChanged(playWhenReady: Boolean, playbackState: Int) {
Log.d("MyTag", "Player state: $playbackState, Play when ready: $playWhenReady")
}
})
exoPlayer.prepare()
}
}
but when I play this video and preview it using PlayerView, I am getting black screen.
Without adding the effect, video works. But this simple effect for testing is not working properly.
exoPlayer.setVideoEffects(effects.videoEffects)
this line is the problem maker. The video is playing in the background, but UI is completely black.
Any ideas?Zach Klippenstein (he/him) [MOD]
12/05/2023, 1:11 AMremember
, but I’m not sure how that would cause this issue. The analogous code works in views?Orhan Uckulac
12/05/2023, 1:37 AMremember
but still I am getting a black screen while video is playing in the background. When I comment out exoPlayer.setVideoEffects, video is opening just fine.
I am doing something wrong on creating effects but for now, not sure what.