Skip to content

Commit 97871d6

Browse files
committed
README to documentation sync
1 parent f46ad6f commit 97871d6

File tree

2 files changed

+120
-49
lines changed

2 files changed

+120
-49
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/vod
25+
destination-filename: apivideo-typescript-uploader.md
26+
pat: "${{ secrets.PAT }}"
27+

README.md

Lines changed: 93 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
<!--<documentation_excluded>-->
2+
<!--<documentation_excluded>-->
3+
<!--<documentation_excluded>-->
4+
<!--<documentation_excluded>-->
15
[![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-player-sdk?style=social)](https://github.com/apivideo/api.video-player-sdk) &nbsp; [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video)
26
![](https://github.com/apivideo/.github/blob/main/assets/apivideo_banner.png)
37
<h1 align="center">api.video player SDK</h1>
48

59
[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.
610

711

8-
# Table of contents
12+
##### Table of contents
913

1014
- [Table of contents](#table-of-contents)
1115
- [Project description](#project-description)
@@ -59,16 +63,56 @@
5963

6064

6165

62-
# Project description
66+
<!--</documentation_excluded>-->
67+
<!--<documentation_only>
68+
---
69+
title: api.video Player SDK
70+
meta:
71+
description: The official api.video Player SDK 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.
72+
---
73+
74+
#### api.video Player SDK
75+
</documentation_only>-->
76+
###<!--</documentation_excluded>-->
77+
<!--<documentation_only>
78+
---
79+
title: api.video Player SDK
80+
meta:
81+
description: The official api.video Player SDK 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.
82+
---
83+
84+
### api.video Player SDK
85+
</documentation_only>-->
86+
##<!--</documentation_excluded>-->
87+
<!--<documentation_only>
88+
---
89+
title: api.video Player SDK
90+
meta:
91+
description: The official api.video Player SDK 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.
92+
---
93+
94+
## api.video Player SDK
95+
</documentation_only>-->
96+
#<!--</documentation_excluded>-->
97+
<!--<documentation_only>
98+
---
99+
title: api.video Player SDK
100+
meta:
101+
description: The official api.video Player SDK 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.
102+
---
103+
104+
# api.video Player SDK
105+
</documentation_only>-->
106+
## Project description
63107

64108
SDK to control and interact with the api.video HTML5 Player
65109

66110

67-
# Getting started
111+
##### Getting started
68112

69-
## Installation
113+
###### Installation
70114

71-
### Method #1: requirejs
115+
####### Method #1: requirejs
72116

73117
If you use requirejs you can add the SDK as a dependency to your project with
74118

@@ -87,7 +131,7 @@ var sdk = new PlayerSdk("#target", {
87131
});
88132
```
89133

90-
### Method #2: typescript
134+
####### Method #2: typescript
91135

92136
If you use Typescript you can add the SDK as a dependency to your project with
93137

@@ -107,7 +151,7 @@ const sdk = new PlayerSdk("#target", {
107151
```
108152

109153

110-
### Method #2: simple include in a javascript project
154+
####### Method #2: simple include in a javascript project
111155

112156
Include the SDK in your HTML file like so:
113157

@@ -128,9 +172,9 @@ Then, once the `window.onload` event has been triggered, create your player usin
128172
</script>
129173
```
130174

131-
# Documentation
175+
##### Documentation
132176

133-
## Instanciation
177+
###### Instanciation
134178

135179
The PlayerSdk constructor takes 2 parameters:
136180
- `targetSelector: string | Element` a CSS selector targeting the DOM element in which you want to create the player (eg. "#target"), or the DOM element itself
@@ -159,16 +203,16 @@ The PlayerSdk constructor takes 2 parameters:
159203

160204
The sdk instance can be used to control the video playback, and to listen to player events.
161205

162-
### Ads
206+
####### Ads
163207
Ads can be displayed in the player. To do so, you need to pass the `ads` option to the sdk constructor. In the `ads` object, pass the `adTagUrl` property with the url of the ad tag. The ad tag must be a VAST 2.0 or 3.0 url. For more information about VAST, check the [IAB documentation](https://www.iab.com/guidelines/vast/).
164208

165209
Note: ads are displayed using the [Google IMA SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/quickstart).
166210

167-
## Methods
211+
###### Methods
168212

169213
The sdk instance has the following methods:
170214

171-
#### `loadConfig(options: SdkOptions)`
215+
######## `loadConfig(options: SdkOptions)`
172216
> Load a new video in the same instance of the player. Available options are the same as the ones passed to the SDK constructor (see available).
173217
>
174218
> Example:
@@ -179,15 +223,15 @@ The sdk instance has the following methods:
179223
> hideControls: true,
180224
> });
181225
> ```
182-
#### `play()`
226+
######## `play()`
183227
> Start playing the video.
184-
#### `pause()`
228+
######## `pause()`
185229
> Pause the video playback.
186-
#### `mute()`
230+
######## `mute()`
187231
> Mute the video.
188-
#### `unmute()`
232+
######## `unmute()`
189233
> Unmute the video.
190-
#### `hideControls(controls?: ControlName[])`
234+
######## `hideControls(controls?: ControlName[])`
191235
> Hide the player controls.
192236
>
193237
> `controls` parameter type definition:
@@ -214,7 +258,7 @@ The sdk instance has the following methods:
214258
> player.hideControls(["download", "subtitles"]); // ... except "download" and "subtitles"
215259
> ```
216260
>
217-
#### `showControls(controls?: ControlName[])`
261+
######## `showControls(controls?: ControlName[])`
218262
> Show the player controls.
219263
>
220264
> `controls` parameter type definition:
@@ -241,59 +285,59 @@ The sdk instance has the following methods:
241285
> player.showControls(["progressBar"]); // ... and the progress bar
242286
> ```
243287
>
244-
#### `setChromeless(chromeless: boolean)`
288+
######## `setChromeless(chromeless: boolean)`
245289
> Define if the player should be in chromeless mode (all controls hidden).
246-
#### `hideSubtitles()`
290+
######## `hideSubtitles()`
247291
> Hide the player subtitles.
248-
#### `showSubtitles()`
292+
######## `showSubtitles()`
249293
> Show the player subtitles.
250-
#### `hideTitles()`
294+
######## `hideTitles()`
251295
> Hide the video title at the top of the video.
252-
#### `showTitles()`
296+
######## `showTitles()`
253297
> Show the video title at the top of the video.
254-
#### `setLoop(loop: boolean)`
298+
######## `setLoop(loop: boolean)`
255299
> Define if the video should be played in loop.
256-
#### `setAutoplay(autoplay: boolean)`
300+
######## `setAutoplay(autoplay: boolean)`
257301
> Define if the video should start playing as soon as it is loaded
258-
#### `seek(time: number)`
302+
######## `seek(time: number)`
259303
> Add/substract the given number of seconds to/from the playback time.
260-
#### `setPlaybackRate(rate: number)`
304+
######## `setPlaybackRate(rate: number)`
261305
> Set the current playback rate.
262306
>Example:
263307
>```javascript
264308
> player.setPlaybackRate(2); // Play at 2x rate
265309
>```
266-
#### `setCurrentTime(time: number)`
310+
######## `setCurrentTime(time: number)`
267311
> Set the current playback time (seconds).
268312
>
269313
>Example:
270314
>```javascript
271315
> player.setCurrentTime(24); // Go the 24th second
272316
>```
273-
#### `setVolume(volume: number)`
317+
######## `setVolume(volume: number)`
274318
> Change the audio volume to the given value. From 0 to 1 (0 = muted, 1 = 100%).
275319
>
276320
> Example:
277321
> ```javascript
278322
> player.setVolume(0.75); // Set the volume to 75%
279323
> ```
280-
#### `setVideoStyleObjectFit(value: "contain" | "cover" | "fill" | "none" | "scale-down")`
324+
######## `setVideoStyleObjectFit(value: "contain" | "cover" | "fill" | "none" | "scale-down")`
281325
> Change the [object-fit](https://developer.mozilla.org/fr/docs/Web/CSS/object-fit) CSS value of the video tag.
282326
283327
> Example:
284328
> ```javascript
285329
> player.setVideoStyleObjectFit("cover"); // Set the object-fit to cover
286330
> ```
287331
288-
#### `setVideoStyleTransform(value: string)`
332+
######## `setVideoStyleTransform(value: string)`
289333
> Change the [transform](https://developer.mozilla.org/fr/docs/Web/CSS/transform) CSS value of the video tag.
290334
291335
> Example:
292336
> ```javascript
293337
> player.setVideoStyleTransform("rotateY(180deg)"); // Apply a 180deg rotation around the Y axis (mirroring)
294338
> ```
295339
296-
#### `setTheme(theme: PlayerTheme)`
340+
######## `setTheme(theme: PlayerTheme)`
297341
> Change the appearance of the player.
298342
>
299343
> `theme` parameter type definition:
@@ -321,35 +365,35 @@ The sdk instance has the following methods:
321365
> });
322366
> ```
323367
324-
#### `requestFullscreen()`
368+
######## `requestFullscreen()`
325369
> Request fullscreen mode (this may not work in some cases depending on browser restrictions)
326-
#### `exitFullscreen()`
370+
######## `exitFullscreen()`
327371
> Leave fullscreen mode
328-
#### `requestPictureInPicture()`
372+
######## `requestPictureInPicture()`
329373
> Request picture in picture mode (this may not work in some cases depending on browser restrictions)
330-
#### `exitPictureInPicture()`
374+
######## `exitPictureInPicture()`
331375
> Leave picture in picture mode
332-
#### `getPaused(callback?: (paused: boolean) => void): Promise<boolean>`
376+
######## `getPaused(callback?: (paused: boolean) => void): Promise<boolean>`
333377
> Check weither the video is paused.
334-
#### `getPlaying(callback?: (playing: boolean) => void): Promise<boolean>`
378+
######## `getPlaying(callback?: (playing: boolean) => void): Promise<boolean>`
335379
> Check weither the video is playing.
336-
#### `getMuted(callback?: (muted: boolean) => void): Promise<boolean>`
380+
######## `getMuted(callback?: (muted: boolean) => void): Promise<boolean>`
337381
> Check weither the video is muted.
338-
#### `getDuration(callback?: (duration: number) => void): Promise<number>`
382+
######## `getDuration(callback?: (duration: number) => void): Promise<number>`
339383
> Retrieve the duration of the video.
340-
#### `getCurrentTime(callback?: (currentTime: number) => void): Promise<number>`
384+
######## `getCurrentTime(callback?: (currentTime: number) => void): Promise<number>`
341385
> Retrieve the current playback time of the video.
342-
#### `getVolume(callback?: (volume: number) => void): Promise<number>`
386+
######## `getVolume(callback?: (volume: number) => void): Promise<number>`
343387
> Retrieve the current volume.
344-
#### `getLoop(callback?: (loop: boolean) => void): Promise<boolean>`
388+
######## `getLoop(callback?: (loop: boolean) => void): Promise<boolean>`
345389
> Check whether the video is in loop mode.
346-
#### `getPlaybackRate(callback?: (rate: number) => void): Promise<number>`
390+
######## `getPlaybackRate(callback?: (rate: number) => void): Promise<number>`
347391
> Retrieve the playback rate.
348-
#### `isLiveStream(callback?: (live: boolean) => void): Promise<boolean>`
392+
######## `isLiveStream(callback?: (live: boolean) => void): Promise<boolean>`
349393
> Check whether the video is a live stream.
350-
#### `destroy()`
394+
######## `destroy()`
351395
> Destroy the player instance.
352-
#### `addEventListener(event: string, callback: () => void)`
396+
######## `addEventListener(event: string, callback: () => void)`
353397
> Define a callback function that will be called when the given event is triggered by the player.
354398
>
355399
> Available events are the following:
@@ -389,7 +433,7 @@ The sdk instance has the following methods:
389433
> });
390434
> ```
391435
392-
## Full example
436+
###### Full example
393437
394438
```html
395439
<html>
@@ -434,7 +478,7 @@ The sdk instance has the following methods:
434478
</html>
435479
```
436480
437-
## Control an existing embedded player using the SDK
481+
###### Control an existing embedded player using the SDK
438482

439483
It's also possible to integrate the SDK in a page that already contains an embedded player in order to control it and to listen to its events. Let's consider the following page :
440484

0 commit comments

Comments
 (0)