@@ -122,7 +122,8 @@ function MssParser(config) {
122122 let qualityLevels ,
123123 representation ,
124124 segments ,
125- i ;
125+ i ,
126+ index ;
126127
127128 const name = streamIndex . getAttribute ( 'Name' ) ;
128129 const type = streamIndex . getAttribute ( 'Type' ) ;
@@ -168,7 +169,8 @@ function MssParser(config) {
168169 qualityLevels [ i ] . mimeType = adaptationSet . mimeType ;
169170
170171 // Set quality level id
171- qualityLevels [ i ] . Id = adaptationSet . id + '_' + qualityLevels [ i ] . getAttribute ( 'Index' ) ;
172+ index = qualityLevels [ i ] . getAttribute ( 'Index' ) ;
173+ qualityLevels [ i ] . Id = adaptationSet . id + ( ( index !== null ) ? ( '_' + index ) : '' ) ;
172174
173175 // Map Representation to QualityLevel
174176 representation = mapRepresentation ( qualityLevels [ i ] , streamIndex ) ;
@@ -200,12 +202,18 @@ function MssParser(config) {
200202 const representation = { } ;
201203 const type = streamIndex . getAttribute ( 'Type' ) ;
202204 let fourCCValue = null ;
205+ let width = null ;
206+ let height = null ;
203207
204208 representation . id = qualityLevel . Id ;
205209 representation . bandwidth = parseInt ( qualityLevel . getAttribute ( 'Bitrate' ) , 10 ) ;
206210 representation . mimeType = qualityLevel . mimeType ;
207- representation . width = parseInt ( qualityLevel . getAttribute ( 'MaxWidth' ) , 10 ) ;
208- representation . height = parseInt ( qualityLevel . getAttribute ( 'MaxHeight' ) , 10 ) ;
211+
212+ width = parseInt ( qualityLevel . getAttribute ( 'MaxWidth' ) , 10 ) ;
213+ height = parseInt ( qualityLevel . getAttribute ( 'MaxHeight' ) , 10 ) ;
214+ if ( ! isNaN ( width ) ) representation . width = width ;
215+ if ( ! isNaN ( height ) ) representation . height = height ;
216+
209217
210218 fourCCValue = qualityLevel . getAttribute ( 'FourCC' ) ;
211219
0 commit comments