From 1f8a42e9e9ed3ac60d11506520953bd3ce6acf5c Mon Sep 17 00:00:00 2001 From: Olivier Lando Date: Mon, 13 Nov 2023 18:22:40 +0100 Subject: [PATCH] README to documentation synchro --- .github/workflows/create-documentation-pr.yml | 27 +++++++ README.md | 70 +++++++++++-------- 2 files changed, 68 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/create-documentation-pr.yml diff --git a/.github/workflows/create-documentation-pr.yml b/.github/workflows/create-documentation-pr.yml new file mode 100644 index 0000000..9c464cd --- /dev/null +++ b/.github/workflows/create-documentation-pr.yml @@ -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 }}" + \ No newline at end of file diff --git a/README.md b/README.md index 9d2cef7..52a4734 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + [![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video)   [![badge](https://img.shields.io/github/stars/apivideo/api.video-android-player?style=social)](https://github.com/apivideo/api.video-android-player)   [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video) @@ -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 + + +## 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`: @@ -53,28 +68,25 @@ 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 +see [how to upload a video](https://docs.api.video/vod/upload-a-video-regular-upload). 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](https://dashboard.api.video/login) or create 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`. @@ -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,..., @@ -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: @@ -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: @@ -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) @@ -214,12 +226,12 @@ 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 @@ -227,7 +239,7 @@ We are using external library |--------------------------------------------------|---------------------------------------------------------| | [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).