This repository was archived by the owner on Oct 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
app/js/streaming/protection Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -293,6 +293,7 @@ MediaPlayer.models.ProtectionModel_21Jan2015 = function () {
293293 var session ,
294294 nbSessions = sessions . length ,
295295 i ,
296+ closeTimeout ,
296297 self = this ;
297298
298299 this . debug . log ( "[DRM][PM_21Jan2015] Teardown" ) ;
@@ -305,9 +306,15 @@ MediaPlayer.models.ProtectionModel_21Jan2015 = function () {
305306 removeSession ( session ) ;
306307 if ( i >= ( nbSessions - 1 ) ) {
307308 mediaKeys = null ;
309+ clearTimeout ( closeTimeout ) ;
308310 self . notify ( MediaPlayer . models . ProtectionModel . eventList . ENAME_TEARDOWN_COMPLETE ) ;
309311 }
310312 } ;
313+ var close = function ( ) {
314+ for ( i = 0 ; i < nbSessions ; i ++ ) {
315+ done ( sessions [ i ] ) ;
316+ }
317+ } ;
311318
312319 if ( nbSessions === 0 ) {
313320 mediaKeys = null ;
@@ -329,6 +336,9 @@ MediaPlayer.models.ProtectionModel_21Jan2015 = function () {
329336 } ) ;
330337 } ) ( session ) ;
331338 }
339+ // Patch for MediaKeySession.close() that may never resolve returned promise
340+ // (for example after license request failure)
341+ closeTimeout = setTimeout ( close , 1000 ) ;
332342 } else {
333343 // If license persistence is enabled, then keep usable sessions data and MediaKeys instance
334344 for ( i = 0 ; i < sessions . length ; i ++ ) {
You can’t perform that action at this time.
0 commit comments