@@ -104,11 +104,12 @@ export class DrmController {
104104 hasData = true ;
105105 }
106106
107- // DRM prioritization
108- if ( this . _isChecked ( 'drm-prioritize' ) ) {
109- const prPriority = parseInt ( $ ( '#drm-pr-priority' ) ?. value ) ;
110- const wvPriority = parseInt ( $ ( '#drm-wv-priority' ) ?. value ) ;
111- const fpPriority = parseInt ( $ ( '#drm-fp-priority' ) ?. value ) ;
107+ // DRM prioritization — apply automatically if any priority has been adjusted
108+ const prPriority = parseInt ( $ ( '#drm-pr-priority' ) ?. value ) ;
109+ const wvPriority = parseInt ( $ ( '#drm-wv-priority' ) ?. value ) ;
110+ const fpPriority = parseInt ( $ ( '#drm-fp-priority' ) ?. value ) ;
111+ const hasPriority = [ prPriority , wvPriority , fpPriority ] . some ( p => ! isNaN ( p ) && p > 0 ) ;
112+ if ( hasPriority ) {
112113 if ( protData [ 'com.microsoft.playready' ] && ! isNaN ( prPriority ) ) {
113114 protData [ 'com.microsoft.playready' ] . priority = prPriority ;
114115 }
@@ -142,6 +143,8 @@ export class DrmController {
142143 this . _setVal ( 'drm-pr-timeout' , pr . httpTimeout ) ;
143144 this . _setVal ( 'drm-pr-video-robustness' , pr . videoRobustness ) ;
144145 this . _setVal ( 'drm-pr-audio-robustness' , pr . audioRobustness ) ;
146+ this . _setVal ( 'drm-pr-persistent-state' , pr . persistentState ) ;
147+ this . _setVal ( 'drm-pr-distinctive-identifier' , pr . distinctiveIdentifier ) ;
145148 this . _extractHeaders ( pr . httpRequestHeaders , this . _prHeaders , 'drm-pr-headers' ) ;
146149 this . _applyPriority ( 'drm-pr-priority' , pr . priority ) ;
147150 }
@@ -154,6 +157,8 @@ export class DrmController {
154157 this . _setVal ( 'drm-wv-timeout' , wv . httpTimeout ) ;
155158 this . _setVal ( 'drm-wv-video-robustness' , wv . videoRobustness ) ;
156159 this . _setVal ( 'drm-wv-audio-robustness' , wv . audioRobustness ) ;
160+ this . _setVal ( 'drm-wv-persistent-state' , wv . persistentState ) ;
161+ this . _setVal ( 'drm-wv-distinctive-identifier' , wv . distinctiveIdentifier ) ;
157162 this . _extractHeaders ( wv . httpRequestHeaders , this . _wvHeaders , 'drm-wv-headers' ) ;
158163 this . _applyPriority ( 'drm-wv-priority' , wv . priority ) ;
159164 }
@@ -166,6 +171,8 @@ export class DrmController {
166171 this . _setVal ( 'drm-fp-timeout' , fp . httpTimeout ) ;
167172 this . _setVal ( 'drm-fp-video-robustness' , fp . videoRobustness ) ;
168173 this . _setVal ( 'drm-fp-audio-robustness' , fp . audioRobustness ) ;
174+ this . _setVal ( 'drm-fp-persistent-state' , fp . persistentState ) ;
175+ this . _setVal ( 'drm-fp-distinctive-identifier' , fp . distinctiveIdentifier ) ;
169176 this . _extractHeaders ( fp . httpRequestHeaders , this . _fpHeaders , 'drm-fp-headers' ) ;
170177 this . _applyPriority ( 'drm-fp-priority' , fp . priority ) ;
171178 }
@@ -188,14 +195,7 @@ export class DrmController {
188195 this . _extractHeaders ( ck . httpRequestHeaders , this . _ckHeaders , 'drm-ck-headers' ) ;
189196 }
190197
191- // Enable DRM prioritization checkbox if any system has a priority set
192- const hasPriority = [ pr , wv , fp ] . some ( d => d && d . priority !== undefined && d . priority !== null ) ;
193- if ( hasPriority ) {
194- const prioritize = $ ( '#drm-prioritize' ) ;
195- if ( prioritize ) {
196- prioritize . checked = true ;
197- }
198- }
198+
199199 }
200200
201201 /**
@@ -215,7 +215,10 @@ export class DrmController {
215215 }
216216 }
217217
218- const selects = [ 'drm-wv-video-robustness' , 'drm-wv-audio-robustness' ] ;
218+ const selects = [ 'drm-wv-video-robustness' , 'drm-wv-audio-robustness' ,
219+ 'drm-pr-persistent-state' , 'drm-pr-distinctive-identifier' ,
220+ 'drm-wv-persistent-state' , 'drm-wv-distinctive-identifier' ,
221+ 'drm-fp-persistent-state' , 'drm-fp-distinctive-identifier' ] ;
219222 for ( const id of selects ) {
220223 const el = $ ( `#${ id } ` ) ;
221224 if ( el ) {
@@ -234,22 +237,13 @@ export class DrmController {
234237 this . _renderHeaders ( 'drm-ck-headers' , this . _ckHeaders ) ;
235238 this . _renderKeyPairs ( ) ;
236239
237- const prioritize = $ ( '#drm-prioritize' ) ;
238- if ( prioritize ) {
239- prioritize . checked = false ;
240- }
241240 $ ( '#drm-pr-priority' ) . value = '0' ;
242241 $ ( '#drm-wv-priority' ) . value = '0' ;
243242 $ ( '#drm-fp-priority' ) . value = '0' ;
244243 }
245244
246245 // ---- Private ----
247246
248- _isChecked ( id ) {
249- const el = $ ( `#${ id } ` ) ;
250- return el ? el . checked : false ;
251- }
252-
253247 _setVal ( id , value ) {
254248 const el = $ ( `#${ id } ` ) ;
255249 if ( el && value !== undefined && value !== null ) {
@@ -308,6 +302,16 @@ export class DrmController {
308302 target . audioRobustness = audioRobustness ;
309303 }
310304
305+ const persistentState = $ ( `#drm-${ prefix } -persistent-state` ) ?. value ;
306+ if ( persistentState ) {
307+ target . persistentState = persistentState ;
308+ }
309+
310+ const distinctiveIdentifier = $ ( `#drm-${ prefix } -distinctive-identifier` ) ?. value ;
311+ if ( distinctiveIdentifier ) {
312+ target . distinctiveIdentifier = distinctiveIdentifier ;
313+ }
314+
311315 // Headers
312316 const headerArray = prefix === 'pr' ? this . _prHeaders : prefix === 'wv' ? this . _wvHeaders : this . _fpHeaders ;
313317 this . _addHeaders ( target , headerArray ) ;
0 commit comments