【开源】TextureVideoView

TextureVideoView

  •  https://github.com/dmytrodanylyk/video-crop

    介绍:

    TextureVideoView是一个基于TextureView的自定义view,让你轻松实现视频的播放与剪辑。

    运行效果:

    使用说明:

    xml

    <com.dd.crop.TextureVideoView
            android:id="@+id/cropTextureView"
            android:layout_width="fill_parent"
            android:layout_height="100dp"/>

     

    java

    TextureVideoView cropTextureView = (TextureVideoView) findViewById(R.id.cropTextureView);
    // Use `setScaleType` method to crop video
    cropTextureView.setScaleType(TextureVideoView.ScaleType.TOP);
    // Use `setDataSource` method to set data source, this could be url, assets folder or path
    cropTextureView.setDataSource("http://www.w3schools.com/html/mov_bbb.mp4");
    cropTextureView.play();

     

    阅读 Texture View - Video Cropping

posted on 2015-04-03 10:24  wasdchenhao  阅读(543)  评论(0)    收藏  举报

导航