mr.icetea mr.icetea - 11 months ago 95
Android Question

Exoplayer video does not scale when SurfaceView is scaled

I'm using Exoplayer library to create video player application. I'm trying to make a feature like youtube: drag video player to bottom and i will be scaled to smaller size. To do that, i have used ViewDragHelper. When player is dragging, i scale it size like this:

public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) {
mTop = top;

mDragOffset = (float) top / mDragRange;

mVideoView.setScaleX(1 - mDragOffset / 2);
mVideoView.setScaleY(1 - mDragOffset / 2);

mDescView.setAlpha(1 - mDragOffset);

is a
, and player take
to render it content. The
scale correctly but it's content doesn't.

Question: how can scale SurfaceView and it's content too?

Answer Source

Finally, i have found a solution for my question. I used TextureView instead SurfaceView, now it worked perfect.