Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
georgechoustoulakis committed Jul 19, 2024
1 parent e1903e3 commit 5b61f22
Showing 1 changed file with 83 additions and 8 deletions.
91 changes: 83 additions & 8 deletions adscript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,103 @@ The AdScript connector provides a AdScript integration for THEOplayer.

## Installation

```sh
Install using your favorite package manager for Node (such as `npm` or `yarn`):

### npm

```bash
npm install @theoplayer/adscript-connector-web
```

### yarn

```bash
yarn add @theoplayer/adscript-connector-web
```

## Prerequisites

First you need to initialize the AdScript Measurement by including the script in your app's html.

```html

<script>
// Insert the script from the official AdScript documentation here:
// The script is available on the official AdScript documentation:
// https://adscript.admosphere.cz/en_adScript_browser.html
</script>
```

## Usage

### Configuring the connector
First you need to add the Yospace connector to your app :

* Add as a regular script

```html

<script type="text/javascript" src="path/to/adscript-connector.umd.js"></script>
<script type="text/javascript">
const player = new THEOplayer.Player(element, configuration);
// Define your configuration for the connector:
const adScriptConfig = {
// TODO
}
// Define the metadata for reporting:
const videoMetadata = {
"assetid": "v0000001",
"type": "content",
"program": "Big Buck Bunny",
"title": "Sample Video - Extended",
"length": "635",
"crossId": "000 111 22222",
"livestream": "0",
"channelId": "",
"attribute": "1"
}
```js
import { AdScriptConnector } from '../../dist/adscript-connector.esm.js';
// TODO
// Create the AdScriptConnector:
const adScriptConnector = new THEOplayerAdScriptConnector.AdScriptConnector(player, adScriptConfig, videoMetadata);
</script>
```

## Documentation
* Add as an ES2015 module

```html

<script type="module">
import {AdScriptConnector} from "@theoplayer/adscript-connector-web";
const player = new THEOplayer.Player(element, configuration);
// Define your configuration for the connector:
const adScriptConfig = {
// TODO
}
// Define the metadata for reporting:
const videoMetadata = {
"assetid": "v0000001",
"type": "content",
"program": "Big Buck Bunny",
"title": "Sample Video - Extended",
"length": "635",
"crossId": "000 111 22222",
"livestream": "0",
"channelId": "",
"attribute": "1"
}
Documentation can be acquired through the [AdScript documentation website](https://adscript.admosphere.cz/).
// Create the AdScriptConnector:
const adScriptConnector = new AdScriptConnector(player, adScriptConfig, videoMetadata);
</script>
```

## Updating metadata

If the metadata has changed during playback, you can update it with:

```javascript
adScriptConnector.updateMetadata(newMetadata);
```

0 comments on commit 5b61f22

Please sign in to comment.