@@ -294,6 +294,12 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
294294 $scope . audioLiveLatency = 0 ;
295295 $scope . audioPlaybackRate = 1.00 ;
296296
297+ $scope . activePeriod = '' ;
298+ $scope . bufferingPeriod = '' ;
299+
300+ $scope . mpdType = '' ;
301+ $scope . numberOfPeriods = 0 ;
302+
297303 // Starting Options
298304 $scope . autoPlaySelected = true ;
299305 $scope . autoLoadSelected = false ;
@@ -434,6 +440,12 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
434440
435441 $scope . player . on ( dashjs . MediaPlayer . events . MANIFEST_LOADED , function ( e ) {
436442 $scope . isDynamic = e . data . type === 'dynamic' ;
443+ if ( e . data . Period ) {
444+ $scope . numberOfPeriods = e . data . Period . length ;
445+ }
446+ if ( e . data . type ) {
447+ $scope . mpdType = e . data . type ;
448+ }
437449 } , $scope ) ;
438450
439451
@@ -450,11 +462,16 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
450462 $scope [ e . mediaType + 'Bitrate' ] = bitrate ;
451463 $scope . plotPoint ( 'pendingIndex' , e . mediaType , e . newQuality + 1 , getTimeForPlot ( ) ) ;
452464 $scope . safeApply ( ) ;
465+
466+ if ( e . currentRepresentation && e . currentRepresentation . adaptation && e . currentRepresentation . adaptation . period ) {
467+ $scope . bufferingPeriod = e . currentRepresentation . adaptation . period . id ;
468+ }
453469 } , $scope ) ;
454470
455471
456472 $scope . player . on ( dashjs . MediaPlayer . events . PERIOD_SWITCH_COMPLETED , function ( e ) {
457473 $scope . currentStreamInfo = e . toStreamInfo ;
474+ $scope . activePeriod = e . toStreamInfo . id ;
458475 } , $scope ) ;
459476
460477 $scope . player . on ( dashjs . MediaPlayer . events . QUALITY_CHANGE_RENDERED , function ( e ) {
@@ -1343,11 +1360,11 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
13431360 protectionData [ input . drmKeySystem ] [ 'httpRequestHeaders' ] = input . httpRequestHeaders ;
13441361 }
13451362
1346- if ( input . audioRobustness ) {
1363+ if ( input . audioRobustness ) {
13471364 protectionData [ input . drmKeySystem ] [ 'audioRobustness' ] = input . audioRobustness ;
13481365 }
13491366
1350- if ( input . videoRobustness ) {
1367+ if ( input . videoRobustness ) {
13511368 protectionData [ input . drmKeySystem ] [ 'videoRobustness' ] = input . videoRobustness ;
13521369 }
13531370 } else {
@@ -1391,11 +1408,11 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
13911408 protectionData [ input . drmKeySystem ] [ 'httpRequestHeaders' ] = input . httpRequestHeaders ;
13921409 }
13931410
1394- if ( input . audioRobustness ) {
1411+ if ( input . audioRobustness ) {
13951412 protectionData [ input . drmKeySystem ] [ 'audioRobustness' ] = input . audioRobustness ;
13961413 }
13971414
1398- if ( input . videoRobustness ) {
1415+ if ( input . videoRobustness ) {
13991416 protectionData [ input . drmKeySystem ] [ 'videoRobustness' ] = input . videoRobustness ;
14001417 }
14011418 }
@@ -2039,8 +2056,8 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
20392056 else if ( value === 'null' ) typedValue = null ;
20402057 else if ( value === 'undefined' ) typedValue = undefined ;
20412058 else integerRegEx . test ( value ) ? typedValue = parseInt ( value ) :
2042- ( floatRegEx . test ( value ) ? typedValue = parseFloat ( value ) :
2043- typedValue = value ) ;
2059+ ( floatRegEx . test ( value ) ? typedValue = parseFloat ( value ) :
2060+ typedValue = value ) ;
20442061
20452062 return typedValue ;
20462063 }
0 commit comments