Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MarcinMoskala/VideoPlayView
Custom Android view with video player, loader and placeholder image
https://github.com/MarcinMoskala/VideoPlayView
Last synced: 3 months ago
JSON representation
Custom Android view with video player, loader and placeholder image
- Host: GitHub
- URL: https://github.com/MarcinMoskala/VideoPlayView
- Owner: MarcinMoskala
- License: apache-2.0
- Created: 2017-10-09T16:34:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-16T09:53:39.000Z (about 7 years ago)
- Last Synced: 2024-04-25T23:34:29.304Z (6 months ago)
- Language: Kotlin
- Size: 106 MB
- Stars: 94
- Watchers: 7
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-android - VideoPlayView - Custom Android view with video player, play/stop, loader and placeholder image. (Libraries / GUI)
- awesome-android - VideoPlayView - Custom Android view with video player, play/stop, loader and placeholder image. (Libraries / GUI)
- awesome-list - MarcinMoskala/VideoPlayView - Custom Android view with video player, loader and placeholder image (Kotlin)
README
# VideoPlayerView
Custom Android view with video player, loader and placeholder image.
[![](https://jitpack.io/v/marcinmoskala/VideoPlayView.svg)](https://jitpack.io/#marcinmoskala/VideoPlayView)
[![Analytics](https://ga-beacon.appspot.com/UA-92159206-4/main-page?pixel)](https://github.com/MarcinMoskala/VideoPlayView)
[![Analytics](https://ga-beacon.appspot.com/UA-92159206-7/main-page?pixel)](https://github.com/MarcinMoskala/VideoPlayView)To stay up-to-date with news about the library [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40marcinmoskala)](https://twitter.com/marcinmoskala?ref_src=twsrc%5Etfw)
## Usage
Here is an example flow:
![Gif example](art/flow.gif)
[Here](https://github.com/MarcinMoskala/VideoPlayView/blob/master/app/src/main/res/layout/activity_sample.xml) you can view all examples visible on gif.
When you use `loop` then video will be looping forever:
![Img1](art/loop.gif)
```xml
```
You can set custom loader for the time when movie is downloaded from URL:
![Img1](art/loading.gif)
```xml
```
Static images can be set in xml, as `loadingButton`, but to display gif we need to use some library, like Glide:
```java
VideoPlayView bigVideoView = findViewById(R.id.bigVideoView);
Glide.with(this)
.load(R.drawable.loader)
.into(bigVideoView.getLoadingView());
```You can also show preview images. What is more, videos can be paused by user and preview image is shown then:
![Img1](art/pause.gif)
```xml
```
Image for loading and for pause can be defined in xml as `image` or it can be set programmatically. Then we can use libraries, like Picasso, to load it:
```java
VideoPlayView videoView = findViewById(R.id.picassoVideoView);
Picasso.with(this).load("http://i.imgur.com/DvpvklR.png").into(videoView.getImageView());
```## Customization
VideoPlayerView properties are:
* `image` - reference to preview image.
* `playButton` - reference to play button image.
* `loadingButton` - reference to loader image.
* `videoUrl` - video url.
* `playButton` - max vale of progress (100 by default).
* `loop` - video will be replayed automatically when it is finished (`false` by default).
* `autoplay` - video will be played automatically when it is loaded (`false` by default).## Installation
Just add in your module `build.gradle` following dependency:
```groovy
dependencies {
compile 'com.github.marcinmoskala:VideoPlayView:0.0.2'
}
```Also add on your module `build.gradle` (unless you already have it):
```groovy
repositories {
maven { url 'https://jitpack.io' }
}
```License
-------Copyright 2017 Marcin Moskała
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://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.