diff --git a/.github/workflows/create-documentation-pr.yml b/.github/workflows/create-documentation-pr.yml new file mode 100644 index 0000000..9cf44c6 --- /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-flutter-player.md + pat: "${{ secrets.PAT }}" + \ No newline at end of file diff --git a/README.md b/README.md index b1535a5..9d131f4 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-flutter-player?style=social)](https://github.com/apivideo/api.video-flutter-player)   [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video) @@ -8,7 +9,7 @@ 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) @@ -29,14 +30,27 @@ your app. - [Dependencies](#dependencies) - [FAQ](#faq) -# Project description + + +## Project description Easily integrate a video player for videos from api.video in your Flutter application for iOS, Android and Web. -# Getting started +## Getting started -## Installation +### Installation Run the following command at the root of your project. @@ -44,7 +58,7 @@ Run the following command at the root of your project. flutter pub add apivideo_player ``` -### Web usage +#### Web usage If you want to use your application as a web app, you need to add the [api.video player SDK](https://github.com/apivideo/api.video-player-sdk) script @@ -65,11 +79,11 @@ in `web/index.html` from the root of your project. ``` -# Documentation +## Documentation -## Instantiation +### Instantiation -### 1. The ApiVideoPlayerController +#### 1. The ApiVideoPlayerController To use a video player, you must instantiate a new controller. @@ -99,7 +113,7 @@ await controller.initialize(); See the sample application below for more details. -### 2. The ApiVideoPlayer +#### 2. The ApiVideoPlayer A Widget that displays the video and its controls. @@ -128,7 +142,7 @@ Widget build(BuildContext context) { } ``` -## Methods +### Methods Once the [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart) @@ -159,7 +173,7 @@ await controller.initialize(); controller.play(); // Play the video ``` -## Properties +### Properties Once the [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart) @@ -191,9 +205,9 @@ await controller.initialize(); final bool isMuted = await controller.isMuted; ``` -## Events listener +### Events listener -### Add a new event listener: Method 1 +#### Add a new event listener: Method 1 When you instantiate a new [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart), @@ -208,7 +222,7 @@ final ApiVideoPlayerController controller = ApiVideoPlayerController( ); ``` -### Add a new event listener: Method 2 +#### Add a new event listener: Method 2 Once the [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart) @@ -238,7 +252,7 @@ controller.addListener(eventsListener); | onEnd | VoidCallback | A callback called when the video has ended | | onError | Function(Object) | A callback called when an error occured | -### Remove an event listener +#### Remove an event listener To remove an event listener, you need to call the controller's `removeListener` method. @@ -258,7 +272,7 @@ ApiVideoPlayerControllerEventsListener( controller.removeListener(eventsListener); ``` -# Sample application +## Sample application ```dart import 'package:apivideo_player/apivideo_player.dart'; @@ -340,7 +354,7 @@ class _MyAppState extends State { } ``` -# Dependencies +## Dependencies We are using external library @@ -349,7 +363,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-flutter-player/issues).