From 587718e3503995dd19c1e40cf2c193f7e2cdaefe Mon Sep 17 00:00:00 2001 From: Olivier Lando Date: Mon, 13 Nov 2023 18:33:09 +0100 Subject: [PATCH] README to documentation synchro --- .github/workflows/create-documentation-pr.yml | 27 +++++++++++++ README.md | 38 +++++++++++++------ 2 files changed, 53 insertions(+), 12 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..a9f27cb --- /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-hlsjs-analytics.md + pat: "${{ secrets.PAT }}" + \ No newline at end of file diff --git a/README.md b/README.md index 211ad64..8a06150 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-hlsjs-analytics?style=social)](https://github.com/apivideo/api.video-hlsjs-analytics)   [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video) ![](https://github.com/apivideo/.github/blob/main/assets/apivideo_banner.png) ![npm](https://img.shields.io/npm/v/@api.video/hlsjs-player-analytics) ![ts](https://badgen.net/badge/-/TypeScript/blue?icon=typescript&label) @@ -5,7 +6,7 @@ [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. -# Table of contents +## Table of contents - [Table of contents](#table-of-contents) - [Project description](#project-description) @@ -13,16 +14,29 @@ - [Setup](#setup) - [Code sample](#code-sample) - [Documentation](#documentation) - - [Module instanciation](#module-instanciation) - - [Instanciation example](#instanciation-example) + - [Module instantiation](#module-instantiation) + - [Instantiation example](#instantiation-example) -# Project description + + +## Project description hls.js module to call the api.video analytics collector. -# Getting started +## Getting started -## Setup +### Setup Include `https://unpkg.com/@api.video/hlsjs-player-analytics` in your web page. @@ -30,7 +44,7 @@ Include `https://unpkg.com/@api.video/hlsjs-player-analytics` in your web page. ``` -## Code sample +### Code sample Include the module in your HTML file like so: @@ -59,11 +73,11 @@ Include the module in your HTML file like so: ``` -# Documentation +## Documentation -## Module instanciation +### Module instantiation -Then, before having instanciated `Hls`, instanciate a `HlsJsApiVideoAnalytics` object. +Then, before having instantiated `Hls`, instantiate a `HlsJsApiVideoAnalytics` object. The `HlsJsApiVideoAnalytics` constructor take the following parameters: @@ -77,10 +91,10 @@ Available options (`HlsJsApiVideoAnalyticsOptions`): | Option name | Mandatory | Type | Description | | -----------: | --------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -| userMetadata | no | ```{ [name: string]: string }[]``` | object containing [metadata](https://api.video/blog/tutorials/dynamic-metadata) (see **Full example** below) | +| userMetadata | no | ```{ [name: string]: string }[]``` | object containing [metadata](https://api.video/blog/tutorials/dynamic-metadata/) (see **Full example** below) | | sequence | no | ```{start: number; end?: number;} ``` | if only a sequence of the video is going to be played | -## Instanciation example +### Instantiation example ```javascript var hls = new Hls();