public void setMedia(BaseMedia media) {
        if (media instanceof ImageMedia) {
            mVideoLayout.setVisibility(GONE);
            setCover(((ImageMedia) media).getThumbnailPath());
        } else if (media instanceof VideoMedia) {
            mVideoLayout.setVisibility(VISIBLE);
            VideoMedia videoMedia = (VideoMedia) media;
            TextView durationTxt = ((TextView) mVideoLayout.findViewById(R.id.video_duration_txt));
            durationTxt.setText(videoMedia.getDuration());
            durationTxt.setCompoundDrawablesWithIntrinsicBounds(BoxingManager.getInstance().getBoxingConfig().getVideoDurationRes(), 0, 0, 0);
            ((TextView) mVideoLayout.findViewById(R.id.video_size_txt)).setText(videoMedia.getSizeByUnit());
            setCover(videoMedia.getPath());
        }
    }
A media layout for {@link android.support.v7.widget.RecyclerView} item, including image and video <br/>

@author ChenSL
boxing-impl/src/main/java/com/bilibili/boxing_impl/view/MediaItemLayout.java