You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I'm using SimpleExoPlayer for VOD playback.
When RenderersFactory.createRenderers is used for SimpleExoPlayer.newSimpleInstance(Context context, RendererFactory factory, Trackselector trackselector)
, only the audio is output without the video being displayed.
Use DefaultRenderersFactory(Context context) works normally.
[REQUIRED] Question
To use createMessage for change surface, I need to use A and specify MediaCodecVideoRenderer as a variable. I wonder what the difference is and how to solve it.
Or Is there a way to get MediaCodecVideoRenderer from DefailtRenderersFactory (When using SimpleExoPlayer.setVideoSurface(surface), surface not change immediately.)
I think I currently don't understand the reason why you want to use a custom RenderersFactory. Can you elaborate on what you try to achieve when you are saying: "use createMessage for change surface"?
The code snippet you are providing shows that you are using SimpleExoPlayer:
mPlayer = ExoPlayerFactory.newSimpleInstance
So when it comes to switching surfaces I would recommend to use the API of SimpleExoPlayer which allows you to set the surface:
I think the original poster is trying to find a non-standard way to swap the surface due to:
(When using SimpleExoPlayer.setVideoSurface(surface), surface not change immediately.)
Internally that method is sending a message to swap the surface, just as you're attempting to do with your custom solution. In order words, your custom solution wont be any better, so you may as well stop trying to make that work.
Being able to instantaneously swap the surface isn't possible on some older devices due to underlying platform limitations, as discussed in some depth here. You should find it works much better on most newer devices. There is also finally a comprehensive solution to this problem coming in Android Q.
Currently I'm using SimpleExoPlayer for VOD playback.
When
RenderersFactory.createRenderers
is used forSimpleExoPlayer.newSimpleInstance(Context context, RendererFactory factory, Trackselector trackselector)
, only the audio is output without the video being displayed.
Use
DefaultRenderersFactory(Context context)
works normally.[REQUIRED] Question
To use
createMessage
for change surface, I need to use A and specify MediaCodecVideoRenderer as a variable. I wonder what the difference is and how to solve it.Or Is there a way to get
MediaCodecVideoRenderer
fromDefailtRenderersFactory
(When usingSimpleExoPlayer.setVideoSurface(surface)
, surface not change immediately.)Please check code below
[Only audio is played without video]
[Works both video and audio]
The text was updated successfully, but these errors were encountered: