Skip to content

Commit 3d12d05

Browse files
Merge pull request #49 from apivideo/add-getplaying-method
Add getplaying method
2 parents b777978 + 7f55eb4 commit 3d12d05

File tree

12 files changed

+3172
-207
lines changed

12 files changed

+3172
-207
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
dist

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ tslint.json
33
webpack.config.js
44
node_modules
55
test
6-
dist/test
6+
dist/test
7+
samples
8+
.github

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
All changes to this project will be documented in this file.
33

4+
## [1.2.22] - 2022-11-04
5+
- Add `getPlaying()` method
6+
47
## [1.2.21] - 2022-05-23
58
- Apply `setVideoStyleObjectFit()` and `setVideoStyleTransform()` to poster.
69

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
- [`requestPictureInPicture()`](#requestpictureinpicture)
4444
- [`exitPictureInPicture()`](#exitpictureinpicture)
4545
- [`getPaused(callback?: (paused: boolean) => void): Promise<boolean>`](#getpausedcallback-paused-boolean--void-promiseboolean)
46+
- [`getPlaying(callback?: (playing: boolean) => void): Promise<boolean>`](#getplayingcallback-playing-boolean--void-promiseboolean)
4647
- [`getMuted(callback?: (muted: boolean) => void): Promise<boolean>`](#getmutedcallback-muted-boolean--void-promiseboolean)
4748
- [`getDuration(callback?: (duration: number) => void): Promise<number>`](#getdurationcallback-duration-number--void-promisenumber)
4849
- [`getCurrentTime(callback?: (currentTime: number) => void): Promise<number>`](#getcurrenttimecallback-currenttime-number--void-promisenumber)
@@ -320,6 +321,8 @@ The sdk instance has the following methods:
320321
> Leave picture in picture mode
321322
#### `getPaused(callback?: (paused: boolean) => void): Promise<boolean>`
322323
> Check weither the video is paused.
324+
#### `getPlaying(callback?: (playing: boolean) => void): Promise<boolean>`
325+
> Check weither the video is playing.
323326
#### `getMuted(callback?: (muted: boolean) => void): Promise<boolean>`
324327
> Check weither the video is muted.
325328
#### `getDuration(callback?: (duration: number) => void): Promise<number>`

dist/index.d.ts

Lines changed: 0 additions & 135 deletions
This file was deleted.

dist/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/test/index.test.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ export class PlayerSdk {
253253
getMuted(callback?: (muted: boolean) => void): Promise<boolean> {
254254
return this.postMessage({ message: 'getMuted' }, callback);
255255
}
256+
getPlaying(callback?: (muted: boolean) => void): Promise<boolean> {
257+
return this.postMessage({ message: 'getPlaying' }, callback);
258+
}
256259
getDuration(callback?: (duration: number) => void): Promise<number> {
257260
return this.postMessage({ message: 'getDuration' }, callback, true);
258261
}

0 commit comments

Comments
 (0)