com.yqritc.scalablevideoview.ScalableType Java Examples

The following examples show how to use com.yqritc.scalablevideoview.ScalableType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HxShortVideoPlayActivity.java    From FamilyChat with Apache License 2.0 5 votes vote down vote up
@Override
protected void onResume()
{
    super.onResume();
    //部分机型在播放视频的时候跳转到其他地方再回来时,视频会被拉伸,所以在onResume里设置一次
    if (mVideoView != null)
        mVideoView.setScalableType(ScalableType.FIT_CENTER);
}
 
Example #2
Source File: SampleAdapter.java    From Android-ScalableVideoView with Apache License 2.0 5 votes vote down vote up
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
    Context context = holder.itemView.getContext();

    ScalableType scalableType = ScalableType.values()[position];
    holder.mTextView.setText(context.getString(R.string.sample_scale_title, position,
            scalableType.toString()));
    holder.setScalableType(scalableType);
}
 
Example #3
Source File: ReactVideoView.java    From react-native-video with MIT License 5 votes vote down vote up
public void setResizeModeModifier(final ScalableType resizeMode) {
    mResizeMode = resizeMode;

    if (mMediaPlayerValid) {
        setScalableType(resizeMode);
        invalidate();
    }
}
 
Example #4
Source File: ReactVideoViewManager.java    From react-native-video with MIT License 5 votes vote down vote up
@Override
@Nullable
public Map getExportedViewConstants() {
    return MapBuilder.of(
            "ScaleNone", Integer.toString(ScalableType.LEFT_TOP.ordinal()),
            "ScaleToFill", Integer.toString(ScalableType.FIT_XY.ordinal()),
            "ScaleAspectFit", Integer.toString(ScalableType.FIT_CENTER.ordinal()),
            "ScaleAspectFill", Integer.toString(ScalableType.CENTER_CROP.ordinal())
    );
}
 
Example #5
Source File: MessageEffects.java    From weMessage with GNU Affero General Public License v3.0 4 votes vote down vote up
static void performFireworks(final AnimationCallbacks animationCallbacks, final Activity context, final Toolbar toolbar, final RelativeLayout animationLayout, final ViewGroup conversationLayout){
    performBaseVideoAnimation(R.raw.fireworks, ScalableType.CENTER_CROP, animationCallbacks, context, toolbar, animationLayout, conversationLayout);
}
 
Example #6
Source File: MessageEffects.java    From weMessage with GNU Affero General Public License v3.0 4 votes vote down vote up
static void performShootingStar(final AnimationCallbacks animationCallbacks, final Activity context, final Toolbar toolbar, final RelativeLayout animationLayout, final ViewGroup conversationLayout){
    performBaseVideoAnimation(R.raw.comet, ScalableType.CENTER_TOP_CROP, animationCallbacks, context, toolbar, animationLayout, conversationLayout);
}
 
Example #7
Source File: MainActivity.java    From Android-ScalableVideoView with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    ScalableType scalableType;
    switch (item.getItemId()) {
        case R.id.scale_none:
            scalableType = ScalableType.NONE;
            break;

        case R.id.scale_fit_xy:
            scalableType = ScalableType.FIT_XY;
            break;
        case R.id.scale_fit_start:
            scalableType = ScalableType.FIT_START;
            break;
        case R.id.scale_fit_center:
            scalableType = ScalableType.FIT_CENTER;
            break;
        case R.id.scale_fit_end:
            scalableType = ScalableType.FIT_END;
            break;

        case R.id.scale_left_top:
            scalableType = ScalableType.LEFT_TOP;
            break;
        case R.id.scale_left_center:
            scalableType = ScalableType.LEFT_CENTER;
            break;
        case R.id.scale_left_bottom:
            scalableType = ScalableType.LEFT_BOTTOM;
            break;
        case R.id.scale_center_top:
            scalableType = ScalableType.CENTER_TOP;
            break;
        case R.id.scale_center:
            scalableType = ScalableType.CENTER;
            break;
        case R.id.scale_center_bottom:
            scalableType = ScalableType.CENTER_BOTTOM;
            break;
        case R.id.scale_right_top:
            scalableType = ScalableType.RIGHT_TOP;
            break;
        case R.id.scale_right_center:
            scalableType = ScalableType.RIGHT_CENTER;
            break;
        case R.id.scale_right_bottom:
            scalableType = ScalableType.RIGHT_BOTTOM;
            break;

        case R.id.scale_left_top_crop:
            scalableType = ScalableType.LEFT_TOP_CROP;
            break;
        case R.id.scale_left_center_crop:
            scalableType = ScalableType.LEFT_CENTER_CROP;
            break;
        case R.id.scale_left_bottom_crop:
            scalableType = ScalableType.LEFT_BOTTOM_CROP;
            break;
        case R.id.scale_center_top_crop:
            scalableType = ScalableType.CENTER_TOP_CROP;
            break;
        case R.id.scale_center_crop:
            scalableType = ScalableType.CENTER_CROP;
            break;
        case R.id.scale_center_bottom_crop:
            scalableType = ScalableType.CENTER_BOTTOM_CROP;
            break;
        case R.id.scale_right_top_crop:
            scalableType = ScalableType.RIGHT_TOP_CROP;
            break;
        case R.id.scale_right_center_crop:
            scalableType = ScalableType.RIGHT_CENTER_CROP;
            break;
        case R.id.scale_right_bottom_crop:
            scalableType = ScalableType.RIGHT_BOTTOM_CROP;
            break;

        case R.id.scale_start_inside:
            scalableType = ScalableType.START_INSIDE;
            break;
        case R.id.scale_center_inside:
            scalableType = ScalableType.CENTER_INSIDE;
            break;
        case R.id.scale_end_inside:
            scalableType = ScalableType.END_INSIDE;
            break;

        default:
            return super.onOptionsItemSelected(item);

    }

    mVideoView.setScalableType(scalableType);
    mVideoView.invalidate();
    return true;
}
 
Example #8
Source File: SampleAdapter.java    From Android-ScalableVideoView with Apache License 2.0 4 votes vote down vote up
@Override
public int getItemCount() {
    return ScalableType.values().length;
}
 
Example #9
Source File: SampleAdapter.java    From Android-ScalableVideoView with Apache License 2.0 4 votes vote down vote up
public void setScalableType(ScalableType type) {
    mScalableType = type;
}
 
Example #10
Source File: ReactVideoViewManager.java    From react-native-video with MIT License 4 votes vote down vote up
@ReactProp(name = PROP_RESIZE_MODE)
public void setResizeMode(final ReactVideoView videoView, final String resizeModeOrdinalString) {
    videoView.setResizeModeModifier(ScalableType.values()[Integer.parseInt(resizeModeOrdinalString)]);
}