Skip to content

Commit

Permalink
README to documentation synchro
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-lando committed Nov 13, 2023
1 parent ab469e8 commit c6d73c9
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 28 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/create-documentation-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Create documentation PR
on:
# Trigger the workflow on pull requests targeting the main branch
pull_request:
types: [assigned, unassigned, opened, reopened, synchronize, edited, labeled, unlabeled, edited, closed]
branches:
- main

jobs:
create_documentation_pr:
if: github.event.action != 'closed'

runs-on: ubuntu-latest

steps:
- name: Check out current repository code
uses: actions/checkout@v2

- name: Create the documentation pull request
uses: apivideo/api.video-create-readme-file-pull-request-action@main
with:
source-file-path: "README.md"
destination-repository: apivideo/api.video-api-client-generator
destination-path: templates/documentation/sdks/player
destination-filename: apivideo-android-player.md
pat: "${{ secrets.PAT }}"

68 changes: 40 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!--<documentation_excluded>-->
[![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video)
&nbsp; [![badge](https://img.shields.io/github/stars/apivideo/api.video-android-player?style=social)](https://github.com/apivideo/api.video-android-player)
&nbsp; [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video)
Expand All @@ -8,34 +9,48 @@
video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in
your app.

# Table of contents
## Table of contents

- [Table of contents](#table-of-contents)
- [Project description](#project-description)
- [Getting started](#getting-started)
- [Installation](#installation)
- [Gradle](#gradle)
- [Retrieve your video Id](#retrieve-your-video-id)
- [View-based usage](#view-based-usage)
- [Supported player views](#supported-player-views)
- [Jetpack Compose usage](#jetpack-compose-usage)
- [Play your api.video video with ExoPlayer, MediaPlayer and VideoView](#play-your-apivideo-video-with-exoplayer-mediaplayer-and-videoview)
- [Installation](#installation)
- [Gradle](#gradle)
- [Retrieve your video Id](#retrieve-your-video-id)
- [View-based usage](#view-based-usage)
- [Supported player views](#supported-player-views)
- [Jetpack compose usage](#jetpack-compose-usage)
- [Play your api.video video with ExoPlayer, MediaPlayer and VideoView](#play-your-apivideo-video-with-exoplayer-mediaplayer-and-videoview)
- [Sample application](#sample-application)
- [Documentation](#documentation)
- [Dependencies](#dependencies)
- [FAQ](#faq)

# Project description
<!--</documentation_excluded>-->
<!--<documentation_only>
---
title: api.video Android Player
meta:
description: The official api.video Android Player component for api.video. [api.video](https://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 Android Player
[api.video](https://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.
</documentation_only>-->
## Project description

Easily integrate a video player for videos from [api.video](https://api.video) in your Android
application.
The api.video Android player will help you to play the HLS video from api.video. It also generates
analytics of [your viewers usage](https://api.video/product/video-analytics/).

# Getting started
## Getting started

## Installation
### Installation

### Gradle
#### Gradle

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

Expand All @@ -53,7 +68,7 @@ dependencies {
}
```

## Retrieve your video Id
### 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](https://docs.api.video/docs/upload-a-video-regular-upload). You'll need
Expand All @@ -63,18 +78,15 @@ a video Id to use this component and play a video from api.video. To get yours,
one [here](https://dashboard.api.video/register).
2. Copy your API key (sandbox or production if you are subscribed to one of
our [plan](https://api.video/pricing)).
3. Go to [the official api.video documentation](https://docs.api.video/docs).
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](https://docs.api.video/reference/list-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.
3. Go to [the official api.video documentation](https://docs.api.video/).
4. Go to API Reference -> Videos -> [List all videos](https://docs.api.video/reference/api/Videos#list-all-video-objects)
5. Create a `get` request to the `/videos` endpoint based on the reference, using a tool like Postman.
6. Copy the "videoId" value of one of elements of the API response.

Alternatively, you can find your video Id in the video details of
your [dashboard](https://dashboard.api.video).

## View-based usage
### View-based usage

The api.video Android player comes with a view `ApiVideoExoPlayerView` to display the video and its
controller `ApiVideoPlayerController`.
Expand Down Expand Up @@ -141,7 +153,7 @@ playerView.fullScreenListener = ApiVideoExoPlayerView(

Check out for the implementation in the [Sample application](#sample-application).

### Supported player views
#### Supported player views

The api.video Android player comes with a specific view `ApiVideoExoPlayerView` to display the video
and its controller. If you require a customization of this view such as changing a button color,...,
Expand All @@ -156,7 +168,7 @@ Otherwise, in the `ApiVideoPlayerController`, you can also use the following vie

The `SurfaceView` and the `Surface` require more work to be used.

## Jetpack compose usage
### Jetpack compose usage

The api.video Android player comes with a composable `ApiVideoPlayer` to display the video from a
compose application. In your application, you can add:
Expand All @@ -167,7 +179,7 @@ ApiVideoPlayer(
)
```

## Play your api.video video with ExoPlayer, MediaPlayer and VideoView
### Play your api.video video with ExoPlayer, MediaPlayer and VideoView

If you want to use the ExoPlayer directly, you can use the api.video Android extensions:

Expand Down Expand Up @@ -203,7 +215,7 @@ val videoView = binding.videoView // You already have that in your code
videoView.setVideo(videoOptions)
```

# Sample application
## Sample application

A demo application demonstrates how to use player.
See [`/examples`](https://github.com/apivideo/api.video-android-player/tree/main/examples)
Expand All @@ -214,20 +226,20 @@ On the first run, you will have to set your video Id:
1. Click on the FloatingActionButton -> Settings
2. Replace the video Id with your own video Id

# Documentation
## Documentation

* [Player documentation](https://apivideo.github.io/api.video-android-player/)
* [api.video documentation](https://docs.api.video)

# Dependencies
## Dependencies

We are using external library

| Plugin | README |
|--------------------------------------------------|---------------------------------------------------------|
| [Exoplayer](https://github.com/google/ExoPlayer) | [README.md](https://github.com/google/ExoPlayer#readme) |

# FAQ
## FAQ

If you have any questions, ask us in the [community](https://community.api.video) or
use [issues](https://github.com/apivideo/api.video-android-player/issues).

0 comments on commit c6d73c9

Please sign in to comment.