diff --git a/CHANGELOG.md b/CHANGELOG.md index 3808017..401bde5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.2.28] - 2023-12-11 +- Add experimental methods + ## [1.2.27] - 2023-12-08 - Add chromecast & airplay events diff --git a/index.ts b/index.ts index a830a23..603998e 100644 --- a/index.ts +++ b/index.ts @@ -48,6 +48,12 @@ type SdkOptions = { start: number; end: number; } + // This feature is experimental. + // It may change or be removed at any time and could cause significant playback issues. + minimalQuality?: number; + // This feature is experimental. + // It may change or be removed at any time and could cause significant playback issues. + maximalQuality?: number; } type PlayerSdkEvent = { @@ -174,6 +180,18 @@ export class PlayerSdk { this.postMessage({ message: 'setStyleProperty', query: ".vjs-poster", property: "background-size", value }, undefined, false); } + // This feature is experimental. + // It may change or be removed at any time and could cause significant playback issues. + setMinimalQuality(quality: number) { + this.postMessage({ message: "setMinimalQuality", quality}) + }; + + // This feature is experimental. + // It may change or be removed at any time and could cause significant playback issues. + setMaximalQuality(quality: number) { + this.postMessage({ message: "setMaximalQuality", quality}) + }; + hideControls(controls?: ControlName[]) { if(!controls) { this.options.hideControls = true; @@ -365,6 +383,14 @@ export class PlayerSdk { url = addParameterInIframeHash("show-subtitles"); } + if(options.minimalQuality !== undefined) { + url = addParameterInIframeHash(`min-quality:${encodeURIComponent(options.minimalQuality)}`); + } + + if(options.maximalQuality !== undefined) { + url = addParameterInIframeHash(`max-quality:${encodeURIComponent(options.maximalQuality)}`); + } + if(options.ads?.adTagUrl) { url = addParameterInIframeHash(`adTagUrl:${encodeURIComponent(options.ads?.adTagUrl)}`); } diff --git a/package-lock.json b/package-lock.json index 74f2d0b..c2626c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@api.video/player-sdk", - "version": "1.2.27", + "version": "1.2.28", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@api.video/player-sdk", - "version": "1.2.27", + "version": "1.2.28", "license": "MIT", "dependencies": { "core-js": "^3.8.3", diff --git a/package.json b/package.json index 9937922..5f01777 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@api.video/player-sdk", - "version": "1.2.27", + "version": "1.2.28", "description": "api.video player SDK", "repository": { "type": "git",