Skip to content

Commit bc2021a

Browse files
Merge pull request #62 from apivideo/hotkeys-parameter
Add hotkeys parameter
2 parents 3e3e15e + bca0702 commit bc2021a

File tree

5 files changed

+44
-34
lines changed

5 files changed

+44
-34
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All changes to this project will be documented in this file.
44

5+
## [1.2.30] - 2024-06-19
6+
7+
- Add hotkeys parameter
8+
59
## [1.2.29] - 2024-06-19
610

711
- Add custom domain

README.md

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
## Table of contents
1111

1212
- [Table of contents](#table-of-contents)
13-
- [Project description](#project-description)
14-
- [Getting started](#getting-started)
15-
- [Installation](#installation)
16-
- [Method #1: requirejs](#method-1-requirejs)
17-
- [Method #2: typescript](#method-2-typescript)
18-
- [Method #2: simple include in a javascript project](#method-2-simple-include-in-a-javascript-project)
19-
- [Documentation](#documentation)
20-
- [Instantiation](#instantiation)
21-
- [Ads](#ads)
22-
- [Methods](#methods)
23-
- [Full example](#full-example)
24-
- [Control an existing embedded player using the SDK](#control-an-existing-embedded-player-using-the-sdk)
13+
- [Project description](#project-description)
14+
- [Getting started](#getting-started)
15+
- [Installation](#installation)
16+
- [Method #1: requirejs](#method-1-requirejs)
17+
- [Method #2: typescript](#method-2-typescript)
18+
- [Method #2: simple include in a javascript project](#method-2-simple-include-in-a-javascript-project)
19+
- [Documentation](#documentation)
20+
- [Instantiation](#instantiation)
21+
- [Ads](#ads)
22+
- [Methods](#methods)
23+
- [Full example](#full-example)
24+
- [Control an existing embedded player using the SDK](#control-an-existing-embedded-player-using-the-sdk)
2525

2626
<!--</documentation_excluded>-->
2727

@@ -116,25 +116,26 @@ The PlayerSdk constructor takes 2 parameters:
116116
- `targetSelector: string | Element` a CSS selector targeting the DOM element in which you want to create the player (eg. "#target"), or the DOM element itself
117117
- `options: SdkOptions` an object containing the player options. The available options are the following:
118118

119-
| Option name | Mandatory | Type | Description |
120-
| -------------: | --------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
121-
| id | **yes** | string | the id of the video (videoId or liveStreamId) |
122-
| token | yes for private video | string | the [private video](https://api.video/blog/tutorials/tutorial-private-videos/) url token |
123-
| privateSession | no | string | the [private video](https://api.video/blog/tutorials/tutorial-private-videos/) session id if needed |
124-
| live | no (default: false) | boolean | indicate that the video is a live one |
125-
| autoplay | no (default: false) | boolean | start playing the video as soon as it is loaded |
126-
| muted | no (default: false) | boolean | the video is muted |
127-
| metadata | no (default: empty) | object | object containing [metadata](https://api.video/blog/tutorials/dynamic-metadata/) (see **Full example** below) |
128-
| hideControls | no (default: false) | boolean | the controls are hidden (except unmute button if the video starts muted) |
129-
| chromeless | no (default: false) | boolean | chromeless mode: all controls are hidden |
130-
| hideTitle | no (default: false) | boolean | the video title is hidden |
131-
| hidePoster | no (default: false) | boolean | the poster image isn't displayed |
132-
| showSubtitles | no (default: false) | boolean | the video subtitles are shown by default |
133-
| loop | no (default: false) | boolean | once the video is finished it automatically starts again |
134-
| playbackRate | no (default: 1) | number | the playback rate of the video: 1 for normal, 2 for x2, etc. |
135-
| sequence | no | {start: number, end: number} | define a sequence of the video to play. The video will start at the `start` timecode and end at the `end` timecode. The timecodes are in seconds. |
136-
| ads | no | {adTagUrl: string} | see below [ads](#ads) |
137-
| customDomain | no | string | if you've enabled Custom Domains for your account, the complete 'embed' domain (eg. embed.mydomain.com) |
119+
| Option name | Mandatory | Type | Description |
120+
| -------------: | --------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
121+
| id | **yes** | string | the id of the video (videoId or liveStreamId) |
122+
| token | yes for private video | string | the [private video](https://api.video/blog/tutorials/tutorial-private-videos/) url token |
123+
| privateSession | no | string | the [private video](https://api.video/blog/tutorials/tutorial-private-videos/) session id if needed |
124+
| live | no (default: false) | boolean | indicate that the video is a live one |
125+
| autoplay | no (default: false) | boolean | start playing the video as soon as it is loaded |
126+
| muted | no (default: false) | boolean | the video is muted |
127+
| metadata | no (default: empty) | object | object containing [metadata](https://api.video/blog/tutorials/dynamic-metadata/) (see **Full example** below) |
128+
| hideControls | no (default: false) | boolean | the controls are hidden (except unmute button if the video starts muted) |
129+
| chromeless | no (default: false) | boolean | chromeless mode: all controls are hidden |
130+
| hideTitle | no (default: false) | boolean | the video title is hidden |
131+
| hidePoster | no (default: false) | boolean | the poster image isn't displayed |
132+
| showSubtitles | no (default: false) | boolean | the video subtitles are shown by default |
133+
| loop | no (default: false) | boolean | once the video is finished it automatically starts again |
134+
| playbackRate | no (default: 1) | number | the playback rate of the video: 1 for normal, 2 for x2, etc. |
135+
| sequence | no | `{start: number, end: number}` | define a sequence of the video to play. The video will start at the `start` timecode and end at the `end` timecode. The timecodes are in seconds. |
136+
| ads | no | `{adTagUrl: string}` | see below [ads](#ads) |
137+
| customDomain | no | string | if you've enabled Custom Domains for your account, the complete 'embed' domain (eg. embed.mydomain.com) |
138+
| hotkeys | no (default: true) | boolean | if false, deactivate the player's hotkeys to prevent it from capturing focus, which can be beneficial in certain scenarios |
138139

139140
The sdk instance can be used to control the video playback, and to listen to player events.
140141

index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type SdkOptions = {
5555
// This feature is experimental.
5656
// It may change or be removed at any time and could cause significant playback issues.
5757
maximalQuality?: number;
58+
hotKeys?: boolean;
5859
};
5960

6061
type PlayerSdkEvent = {
@@ -446,6 +447,10 @@ export class PlayerSdk {
446447
url = addParameterInIframeHash("hide-controls");
447448
}
448449

450+
if (options.hotKeys !== undefined && !options.hotKeys) {
451+
url = addParameterInIframeHash("hotkeys:false");
452+
}
453+
449454
if (options.chromeless === true) {
450455
url = addParameterInIframeHash("chromeless");
451456
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@api.video/player-sdk",
3-
"version": "1.2.29",
3+
"version": "1.2.30",
44
"description": "api.video player SDK",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)