-
Notifications
You must be signed in to change notification settings - Fork 6k
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
When I use exo play video,then switch video,sometimes,screen turn black #3535
Comments
HI @hysbtr , |
Hello, we've found the same crash in our logs.
At the moment we are not able to replicate the failure ourselves, but it happens regularly to our users on many different devices. Android 6 and 7 only. |
|
Sorry for the delay, I was onto something else. In our app, we have a single SurfaceView instance for whole activity life. We create and keep We have wrapped surface into custom layout as seen below (pls ignore unnecessary layout nesting) class PlayerSurfaceView : FrameLayout {
constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
private val contentFrame: AspectRatioFrameLayout
private val surfaceView: SurfaceView
private val subscriptions = CompositeSubscription()
init {
descendantFocusability = ViewGroup.FOCUS_AFTER_DESCENDANTS
keepScreenOn = true
contentFrame = AspectRatioFrameLayout(context)
contentFrame.layoutParams = FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
).apply {
gravity = Gravity.CENTER
}
contentFrame.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT
surfaceView = SurfaceView(context)
surfaceView.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
contentFrame.addView(surfaceView)
addView(contentFrame)
}
var player: Player? = null
set(value) {
if (field === value) return
field?.clearVideoSurfaceView(surfaceView)
field = value
subscriptions.clear()
value?.let {
it.onVideoSizeChange.subscribe {
contentFrame.setAspectRatio(
if (it.height == 0) 1f
else it.width * it.pixelWidthHeightRatio / it.height
)
}.addTo(subscriptions)
it.setVideoSurfaceView(surfaceView)
}
}
} I'm still not able to pinpoint an origin of this issue. It happens in HLS AES encrypted live stream. It looks like to me that it happens at MediaCodec.cpp#1047 because |
I met the same issue. Is there any solution? |
Tested on v2.6.1. Issue reproduced. Workaround? |
Hi guys. |
Hey guys,
|
I get this error on Android when switching videos after transferring the ExoPlayer from one parent view to another. Worryingly this breaks all instances of Exoplayer in my app and makes them display black screen, even though they are complete discreet instances with no connecting logic..
|
Hey guys, same issue here, device - HUAWEI Mate 20 Pro
|
Hello, @ojw28 Can you please look into this issue? |
Got the error just minimizing an app while playing a 1080p video, isn't reproduced for the 720p videos. Version: 2.9.0
|
Closing because no full bug reports have been provided and this issue seems to be used for many similarly looking problems. Please open a new issue including all requested information so that we can take a look. |
this bug happened in some specific device,i develop tv app in china.
Issue description
when I switch video,sometimes,the screen is black,but has voice
Reproduction steps
use exoplayer play a video,then stop video ,release video,new an exoplayer,play next one
Link to test content
any video
Version of ExoPlayer being used
2.6.0
Device(s) and version(s) of Android being used
Xiaomi MiTV3S Android 6.0.1
A full bug report captured from the device
The text was updated successfully, but these errors were encountered: