video-crop


Source link: https://github.com/dmytrodanylyk/video-crop

🔺 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. 

Resources

BugShaker allows your QA team and/or end users to easily submit bug reports by shaking their device. When a shake is detected, the current screen state is captured and the user is prompted to submit a bug report via email with this screenshot attached.

This library provides an Imageview which can paint a layer on top of the image. This feature could be used for text protection or to apply a tint to an image.

A lightweight library aiming to speed up Android app development by leveraging the new Android Data Binding and taking the best from the Model-View-ViewModel design pattern.

A way to achieve Yingke room design concept.

BadgedView allows you show a badge into any View.

PianoView provides a ViewPager Indicator looks like piano's keyboard

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes