TextureViewVideoScaler

Very lightweight helper class to resize the video in texture view to fit center or crop center

Лицензия

Лицензия

Категории

Категории

IDE Инструменты разработки
Группа

Группа

com.akexorcist
Идентификатор

Идентификатор

textureviewvideoscaler
Последняя версия

Последняя версия

0.9.9
Дата

Дата

Тип

Тип

aar
Описание

Описание

TextureViewVideoScaler
Very lightweight helper class to resize the video in texture view to fit center or crop center
Ссылка на сайт

Ссылка на сайт

https://github.com/akexorcist/TextureViewVideoScaler
Система контроля версий

Система контроля версий

https://github.com/akexorcist/TextureViewVideoScaler

Скачать textureviewvideoscaler

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.akexorcist/textureviewvideoscaler/ -->
<dependency>
    <groupId>com.akexorcist</groupId>
    <artifactId>textureviewvideoscaler</artifactId>
    <version>0.9.9</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.akexorcist/textureviewvideoscaler/
implementation 'com.akexorcist:textureviewvideoscaler:0.9.9'
// https://jarcasting.com/artifacts/com.akexorcist/textureviewvideoscaler/
implementation ("com.akexorcist:textureviewvideoscaler:0.9.9")
'com.akexorcist:textureviewvideoscaler:aar:0.9.9'
<dependency org="com.akexorcist" name="textureviewvideoscaler" rev="0.9.9">
  <artifact name="textureviewvideoscaler" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.akexorcist', module='textureviewvideoscaler', version='0.9.9')
)
libraryDependencies += "com.akexorcist" % "textureviewvideoscaler" % "0.9.9"
[com.akexorcist/textureviewvideoscaler "0.9.9"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

TextureViewVideoScaler

Very lightweight helper class to resize the video in texture view to fit center or crop center

Because TextureView doesn't support with video scaling like the ExoPlayer library and many develop still use TextureView to display the video. This library already provided the code for video scaling, so you don't need to write that boilerplate code anymore. Just use this library

Installation

Maven

<dependency>
  <groupId>com.akexorcist</groupId>
  <artifactId>textureviewvideoscaler</artifactId>
  <version>0.9.9</version>
</dependency>

Gradle

compile 'com.akexorcist:textureviewvideoscaler:0.9.9'

Usage

When you want to do the video scaling in your TextureView, just call the getVideoScaleMatrix(...) method

float viewWidth = ...TextureView's width...
float viewHeight = ...TextureView's height...
float videoWidth = ...Video's width...
float videoHeight = ...Video's height...
//int scaleType = VideoScaler.FILL;
//int scaleType = VideoScaler.CROP_CENTER;
int scaleType = VideoScaler.FIT_CENTER;
Matrix matrix = VideoScaler.getVideoScaleMatrix(viewWidth, viewHeight, videoWidth, videoHeight, scaleType);
textureView.setTransform(matrix);

This static method will result the result as Matrix class that you can set directly to TextureView (or customize something in Matrix class before use it)

Licence

Copyright 2017 Akexorcist

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Версии библиотеки

Версия
0.9.9