Skip to content

Commit

Permalink
Merge pull request #5 from apivideo/documentation-hlsjs-analytics
Browse files Browse the repository at this point in the history
README to documentation synchro
  • Loading branch information
olivierapivideo authored Nov 13, 2023
2 parents 0562f38 + 587718e commit 2bb422f
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 12 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-hlsjs-analytics.md
pat: "${{ secrets.PAT }}"

38 changes: 26 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,50 @@
<!--<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-hlsjs-analytics?style=social)](https://github.com/apivideo/api.video-hlsjs-analytics) &nbsp; [![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)
<h1 align="center">api.video hls.js analytics module</h1>

[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)
- [Getting started](#getting-started)
- [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
<!--</documentation_excluded>-->
<!--<documentation_only>
---
title: api.video hls.js analytics plugin
meta:
description: The official api.video hls.js analytics plugin 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 hls.js analytics plugin
[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

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.

```html
<script src="https://unpkg.com/@api.video/hlsjs-player-analytics"></script>
```

## Code sample
### Code sample


Include the module in your HTML file like so:
Expand Down Expand Up @@ -59,11 +73,11 @@ Include the module in your HTML file like so:
</html>
```

# 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:

Expand All @@ -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();
Expand Down

0 comments on commit 2bb422f

Please sign in to comment.