Skip to content

smnafiz/ExoSimplify

Repository files navigation

ExoSimplify Video & Audio Player for Android

ExoSimplify is a background video & audio player with full-screen and notification support.

Installation

  1. Add it to your root build.gradle (Project) at the end of repositories:
allprojects {
	repositories {
		maven { url 'https://jitpack.io' }
	}
}
  1. Add the dependency in your app build.gradle (Module)
dependencies {
	implementation 'com.github.smnafiz:ExoSimplify:1.1.0'
}

Example

Extends SimplifyVideoActivity and create a new activity.

import com.sminrana.exosimplify.ui.SimplifyVideoActivity;

public class VideoPlayerActivity extends SimplifyVideoActivity {

    @Override
    public void onAppKill() {
        super.onAppKill();
    }
}

Update your AndroidMenifest.xml

<activity
   android:name=".VideoPlayerActivity"
   android:configChanges="orientation|keyboardHidden|screenSize"
   android:excludeFromRecents="true"
   android:launchMode="singleTask"
   android:exported="true"
   android:screenOrientation="fullSensor"
   android:theme="@style/ExoSimplify.Fullscreen">
</activity>

Now call the VideoPlayerActivity

Intent intent = new Intent(getContext(), VideoPlayerActivity.class);
intent.putExtra("title", "Demo Video");

// Enable loop
// intent.putExtra("loop", true);

// Make sure video URL is valid
// this one has no sound
intent.putExtra("url", "https://www.shutterstock.com/shutterstock/videos/1094984573/preview/stock-footage-zombie-hand-rising-up-smartphone-with-green-screen-out-of-grave-holiday-event-halloween-concept.mp4");
startActivity(intent);

You must add an icon (ic_notification_icon.png) for the notification in your app drawable directory.


See more in the demo application (app folder)

Video Player

Audio Player

Contributing

Your contribution is welcome here!

If you find this library useful, share it with friends and star it.

About

A simple implementation of ExoPlayer

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages