Skip to content

Commit 40ba57a

Browse files
committed
README to documentation synchro
1 parent e1ab1f1 commit 40ba57a

File tree

2 files changed

+82
-54
lines changed

2 files changed

+82
-54
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Create documentation PR
2+
on:
3+
# Trigger the workflow on pull requests targeting the main branch
4+
pull_request:
5+
types: [assigned, unassigned, opened, reopened, synchronize, edited, labeled, unlabeled, edited, closed]
6+
branches:
7+
- main
8+
9+
jobs:
10+
create_documentation_pr:
11+
if: github.event.action != 'closed'
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out current repository code
17+
uses: actions/checkout@v2
18+
19+
- name: Create the documentation pull request
20+
uses: apivideo/api.video-create-readme-file-pull-request-action@main
21+
with:
22+
source-file-path: "README.md"
23+
destination-repository: apivideo/api.video-api-client-generator
24+
destination-path: templates/documentation/sdks/player
25+
destination-filename: apivideo-flutter-player.md
26+
pat: "${{ secrets.PAT }}"
27+

README.md

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!--<documentation_excluded>-->
12
[![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video)
23
&nbsp; [![badge](https://img.shields.io/github/stars/apivideo/api.video-flutter-player?style=social)](https://github.com/apivideo/api.video-flutter-player)
34
&nbsp; [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video)
@@ -8,73 +9,83 @@
89
video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in
910
your app.
1011

11-
# Table of contents
12+
## Table of contents
1213

1314
- [Table of contents](#table-of-contents)
1415
- [Project description](#project-description)
1516
- [Getting started](#getting-started)
16-
- [Installation](#installation)
17-
- [Web usage](#web-usage)
17+
- [Installation](#installation)
18+
- [Web usage](#web-usage)
1819
- [Documentation](#documentation)
19-
- [Instantiation](#instantiation)
20-
- [1. The ApiVideoPlayerController](#1-the-apivideoplayercontroller)
21-
- [2. The ApiVideoPlayer](#2-the-apivideoplayer)
22-
- [Methods](#methods)
23-
- [Properties](#properties)
24-
- [Events listener](#events-listener)
25-
- [Add a new event listener: Method 1](#add-a-new-event-listener-method-1)
26-
- [Add a new event listener: Method 2](#add-a-new-event-listener-method-2)
27-
- [Remove an event listener](#remove-an-event-listener)
20+
- [Instantiation](#instantiation)
21+
- [1. The ApiVideoPlayerController](#1-the-apivideoplayercontroller)
22+
- [2. The ApiVideoPlayer](#2-the-apivideoplayer)
23+
- [Methods](#methods)
24+
- [Properties](#properties)
25+
- [Events listener](#events-listener)
26+
- [Add a new event listener: Method 1](#add-a-new-event-listener-method-1)
27+
- [Add a new event listener: Method 2](#add-a-new-event-listener-method-2)
28+
- [Remove an event listener](#remove-an-event-listener)
2829
- [Sample application](#sample-application)
2930
- [Dependencies](#dependencies)
3031
- [FAQ](#faq)
3132

32-
# Project description
33+
<!--</documentation_excluded>-->
34+
<!--<documentation_only>
35+
---
36+
title: api.video Flutter Player
37+
meta:
38+
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.
39+
---
40+
41+
# api.video Flutter Player
42+
43+
[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.
44+
45+
</documentation_only>-->
46+
## Project description
3347

3448
Easily integrate a video player for videos from api.video in your Flutter application for iOS,
3549
Android and Web.
3650

37-
# Getting started
51+
## Getting started
3852

39-
## Installation
53+
### Installation
4054

4155
Run the following command at the root of your project.
4256

4357
```shell
4458
flutter pub add apivideo_player
4559
```
4660

47-
### Web usage
61+
#### Web usage
4862

49-
If you want to use your application as a web app, you need to add
50-
the [api.video player SDK](https://github.com/apivideo/api.video-player-sdk) script
51-
in `web/index.html` from the root of your project.
63+
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 in `web/index.html` from the root of your project.
5264

5365
```html
5466
<!DOCTYPE html>
5567
<html>
56-
<head>
68+
<head>
5769
...
5870
<!-- Add the following line inside of the head tag -->
5971
<script src="https://unpkg.com/@api.video/player-sdk" defer></script>
60-
</head>
72+
</head>
6173

62-
<body>
63-
...
64-
</body>
74+
<body>
75+
...
76+
</body>
6577
</html>
6678
```
6779

68-
# Documentation
80+
## Documentation
6981

70-
## Instantiation
82+
### Instantiation
7183

72-
### 1. The ApiVideoPlayerController
84+
#### 1. The ApiVideoPlayerController
7385

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

76-
The [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart)
77-
parameters are:
88+
The [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart) parameters are:
7889

7990
| Parameter | Mandatory | Type | Description |
8091
|--------------|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
@@ -89,7 +100,6 @@ parameters are:
89100
Once instantiated, you need to initialize the controller by calling its `initialize()` method.
90101

91102
```dart
92-
93103
final ApiVideoPlayerController controller = ApiVideoPlayerController(
94104
videoOptions: VideoOptions(videoId: 'VIDEO_ID'),
95105
);
@@ -99,12 +109,11 @@ await controller.initialize();
99109

100110
See the sample application below for more details.
101111

102-
### 2. The ApiVideoPlayer
112+
#### 2. The ApiVideoPlayer
103113

104114
A Widget that displays the video and its controls.
105115

106-
The [ApiVideoPlayer](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/widgets/apivideo_player.dart)
107-
constructor takes 3 parameters:
116+
The [ApiVideoPlayer](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/widgets/apivideo_player.dart) constructor takes 3 parameters:
108117

109118
| Parameter | Mandatory | Type | Description |
110119
|------------|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|
@@ -128,11 +137,9 @@ Widget build(BuildContext context) {
128137
}
129138
```
130139

131-
## Methods
140+
### Methods
132141

133-
Once
134-
the [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart)
135-
has been instantiated, you can control the player it has been assigned to with its methods:
142+
Once the [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart) has been instantiated, you can control the player it has been assigned to with its methods:
136143

137144
| Method | Description |
138145
|--------------------------------------------|-------------------------------------------------------------------------------|
@@ -159,11 +166,9 @@ await controller.initialize();
159166
controller.play(); // Play the video
160167
```
161168

162-
## Properties
169+
### Properties
163170

164-
Once
165-
the [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart)
166-
has been instantiated, you can access the video player's properties:
171+
Once the [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart) has been instantiated, you can access the video player's properties:
167172

168173
| Property | Type | Description |
169174
|--------------|-----------------------|-------------------------------------------------|
@@ -191,13 +196,11 @@ await controller.initialize();
191196
final bool isMuted = await controller.isMuted;
192197
```
193198

194-
## Events listener
199+
### Events listener
195200

196-
### Add a new event listener: Method 1
201+
#### Add a new event listener: Method 1
197202

198-
When you instantiate a
199-
new [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart),
200-
you can bind callbacks to some events:
203+
When you instantiate a new [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart), you can bind callbacks to some events:
201204

202205
```dart
203206
@@ -208,11 +211,9 @@ final ApiVideoPlayerController controller = ApiVideoPlayerController(
208211
);
209212
```
210213

211-
### Add a new event listener: Method 2
214+
#### Add a new event listener: Method 2
212215

213-
Once
214-
the [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart)
215-
has been instantiated, you can bind callbacks to some events:
216+
Once the [ApiVideoPlayerController](https://github.com/apivideo/api.video-flutter-player/blob/main/lib/src/apivideo_player_controller.dart) has been instantiated, you can bind callbacks to some events:
216217

217218
```dart
218219
@@ -238,7 +239,7 @@ controller.addListener(eventsListener);
238239
| onEnd | VoidCallback | A callback called when the video has ended |
239240
| onError | Function(Object) | A callback called when an error occured |
240241

241-
### Remove an event listener
242+
#### Remove an event listener
242243

243244
To remove an event listener, you need to call the controller's `removeListener` method.
244245

@@ -258,7 +259,7 @@ ApiVideoPlayerControllerEventsListener(
258259
controller.removeListener(eventsListener);
259260
```
260261

261-
# Sample application
262+
## Sample application
262263

263264
```dart
264265
import 'package:apivideo_player/apivideo_player.dart';
@@ -340,7 +341,7 @@ class _MyAppState extends State<MyApp> {
340341
}
341342
```
342343

343-
# Dependencies
344+
## Dependencies
344345

345346
We are using external library
346347

@@ -349,7 +350,7 @@ We are using external library
349350
| [Exoplayer](https://github.com/google/ExoPlayer) | [README.md](https://github.com/google/ExoPlayer#readme) |
350351

351352

352-
# FAQ
353+
## FAQ
353354

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

0 commit comments

Comments
 (0)