diff --git a/CHANGELOG.md b/CHANGELOG.md index 021e7aa..268ba37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog All changes to this project will be documented in this file. +## [1.2.26] - 2023-10-05 +- Add isLiveStream() ## [1.2.25] - 2023-06-02 - Add ads support ## [1.2.24] - 2023-03-03 diff --git a/README.md b/README.md index 70e4cb6..07ad397 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ - [`getVolume(callback?: (volume: number) => void): Promise`](#getvolumecallback-volume-number--void-promisenumber) - [`getLoop(callback?: (loop: boolean) => void): Promise`](#getloopcallback-loop-boolean--void-promiseboolean) - [`getPlaybackRate(callback?: (rate: number) => void): Promise`](#getplaybackratecallback-rate-number--void-promisenumber) + - [`isLiveStream(callback?: (live: boolean) => void): Promise`](#islivestreamcallback-live-boolean--void-promiseboolean) - [`destroy()`](#destroy) - [`addEventListener(event: string, callback: () => void)`](#addeventlistenerevent-string-callback---void) - [Full example](#full-example) @@ -344,6 +345,8 @@ The sdk instance has the following methods: > Check whether the video is in loop mode. #### `getPlaybackRate(callback?: (rate: number) => void): Promise` > Retrieve the playback rate. +#### `isLiveStream(callback?: (live: boolean) => void): Promise` +> Check whether the video is a live stream. #### `destroy()` > Destroy the player instance. #### `addEventListener(event: string, callback: () => void)` diff --git a/index.ts b/index.ts index 8f010f2..8eb8d2c 100644 --- a/index.ts +++ b/index.ts @@ -284,6 +284,9 @@ export class PlayerSdk { getVideoSize(callback?: (size: {width: number, height: number}) => void): Promise<{width: number, height: number}> { return this.postMessage({ message: 'getVideoSize' }, callback, true); } + isLiveStream(callback?: (isLiveStream: boolean) => void): Promise { + return this.postMessage({ message: 'isLiveStream' }, callback); + } addEventListener(event: K, callback: PlayerSdkEvent[K]) { this.userEventListeners.push({ event, callback }); diff --git a/package-lock.json b/package-lock.json index 005d08e..a272655 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@api.video/player-sdk", - "version": "1.2.25", + "version": "1.2.26", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@api.video/player-sdk", - "version": "1.2.25", + "version": "1.2.26", "license": "MIT", "dependencies": { "core-js": "^3.8.3", diff --git a/package.json b/package.json index cbb4f3b..0063ef7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@api.video/player-sdk", - "version": "1.2.25", + "version": "1.2.26", "description": "api.video player SDK", "repository": { "type": "git",