api.video Android player

Overview

badge   badge   badge

api.video Android player

api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

Table of contents

Project description

Easily integrate a video player for videos from api.video in your Android application.

Getting started

Installation

Gradle

In your module build.gradle, add the following code in dependencies:

dependencies {
    implementation 'video.api:android-player:1.0.0'
}

Permissions

In your AndroidManifest.xml, add the following code in :

">
<uses-permission android:name="android.permission.INTERNET" />

Retrieve your video Id

At this point, you must have uploaded a least one video to your account. If you haven't see how to upload a video. You'll need a video Id to use this component and play a video from api.video. To get yours, follow these steps:

  1. Log into your account or create one here.
  2. Copy your API key (sandbox or production if you are subscribed to one of our plan).
  3. Go to the official api.video documentation.
  4. Log into your account in the top right corner. If it's already done, be sure it's the account you want to use.
  5. Go to API Reference -> Videos -> List all videos
  6. On the right, be sure the "Authentication" section contains the API key you want to use.
  7. Generate your upload token by clicking the "Try It!" button in the right section
  8. Copy the "videoId" value of one of elements of the response in the right section.

Alternatively, you can find your video Id in the video details of your dashboard.

Code sample

  1. Add a StyledPlayerView to your Activity/Fragment layout:
">
<com.google.android.exoplayer2.ui.StyledPlayerView
    android:id="@+id/playerView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:show_subtitle_button="true" />

You can customize the StyledPlayerView according to your application design.

  1. Implements the Player.Listener interface:
val playerListener = object : ApiVideoPlayer.Listener {
    override fun onError(error: Exception) {
        Log.e(TAG, "An error happened", error)
    }
    override fun onReady() {
        Log.I(TAG, "Player is ready")
    }
}
  1. Instantiate the ApiVideoPlayer in an your Activity/Fragment:
val playerView = findViewById<StyledPlayerView>(R.id.playerView)

val player = ApiVideoPlayer(
    this,
    "YOUR_VIDEO_ID",
    VideoType.VOD,
    playerListener,
    playerView
)

Sample application

A demo application demonstrates how to use player. See /example folder.

On the first run, you will have to set your video Id:

  1. Click on the FloatingActionButton -> Settings
  2. Replace "YOUR_VIDEO_ID" by your video Id

Documentation

Dependencies

We are using external library

Plugin README
Exoplayer README.md

FAQ

If you have any questions, ask us here: https://community.api.video. Or use [Issues].

You might also like...
Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.

ijkplayer Platform Build Status Android iOS Video player based on ffplay Download Android: Gradle # required allprojects { repositories {

A Custom Video Player with Controls in Kotlin
A Custom Video Player with Controls in Kotlin

UNT-Video-Player A Custom Video Player with Controls in Kotlin Hello folks, Here is the custom video player built in Kotlin; with SeekBar, fast forwar

 AutoPlayer - A player based on ExoPlayer for play video automatically in RecyclerView, when an item is visible.
AutoPlayer - A player based on ExoPlayer for play video automatically in RecyclerView, when an item is visible.

A player based on ExoPlayer for play video automatically in RecyclerView, when an item is visible.

Exo Player Video with jetPack Compose
Exo Player Video with jetPack Compose

Exo Player Video with jetPack Compose

Sample HLS Video player in Kotlin with mvvm

HLSVideoPlayer Sample HLS Video player in Kotlin with mvvm Note: mvvm is partially implemented due to time constraint, so here is a scope for improvem

Odeon Music Player is a lightweight music player for Android.
Odeon Music Player is a lightweight music player for Android.

Odeon 🎵 Odeon Music Player is a lightweight music player for Android. Get it on Google Play. We value your privacy, your battery life and your device

 Music Player - This is a basic music player built with Android Studio and Kotlin
Music Player - This is a basic music player built with Android Studio and Kotlin

Music Player Made by Jenny Cárdenas This is a basic music player built with Android Studio and Kotlin, it shows two views in the UI, the user can play

The official Android client library for api.video
The official Android client library for api.video

api.video Android client api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing

Wynncraft API Wrapper - Simple wrapper to get Wynncraft Stats of a player or a guild and more in Java

WynncraftAPIWrapper Simple wrapper to get Wynncraft Stats of a player or a guild

Releases(v1.1.4)
Owner
api.video
Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.
api.video
Fermata Media Player is a free, open source audio and video player with a simple and intuitive interface.

Fermata Media Player About Fermata Media Player is a free, open source audio and video player with a simple and intuitive interface. It is focused on

Andrey 227 Jan 6, 2023
api.video Android player

api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

api.video 9 Dec 15, 2022
Free p2p cdn android github sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - 🚀 Vadootv 🚀

Android p2p cdn sdk to distribute load and reduce costs(https://peervadoo.com) Vadootv is a p2p sdk integration to reduce your video streaming costs b

Vadootv 40 Oct 5, 2022
Video Transcoder is an application which uses the open source program FFmpeg to transcode video files from one format to another.

Video Transcoder Do you want to encode videos on your phone into different formats, trim videos, or extract audio? Are you looking for a free solution

Branden Archer 358 Dec 30, 2022
The Madman library (Media Ads Manager) enables you to advertise video contents with video ads.

Madman (Media ads manager) is a high performance alternative to Google's standard IMA android SDK. If you have your own VAST server and want to render video ads and have full control over the UI, then this library is for you.

Flipkart Incubator 65 Nov 10, 2022
mpv-android is a video player for Android based on libmpv.

mpv-android is a video player for Android based on libmpv.

null 1.1k Jan 6, 2023
Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.

ijkplayer Platform Build Status Android iOS Video player based on ffplay Download Android: Gradle # required allprojects { repositories {

bilibili 31k Jan 3, 2023
Custom Android view with video player, loader and placeholder image

VideoPlayerView Custom Android view with video player, loader and placeholder image. To stay up-to-date with news about the library Usage Here is an e

Marcin Moskała 89 Nov 18, 2022
NOVA is an open source video player for Android

NOVA: opeN sOurce Video plAyer Overview NOVA is an open source video player for Android. It consists in a fork of the original Archos Video Player Com

NOVA 876 Jan 2, 2023
Simple and lightweight, yet polished and powerful Android video player based on ExoPlayer

Just (Video) Player Android video player based on ExoPlayer It uses ExoPlayer's extension-ffmpeg with all its audio formats enabled (it can handle eve

Marcel Dopita 677 Dec 28, 2022