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 e1ab1f1 commit 7521711
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 18 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-flutter-player.md
pat: "${{ secrets.PAT }}"

50 changes: 32 additions & 18 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-flutter-player?style=social)](https://github.com/apivideo/api.video-flutter-player)
&nbsp; [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video)
Expand All @@ -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)
Expand All @@ -29,22 +30,35 @@ your app.
- [Dependencies](#dependencies)
- [FAQ](#faq)

# Project description
<!--</documentation_excluded>-->
<!--<documentation_only>
---
title: api.video Flutter Player
meta:
description: The official api.video Flutter 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 Flutter 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 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.

```shell
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
Expand All @@ -65,11 +79,11 @@ in `web/index.html` from the root of your project.
</html>
```

# Documentation
## Documentation

## Instantiation
### Instantiation

### 1. The ApiVideoPlayerController
#### 1. The ApiVideoPlayerController

To use a video player, you must instantiate a new controller.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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),
Expand All @@ -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)
Expand Down Expand Up @@ -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.

Expand All @@ -258,7 +272,7 @@ ApiVideoPlayerControllerEventsListener(
controller.removeListener(eventsListener);
```

# Sample application
## Sample application

```dart
import 'package:apivideo_player/apivideo_player.dart';
Expand Down Expand Up @@ -340,7 +354,7 @@ class _MyAppState extends State<MyApp> {
}
```

# Dependencies
## Dependencies

We are using external library

Expand All @@ -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).

0 comments on commit 7521711

Please sign in to comment.