Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
slavipetrov committed Oct 4, 2018
1 parent 6663fc5 commit 7ae087f
Showing 1 changed file with 42 additions and 33 deletions.
75 changes: 42 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
![logo](https://raw.githubusercontent.com/dev-labs-bg/fullscreen-video-view/master/logo.png)
==========
===
[![Download](https://api.bintray.com/packages/slavipetrov/maven/fullscreen-video-view/images/download.svg) ](https://bintray.com/slavipetrov/maven/fullscreen-video-view/_latestVersion)
[![Build Status](https://travis-ci.org/dev-labs-bg/fullscreen-video-view.svg?branch=0.0.9)](https://travis-ci.org/dev-labs-bg/fullscreen-video-view)
[![Build Status](https://travis-ci.org/dev-labs-bg/fullscreen-video-view.svg?branch=1.0.0)](https://travis-ci.org/dev-labs-bg/fullscreen-video-view)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5d2c2572dd7b4a2fb5eeabd6c2e18fbc)](https://www.codacy.com/app/slavipetrov/fullscreen-video-view?utm_source=github.com&utm_medium=referral&utm_content=dev-labs-bg/fullscreen-video-view&utm_campaign=Badge_Grade)

FullscreenVideoView is a custom VideoView Android library which makes loading, setting up and going fullscreen for video views easy.

<img src="https://github.com/dev-labs-bg/fullscreen-video-view/blob/master/preview.gif" width="250" height="445">

Download
==========
===
You can use Gradle:
```gradle
compile 'bg.devlabs.fullscreenvideoview:library:0.0.9'
compile 'bg.devlabs.fullscreenvideoview:library:1.0.0'
```
or Maven:
```maven
<dependency>
<groupId>bg.devlabs.fullscreenvideoview</groupId>
<artifactId>library</artifactId>
<version>0.0.9</version>
<version>1.0.0</version>
<type>pom</type>
</dependency>
```

How to use FullscreenVideoView?
==========
===
Declare the FullscreenVideoView in the XML layout file
```xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
Expand All @@ -50,28 +49,28 @@ The Activity where the FullscreenVideoView is declared should handle configurati
```

Basic video loading (from URL or from a file)
```java
```kotlin
// Loading from URL
@Override public void onCreate(Bundle savedInstanceState) {
override fun onCreate(savedInstanceState: Bundle?) {
...
FullscreenVideoView fullscreenVideoView = findViewById(R.id.fullscreenVideoView);
String videoUrl = "http://clips.vorwaerts-gmbh.de/VfE_html5.mp4";
fullscreenVideoView.videoUrl(videoUrl);
val fullscreenVideoView = findViewById(R.id.fullscreenVideoView)
val videoUrl = "https://clips.vorwaerts-gmbh.de/VfE_html5.mp4"
fullscreenVideoView.videoUrl(videoUrl)
}

// Loading from file
@Override public void onCreate(Bundle savedInstanceState) {
override fun onCreate(savedInstanceState: Bundle?) {
...
FullscreenVideoView fullscreenVideoView = findViewById(R.id.fullscreenVideoView);
File videoFile = new File("file_path");
fullscreenVideoView.videoFile(videoFile);
val fullscreenVideoView = findViewById(R.id.fullscreenVideoView)
val videoFile = new File("file_path")
fullscreenVideoView.videoFile(videoFile)
}
```

Change controls drawable resources
----------
Java
```java
---
Java or Kotlin
```kotlin
fullscreenVideoView.videoUrl(videoUrl)
.playDrawable(R.drawable.ic_play)
.pauseDrawable(R.drawable.ic_pause)
Expand All @@ -96,39 +95,49 @@ XML
```

Enable/disable controls
----------
```java
---
```kotlin
fullscreenVideoView.videoUrl(videoUrl)
.canPause(true)
.canSeekBackward(false)
.canSeekForward(false)
.disablePause()
.addSeekBackwardButton()
.addSeekForwardButton()
```

Enable video auto-start
----------
```java
---
```kotlin
fullscreenVideoView.videoUrl(videoUrl)
.enableAutoStart()
```

Customize fast-forward and/or rewind seconds
----------
```java
---
```kotlin
fullscreenVideoView.videoUrl(videoUrl)
.fastForwardSeconds(5)
.rewindSeconds(5)
```
Change the playback speed (only for API 23 and above)
---
There are 7 playback speed values which are added by default, but they can be changed with custom ones when `playbackSpeedOptions` is used.
```kotlin
val playbackOptions = PlaybackSpeedOptions().addSpeeds(0.25f, 0.5f, 0.75f, 1f)

fullscreenVideoView.videoUrl(videoUrl)
.addPlaybackSpeedButton()
.playbackSpeedOptions(playbackOptions)
```

Compatibility
==========
===
- Minimum Android SDK: API level 19
- Compile Android SDK: API level 27
- Compile Android SDK: API level 28

Known issues
==========
===
There is a memory leak in Android 7 (API levels 24 and 25), which is known and [listed](https://github.com/square/leakcanary/issues/721)
in the LeakCanary repository issues.

License
==========
Apache 2.0. See the [LICENSE](https://github.com/dev-labs-bg/fullscreen-video-view/blob/master/LICENSE.txt) file for details.
===
Apache 2.0. See the [LICENSE](https://github.com/dev-labs-bg/fullscreen-video-view/blob/master/LICENSE.txt) file for details.

0 comments on commit 7ae087f

Please sign in to comment.