Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(FEC-12795): add/update docs #710

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/images/watermark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
151 changes: 85 additions & 66 deletions docs/translations.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,84 @@
# Adding translations and choosing locale language
# Player UI Labels Translations

The UI locale can be customized by adding translations to the dictionary object.
Dictionaries can be added via the config object and the UI language, can be set via the locale config.

## Defining a new language
* The ui language should be from the ISO Language Code List [ISO Language Codes](https://datahub.io/core/language-codes)

## Defining a new labels for a given language

The language dictionary is a key-value store defining, where key is the UI placeholder name and value is the translated string to appear.

The app developer may change the default values for one of the supported languages or add support for unsupported language by deffining values for the player pre-defined labels keys

A value in a key-value may be a string or an object containing a list of key-value pairs.

A sample English dictionary may look like:

```json
{
"controls": {
"play": "Play",
"pause": "Pause",
"language": "Language",
"settings": "Settings",
"fullscreen": "Fullscreen",
"rewind": "Rewind",
"vrStereo": "vrStereo",
"live": "Live",
"unmute": "Unmute",
"next": "Next",
"prev": "Prev"
},
"settings": {
"quality": "Quality",
"speed": "Speed"
},
"language": {
"audio": "Audio",
"captions": "Captions",
"advanced_captions_settings": "Advanced captions settings"
},
"overlay": {
"close": "Close"
},
"error": {
"default_error": "Something went wrong",
"default_session_text": "Session ID",
"retry": "Retry"
},
"ads": {
"ad_notice": "Advertisement",
"learn_more": "Learn more",
"skip_ad": "Skip ad",
"skip_in": "Skip in"
},
"cvaa": {
"title": "Advanced captions settings",
"sample_caption_tag": "Sample",
"set_custom_caption": "Set custom caption",
"edit_caption": "Edit caption",
"size_label": "Size",
"font_color_label": "Font color",
"font_family_label": "Font family",
"font_style_label": "Font style",
"font_opacity_label": "Font opacity",
"background_color_label": "Background color",
"background_opacity_label": "Background opacity",
"apply": "Apply",
"caption_preview": "This is your caption preview"
}
### A sample *English Dictionary* may look like:

#### en = English

The application will set the "ui" configuration on the root level of the player's config

```
"ui": {
"translations": {
"en": {
"controls": {
"play": "Play",
"pause": "Pause",
"language": "Language",
"settings": "Settings",
"fullscreen": "Fullscreen",
"rewind": "Rewind",
"vrStereo": "vrStereo",
"live": "Live",
"unmute": "Unmute",
"next": "Next",
"prev": "Prev"
},
"settings": {
"quality": "Quality",
"speed": "Speed"
},
"language": {
"audio": "Audio",
"captions": "Captions",
"advanced_captions_settings": "Advanced captions settings"
},
"overlay": {
"close": "Close"
},
"error": {
"default_error": "Something went wrong",
"default_session_text": "Session ID",
"retry": "Retry"
},
"ads": {
"ad_notice": "Advertisement",
"learn_more": "Learn more",
"skip_ad": "Skip ad",
"skip_in": "Skip in"
},
"cvaa": {
"title": "Advanced captions settings",
"sample_caption_tag": "Sample",
"set_custom_caption": "Set custom caption",
"edit_caption": "Edit caption",
"size_label": "Size",
"font_color_label": "Font color",
"font_family_label": "Font family",
"font_style_label": "Font style",
"font_opacity_label": "Font opacity",
"background_color_label": "Background color",
"background_opacity_label": "Background opacity",
"apply": "Apply",
"caption_preview": "This is your caption preview"
}
}
}
}
}

```

For complete translation reference see [here](/translations/en.i18n.json).
Expand All @@ -73,22 +87,27 @@ Default locale is English.

A translation file may contain all the keys in the English translation, and any key not found in the new translation will fallback to using the English one.

## Choosing the display language
## Choosing the display language (locale language)


Setting the display language is done by defining the `locale` config option, where English is the default one.

> Only a locale that exist in the translations dictionary may be set, and setting a locale that doesn't exist will result in keeping the default one set.

```json5
{
locale: 'es', //set the desired locale
translations: {
en: {
/*English dictionary*/
```
"ui": {
"locale": "es", //set the desired locale
"translations": {
"en": {
/*English dictionary like the above example*/
},
"es": {
/*Spanish dictionary like the above example*/
},
es: {
/*Spanish dictionary*/
"ar": {
/*Arabic dictionary like the above example*/
}
....
}
}
```
36 changes: 36 additions & 0 deletions docs/watermark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Player Watermark

The playr UI top level customization exposes `components` configurations where applications can customize their watermark on the player.


##### You can read some more about `componetns` configuraion [here](https://github.com/kaltura/playkit-js-ui/blob/master/docs/configuration.md#configcomponents)

### Default watermark configuration:

```
{
img: string, // URL ro the watermark image
url: string, // Click thrugh URL to the website that you own
placement: string, // Watermark location - ["top-left", "top-right", "bottom-left", "bottom-right"] default top-left
timeout: number // miliseconds, if given the it will trigger a timer to remove the watermark once playbsack starts - default 0 (not removed)
}
```

#### Example

```
"ui": {
"components": {
"watermark": {
"img": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAACCCAMAAAC93eDPAAABNVBMVEX///8AcZbwJC//1wBbvEAAk9yx1CIAqs79pwDu3wAAqYYAbJMAkNsAbpT/1QCt0gDwHirwFiRPuC////tVujgAZ5AApsz9oQD/9szvABP+7O394eLu+fz/+fnb66oAjNr/5nH//fPzWmHc8u30Y2r/+dz81NbyREzx+e///OzP7vbe8PqHxOv/42L/6Hz/2yb3lpr1d3z/64v4n6P7x8n5sbT/4laT0YPxMTs5pOGl0/D/76bE5bu84rKq251nwU/2iI2z0d3Y7tPR5YvH3OTD3mFFh6VemrOCy3C+3/Fbtuf/3kCw4tRhxK1Ku6GM0r//8rh1xl/E599/scSbvs7s9NG62UXU6Jvt88PL4XPy6FP38JXw4i7z6Gek3OxAudeBz+T+xGr+47X+1ZD+uDv+yn39u1NzgAyuAAAL/0lEQVR4nO1baVvaXBNmkaWyJQQsS1xAUBDrCgquoAiiXWhRXNqn1S7P//8Jb0LOMmdht32u97p6f9KEkDsz98ycnBlstr/4i/9zFNYOWnX9vySwXnG5XJWrAndcy+b/EIOWa9FvUHAtXrHH83vOzaXYH6Gwvujqwc9ReBN0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m+ZU7UokEXNcVjmCkMQVlgOqxUrxRXJwM06/2uAX4hC7x88/1VG5VzDMxB8d3HNIPE0WeeoReIRXZ/yIli0kRgUnMqPcLM5fCz/wvFB3ICLQ/41VaMpISsm6KgNHQ6avOPOAP8UgNaG7xYF7/fef3hUWEnj83RWTWz0ToKWS5iBf0YU0KIbja4rDiKjk7A0KiYEiQYXkXLKSkzen2jzo4j0GCfZhATmzBTDDwQHvBBstqyX5kYTSZRTwXwsUSQzFDQZCsgE8DdKP7xQCuZ0Kq9HoMjI1K64WuSFIEiB1DdlleaUHE4OkdMpGbRwbQAZJY+lQF5Bd/HvGEBePcJmmDI56Ffi7xCMtYIlBbJgoXoEw18aGQuaTpF4AJ/5pdgvUCYtJHG9roKP4cXLlGawspL/Cq4y0FrBKpMIWI8ZePGRvFxNQsHP/k4shcToBbsBGa5YWkALqAkGxAAKLnPAlF1j4OzsBRsiW3i9xSx1rBV9ZMqwLFQqFe7N5ZeEAtYjtwOQuwyHw6eyqaipgLOz9ydIeysOiR5NDicnRy9ULAHyeK3wLziYQHpU0n0njF8QWUzhGR5Fc1SjDKZOD7xiAmnBBl5BRppmnBLav2JaoEuG8sSTZOPgO1+kehTiQqH6nfhB3uUokmlVVZRRJoRfBtnnnz9/8AeT1XQ68yeUgDB1A/4vWPwPqWicOc0mj58AAAAASUVORK5CYII=",
"url": "https://kaltura.com",
"placement": "top-right",
"timeout": 10000 // 10 seconds
}
}
}
}
```


![Watermark](images/watermark.png)