@@ -296,6 +296,12 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
296296 $scope . audioLiveLatency = 0 ;
297297 $scope . audioPlaybackRate = 1.00 ;
298298
299+ $scope . activePeriod = '' ;
300+ $scope . bufferingPeriod = '' ;
301+
302+ $scope . mpdType = '' ;
303+ $scope . numberOfPeriods = 0 ;
304+
299305 // Starting Options
300306 $scope . autoPlaySelected = true ;
301307 $scope . autoLoadSelected = false ;
@@ -436,6 +442,12 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
436442
437443 $scope . player . on ( dashjs . MediaPlayer . events . MANIFEST_LOADED , function ( e ) {
438444 $scope . isDynamic = e . data . type === 'dynamic' ;
445+ if ( e . data . Period ) {
446+ $scope . numberOfPeriods = e . data . Period . length ;
447+ }
448+ if ( e . data . type ) {
449+ $scope . mpdType = e . data . type ;
450+ }
439451 } , $scope ) ;
440452
441453
@@ -452,11 +464,16 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
452464 $scope [ e . mediaType + 'Bitrate' ] = bitrate ;
453465 $scope . plotPoint ( 'pendingIndex' , e . mediaType , e . newQuality + 1 , getTimeForPlot ( ) ) ;
454466 $scope . safeApply ( ) ;
467+
468+ if ( e . currentRepresentation && e . currentRepresentation . adaptation && e . currentRepresentation . adaptation . period ) {
469+ $scope . bufferingPeriod = e . currentRepresentation . adaptation . period . id ;
470+ }
455471 } , $scope ) ;
456472
457473
458474 $scope . player . on ( dashjs . MediaPlayer . events . PERIOD_SWITCH_COMPLETED , function ( e ) {
459475 $scope . currentStreamInfo = e . toStreamInfo ;
476+ $scope . activePeriod = e . toStreamInfo . id ;
460477 } , $scope ) ;
461478
462479 $scope . player . on ( dashjs . MediaPlayer . events . QUALITY_CHANGE_RENDERED , function ( e ) {
@@ -1481,11 +1498,11 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
14811498 protectionData [ input . drmKeySystem ] [ 'httpRequestHeaders' ] = input . httpRequestHeaders ;
14821499 }
14831500
1484- if ( input . audioRobustness ) {
1501+ if ( input . audioRobustness ) {
14851502 protectionData [ input . drmKeySystem ] [ 'audioRobustness' ] = input . audioRobustness ;
14861503 }
14871504
1488- if ( input . videoRobustness ) {
1505+ if ( input . videoRobustness ) {
14891506 protectionData [ input . drmKeySystem ] [ 'videoRobustness' ] = input . videoRobustness ;
14901507 }
14911508 } else {
@@ -1529,11 +1546,11 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
15291546 protectionData [ input . drmKeySystem ] [ 'httpRequestHeaders' ] = input . httpRequestHeaders ;
15301547 }
15311548
1532- if ( input . audioRobustness ) {
1549+ if ( input . audioRobustness ) {
15331550 protectionData [ input . drmKeySystem ] [ 'audioRobustness' ] = input . audioRobustness ;
15341551 }
15351552
1536- if ( input . videoRobustness ) {
1553+ if ( input . videoRobustness ) {
15371554 protectionData [ input . drmKeySystem ] [ 'videoRobustness' ] = input . videoRobustness ;
15381555 }
15391556 }
@@ -2177,8 +2194,8 @@ app.controller('DashController', ['$scope', '$window', 'sources', 'contributors'
21772194 else if ( value === 'null' ) typedValue = null ;
21782195 else if ( value === 'undefined' ) typedValue = undefined ;
21792196 else integerRegEx . test ( value ) ? typedValue = parseInt ( value ) :
2180- ( floatRegEx . test ( value ) ? typedValue = parseFloat ( value ) :
2181- typedValue = value ) ;
2197+ ( floatRegEx . test ( value ) ? typedValue = parseFloat ( value ) :
2198+ typedValue = value ) ;
21822199
21832200 return typedValue ;
21842201 }
0 commit comments