Skip to content

TextureView based VideoView implementation for Android.

License

Notifications You must be signed in to change notification settings

warnyul/fast-video-view

Repository files navigation

fast-video-view

develop: Build Status master: Build Status

Overview

This implementation can only be used in a hardware accelerated window. When rendered in software, FastVideoView will display nothing.

Unlike basic VideoView on Android, does not create a separate window, but behaves as a regular view. This key difference allows a FastViewView to be moved, transformed, animated, etc. For instance, you can make a FastVideoView semi-translucent by calling videoView.setAlpha(0.5). FastVideoView has featuring all of the TextureView.

Using a FastVideoView is simple: all you need is get its basic VideoView on Android. The following examples demonstrate how to use a VideoView:

<com.warnyul.android.widget.FastVideoView
        android:id="@+id/video"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:alpha="0.5"
        android:rotation="45"/>

Java code:

public class MainActivity extends Activity {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        FastVideoView videoView = (FastVideoView)findViewById(R.id.video);
        videoView.setMediaController(new MediaController(this));
        videoView.setVideoPath("http://yourwebsite.com/customvideo.3gp");
        videoView.setAlpha(0.5f);       // Set transparency.
        videoView.setRotation(45.0f);   // Set rotation.
        videoView.start();
    }
}

Download

Download the latest JAR or grab via Maven:

<dependency>
    <groupId>com.warnyul.android.fast-video-view</groupId>
    <artifactId>fast-video-view</artifactId>
    <version>1.0.2</version>
</dependency>

or Gradle:

compile 'com.warnyul.android.fast-video-view:fast-video-view:1.0.2'

Snapshots of the development version are available in Sonatype's snapshots repository.

Retrofit requires at minimum Java 6 or Android 4.0.

Licence

Copyright © 2014 Balázs Varga

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