ReSize Mood add into Exoplayer
pavelsust opened this issue · 6 comments
Sometime we need some extra feature like ReSize mood exoplayer. Example
app:resize_mode="fixed_width"
app:resize_mode="fixed_height"
app:resize_mode="fill"
app:resize_mode="fit"
app:resize_mode="zoom"
Can you please help us to implement this features.
You should be able to use the videoScale
attribute (or the setScaleType()
function) on the VideoView
to support those needs.
You will likely be interested in
CENTER_CROP
: Uniformly scales the video so that both the width and height of the view is filledCENTER_INSIDE
: Uniformly scales the video down so that the entire video fits in the view; if the source video is larger than the view then only one of the width or height will be smaller than the view, otherwise it's possible both the width and height are smaller than the viewFIT_CENTER
: Uniformly scales the video up or down so that the entire video fits in the view; this means only one of the width or height will be smaller than the view
The fixed_height
and fixed_width
use cases above will depend on how the VideoView is defined in XML. It is also possible you may need to specify the measureBasedOnAspectRatio
attribute (or through the setMeasureBasedOnAspectRatioEnabled
function) as well
Thanks it's working fine.. Do you have any plan to include FIT feature here?
Actually I was looking for FIT. If I use center-crop sometimes it remove some video height. So I was thinking if we can use FIT. It will be better for us.
The videoScale
attribute and setScaleType
function have all of the available scale types documented. It sounds like you are looking for FIT_XY
or FIT_CENTER
as described above; just note that FIT_XY
will scale independent of the video's aspect ratio so will result it skewed content so FIT_CENTER
is likely what you are looking for.
Hello,
Do you have app:resize_mode="zoom" feature in your library. I don't find it.
I don't know what "zoom" represents; what are you expecting this to do and I should be able to answer based on that?