Android Video Crop

Overview

🔺 Before using this library, read information below 🔺

This library is not more supported. 
If you want to add new feature or fix a bug, grab source code and do it. If you think your
fix or feature would be useful to other developers, I can add link of your repository to
this README file. Use following e-mail to contact me: [email protected]
Thank you for using my libraries.

Preview

Description

TextureVideoView is custom view based on android TextureView which gives you ability easily play and crop video. It's very similar to ImageView#setScaleType

Crop modes:

  • TOP
  • CENTER_CROP
  • BOTTOM

Usage

Include library module to your project or copy TextureVideoView class to your package.

<com.dd.crop.TextureVideoView
        android:id="@+id/cropTextureView"
        android:layout_width="fill_parent"
        android:layout_height="100dp"/>
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();

How it works?

Read Texture View - Video Cropping Article

API

ver 1.0

/**
 * Play or resume video. Video will be played as soon as view is available and media player is
 * prepared.
 *
 * If video is stopped or ended and play() method was called, video will start over.
 */
TextureVideoView.play()

/**
 * Pause video. If video is already paused, stopped or ended nothing will happen.
 */
TextureVideoView.pause()

/**
 * Stop video (pause and seek to beginning). If video is already stopped or ended nothing will
 * happen.
 */
TextureVideoView.stop()

/**
 * Sets the data source (file-path or http/rtsp URL) to use.
 */
TextureVideoView.setDataSource(String)

/**
 * Sets the data source as a content Uri.
 */
TextureVideoView.setDataSource(Context, Uri)

/**
 * Sets the data source (FileDescriptor) to use.
 */
TextureVideoView.setDataSource(AssetFileDescriptor)

/**
 * Sets the player to be looping or non-looping.
 */
TextureVideoView.setLooping(boolean)

/**
 * Seeks to specified time position. (milliseconds)
 */
TextureVideoView.seekTo(int)

/**
 * Gets the duration of the file.
 */
TextureVideoView.getDuration()

/**
 * Listener trigger `onVideoPrepared` and `onVideoEnd` events
 */
TextureVideoView.setListener(MediaPlayerListener)

License

The MIT License (MIT)

Copyright (c) 2014 Danylyk Dmytro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You might also like...
Google's ML-Kit-Vision demo (android) for pre encoded video.
Google's ML-Kit-Vision demo (android) for pre encoded video.

Google's ML-Kit-Vision demo (android) for pre encoded video. Demos for camera preview and still image are also included. This project is actually extension of Google's own sample.

Library for Instagram Image/Video Downloader for Android

Insta Downloader Simple Instagram Image Video Downloader Library for Android Implementation Step 1. Add the JitPack repository to your build file Add

The official Android client library for api.video
The official Android client library for api.video

api.video Android client api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.

ijkplayer Platform Build Status Android iOS Video player based on ffplay Download Android: Gradle # required allprojects { repositories {

Inno Video Converter For Android

Inno Video Converter Android An simple way to manipulating your video on Android

Video/Audio Downloader for Android, written with Jetpack Compose.
Video/Audio Downloader for Android, written with Jetpack Compose.

Seal Video/Audio Downloader for Android, written with Jetpack Compose.

api.video Android player
api.video Android player

api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

On device extracting images from videos - creating video from images.

AndroidVideoTranscoder Surprisingly fast on device video transcoding. Features extracting images from video either ffmpeg or mediacodec creating video

VideoView that plays video only when :eyes: are open and :boy: is detected with various other features
VideoView that plays video only when :eyes: are open and :boy: is detected with various other features

LookAtMe VideoView that plays video only when 👀 are open and 👦 is detected with various other features GIF AndroidPub (Medium) Post You can read the

Comments
  • add autoplay feature; stop mediaplayer cleanly

    add autoplay feature; stop mediaplayer cleanly

    so you don't a gazillion DequeuBuffer error msgs in your log.

    Autoplay lets you set up the player in OnCreate and it'll start automatically...useful for app welcome pages..

    opened by kenyee 0
  • Record Video only a certain portion of the screen

    Record Video only a certain portion of the screen

    Dear Dmytro Danylyk,

    I'm very sorry to contact you here, because I'm confused about how to send messages to you via github. I think you have the ability and experience in the field of cutting videos based on Android.

    I would like to invite you to contribute to the development of open source projects because I am confused as to who I should ask for help.

    I have an issue regarding cutting videos here, if you are willing to see and try to solve the issue, of course we are very happy and this will have an impact on android developers in Cordova.

    Here I attach the issue link below https://github.com/monkeyDledger/cordova-plugin-screenrecord/issues/4

    and this link source code below https://github.com/monkeyDledger/cordova-plugin-screenrecord/tree/master/src/android

    opened by aahedi 1
  • How to add multiple timelines for multiple videos selected

    How to add multiple timelines for multiple videos selected

    Please help me out in achieving multiple Timelines, where to display the frames of selected videos

    Reference Image image

    Here, in the screenshot have used three Timelines and with a horizontal scroll to view the frames of all three timelines at a time. Plus icon is used to select Video/Image from Phone gallery. Selected media will appear in respective timelines

    opened by mdzafar3194 0
  • Question: How to use same technique for ImageView (for preview before showing video), and allow to view in CardView?

    Question: How to use same technique for ImageView (for preview before showing video), and allow to view in CardView?

    I've looked at your code to solve this :

    https://stackoverflow.com/q/54216273/878126

    Meaning not "top" or "center", but let's say "10% from the top (but centered horizontally) ...

    Thing is, I've noticed that it doesn't work well for ImageView that I've set on top, as a preview before playing the video. I got a Github repo here:

    https://github.com/AndroidDeveloperLB/ExoPlayerScaleCrop/

    opened by AndroidDeveloperLB 0
Owner
Dmytro Danylyk
Hello. I am Android/Kotlin Google Developer Expert. I live in Sydney - a quaint and beautiful city. I am passionate about android and flat design.
Dmytro Danylyk
Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer.

Yet Another Video Player Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer. Who Is YAVP For? First o

null 62 Dec 29, 2022
Compose-video-player - Video player for Android Compose powered by ExoPlayer

Compose Video Player Video player for Android Compose powered by ExoPlayer. Addi

Juan Pablo Herrera 22 Dec 13, 2022
Video Transcoder is an application which uses the open source program FFmpeg to transcode video files from one format to another.

Video Transcoder Do you want to encode videos on your phone into different formats, trim videos, or extract audio? Are you looking for a free solution

Branden Archer 358 Dec 30, 2022
The Madman library (Media Ads Manager) enables you to advertise video contents with video ads.

Madman (Media ads manager) is a high performance alternative to Google's standard IMA android SDK. If you have your own VAST server and want to render video ads and have full control over the UI, then this library is for you.

Flipkart Incubator 65 Nov 10, 2022
mpv-android is a video player for Android based on libmpv.

mpv-android is a video player for Android based on libmpv.

null 1.1k Jan 6, 2023
Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.

ijkplayer Platform Build Status Android iOS Video player based on ffplay Download Android: Gradle # required allprojects { repositories {

bilibili 31k Jan 3, 2023
Custom Android view with video player, loader and placeholder image

VideoPlayerView Custom Android view with video player, loader and placeholder image. To stay up-to-date with news about the library Usage Here is an e

Marcin Moskała 89 Nov 18, 2022
NOVA is an open source video player for Android

NOVA: opeN sOurce Video plAyer Overview NOVA is an open source video player for Android. It consists in a fork of the original Archos Video Player Com

NOVA 876 Jan 2, 2023
Simple and lightweight, yet polished and powerful Android video player based on ExoPlayer

Just (Video) Player Android video player based on ExoPlayer It uses ExoPlayer's extension-ffmpeg with all its audio formats enabled (it can handle eve

Marcel Dopita 677 Dec 28, 2022
An easy to use Instagram Video Downloader library for android apps.

Instagram-Video-Downloader-Library An easy to use library for directly download videos from ig reels, igtv. Implementation Step 1. Add the JitPack rep

Abhay 16 Dec 7, 2022