ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

[Question] Exoplayer allows devices to play ABR variants above screen resolution

Open mlondon1 opened this issue 10 years ago • 3 comments

Why does Exoplayer allow devices to jump up to an ABR variant that has video dimensions above the device's screen resolution?

For example, when using Exoplayer 2.0.3 with Dash-Widevine VOD content, the Samsung Tab SM-T330NU that we were testing has a screen resolution of 1280x800, yet the player allowed it to go up to 1920x1080 variants that resulted in dropped frames and poor video playback.

We limited this in the code, but why would this not be the default?

mlondon1 avatar Nov 29 '16 15:11 mlondon1

It's quite complicated in practice because there are quite a lot of cases where you would want to exceed the display resolution. For example if two resolutions are available, one of which is far less than the display resolution and the other of which is a little bit larger. As another example, all use cases involving UIs that don't fit the video (e.g. UIs that clip instead, 360 video, VR). Conversely, in many other situations you probably want to constrain to something below the resolution of the display. For example any UI where the video is windowed, when streaming over a metered mobile network and so on. Whether the orientation of the application may change is also relevant.

Given these complexities, we leave it to the application to decide what the right thing to do is. You can pretty trivially constrain to the display viewport using DefaultTrackSelector.

ojw28 avatar Nov 29 '16 15:11 ojw28

Specifically, use DefaultTrackSelector.getParameters to get the current parameters. Then call methods like Parameters.withViewportSizeFromContext, Parameters.withMaxVideoSize, Paramaters.withExceedVideoConstraintsIfNecessary to configure the behavior to be to your liking. Then pass the resulting parameters back to the selector via DefaultTrackSelector.setParameters.

ojw28 avatar Nov 29 '16 15:11 ojw28

Thanks for the answer

mlondon1 avatar Nov 29 '16 15:11 mlondon1