@@ -48,6 +48,12 @@ type SdkOptions = {
4848 start : number ;
4949 end : number ;
5050 }
51+ // This feature is experimental.
52+ // It may change or be removed at any time and could cause significant playback issues.
53+ minimalQuality ?: number ;
54+ // This feature is experimental.
55+ // It may change or be removed at any time and could cause significant playback issues.
56+ maximalQuality ?: number ;
5157}
5258
5359type PlayerSdkEvent = {
@@ -174,6 +180,18 @@ export class PlayerSdk {
174180 this . postMessage ( { message : 'setStyleProperty' , query : ".vjs-poster" , property : "background-size" , value } , undefined , false ) ;
175181 }
176182
183+ // This feature is experimental.
184+ // It may change or be removed at any time and could cause significant playback issues.
185+ setMinimalQuality ( quality : number ) {
186+ this . postMessage ( { message : "setMinimalQuality" , quality} )
187+ } ;
188+
189+ // This feature is experimental.
190+ // It may change or be removed at any time and could cause significant playback issues.
191+ setMaximalQuality ( quality : number ) {
192+ this . postMessage ( { message : "setMaximalQuality" , quality} )
193+ } ;
194+
177195 hideControls ( controls ?: ControlName [ ] ) {
178196 if ( ! controls ) {
179197 this . options . hideControls = true ;
@@ -365,6 +383,14 @@ export class PlayerSdk {
365383 url = addParameterInIframeHash ( "show-subtitles" ) ;
366384 }
367385
386+ if ( options . minimalQuality !== undefined ) {
387+ url = addParameterInIframeHash ( `min-quality:${ encodeURIComponent ( options . minimalQuality ) } ` ) ;
388+ }
389+
390+ if ( options . maximalQuality !== undefined ) {
391+ url = addParameterInIframeHash ( `max-quality:${ encodeURIComponent ( options . maximalQuality ) } ` ) ;
392+ }
393+
368394 if ( options . ads ?. adTagUrl ) {
369395 url = addParameterInIframeHash ( `adTagUrl:${ encodeURIComponent ( options . ads ?. adTagUrl ) } ` ) ;
370396 }
0 commit comments