Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
update readme with api information
Browse files Browse the repository at this point in the history
  • Loading branch information
evaschmuhl committed May 24, 2022
1 parent 1054622 commit 38fa7a6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ myvideoplayer.initPlugin('Endcard', {
showEndcard: true,
dataKeyMap: {
// key of endcard, key from API
poster: ‘preview_image’,
endpoint: ‘endcard_url’,
image_small: ‘thumbnail’,
image_medium: ‘preview_image’,
Expand All @@ -42,6 +43,45 @@ myvideoplayer.initPlugin('Endcard', {
})
```

## API endpoint
These endpoint items are needed for the endcard plugin:

`endpoint: string` - link to the suggestions for this video

`title: string` - caption/title of the video

`image_small: string` - poster image in small size for all images and a browser width less than 769px

`image_medium: string` - poster image in medium size for all images and a browser min-width: 769px

`image_large: string` - poster image in large size for the large image and a browser min-width: 769px

`poster: string` - poster image which will be set in the original video element after the endcard

`playlists: array of strings` - needed by the video player

An API example could look like this:
```json
[
{
"title": "Elden Ring: Fundorte aller 7 legendären Zauber und Anrufungen",
"image_small": "https://files.giga-video.de/8b/8f/d4/ce5267fe9772673bb448ea25f9_ciAyNDYgMTM4AzhmYzJmNzZiNGFm.jpg",
"image_medium": "https://files.giga-video.de/8b/8f/d4/ce5267fe9772673bb448ea25f9_ciAyNDYgMTM4AzhmYzJmNzZiNGFm.jpg",
"image_large": "https://files.giga-video.de/8b/8f/d4/ce5267fe9772673bb448ea25f9_ciAyNDYgMTM4AzhmYzJmNzZiNGFm.jpg",
"poster": "https://files.giga-video.de/8b/8f/d4/ce5267fe9772673bb448ea25f9_AzhmYzJmNzZiNGFm.jpg",
"playlists": [
"https://lx56.spieletips.de/2072001061_v4/playlist.m3u8",
"https://vid-cdn60.stroeermb.de/2072001061_v4/playlist.m3u8",
"https://vid-cdn61.stroeermb.de/2072001061_v4/playlist.m3u8"
],
"endpoint": "https://videos-dev.giga.de/suggestions/2072001061"
},
{
...
},
]
```

If there is a problem with the API then the fallback (only replay tile) is shown.

## 🔌 Options
Expand Down
1 change: 1 addition & 0 deletions types/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export interface IData {
title: string
playlists?: string[]
poster?: string
endpoint: string
image_large: string
image_medium: string
Expand Down

0 comments on commit 38fa7a6

Please sign in to comment.