File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ Object.assign(mejs.MepDefaults, {
2424 * @type {boolean }
2525 */
2626 autoGenerateQualityOptionsFromManifest : false ,
27+ /**
28+ * @type {String }
29+ */
30+ hslQualityChangeStrategy : 'nextLevel' ,
2731 /**
2832 * @type {boolean }
2933 */
@@ -419,13 +423,14 @@ Object.assign(MediaElementPlayer.prototype, {
419423 * @param {MediaElement } media
420424 */
421425 switchHLSQuality ( player , media ) {
426+ const t = this ;
422427 const radios = player . qualitiesContainer . querySelectorAll ( 'input[type="radio"]' ) ;
423428 for ( let index = 0 ; index < radios . length ; index ++ ) {
424429 if ( radios [ index ] . checked ) {
425430 if ( index === 0 ) {
426- media . hlsPlayer . currentLevel = - 1 ;
431+ media . hlsPlayer [ t . options . hslQualityChangeStrategy ] = - 1 ;
427432 } else {
428- media . hlsPlayer . currentLevel = index - 1 ;
433+ media . hlsPlayer [ t . options . hslQualityChangeStrategy ] = index - 1 ;
429434 }
430435 }
431436 }
You can’t perform that action at this time.
0 commit comments