@@ -117,23 +117,29 @@ export function convertToSubscriptionCapabilities(mediaInfo) {
117
117
}
118
118
}
119
119
videoCodecs . sort ( ) ;
120
- const resolutions = Array . from (
120
+ if ( mediaInfo . video && mediaInfo . video . optional && mediaInfo . video . optional
121
+ . parameters ) {
122
+ const resolutions = Array . from (
121
123
mediaInfo . video . optional . parameters . resolution ,
122
124
( r ) => new MediaFormatModule . Resolution ( r . width , r . height ) ) ;
123
- resolutions . sort ( sortResolutions ) ;
124
- const bitrates = Array . from (
125
+ resolutions . sort ( sortResolutions ) ;
126
+ const bitrates = Array . from (
125
127
mediaInfo . video . optional . parameters . bitrate ,
126
128
( bitrate ) => extractBitrateMultiplier ( bitrate ) ) ;
127
- bitrates . push ( 1.0 ) ;
128
- bitrates . sort ( sortNumbers ) ;
129
- const frameRates = JSON . parse (
129
+ bitrates . push ( 1.0 ) ;
130
+ bitrates . sort ( sortNumbers ) ;
131
+ const frameRates = JSON . parse (
130
132
JSON . stringify ( mediaInfo . video . optional . parameters . framerate ) ) ;
131
- frameRates . sort ( sortNumbers ) ;
132
- const keyFrameIntervals = JSON . parse (
133
+ frameRates . sort ( sortNumbers ) ;
134
+ const keyFrameIntervals = JSON . parse (
133
135
JSON . stringify ( mediaInfo . video . optional . parameters . keyFrameInterval ) ) ;
134
- keyFrameIntervals . sort ( sortNumbers ) ;
135
- video = new SubscriptionModule . VideoSubscriptionCapabilities (
136
+ keyFrameIntervals . sort ( sortNumbers ) ;
137
+ video = new SubscriptionModule . VideoSubscriptionCapabilities (
136
138
videoCodecs , resolutions , frameRates , bitrates , keyFrameIntervals ) ;
139
+ } else {
140
+ video = new SubscriptionModule . VideoSubscriptionCapabilities ( videoCodecs ,
141
+ [ ] , [ ] , [ 1.0 ] , [ ] ) ;
142
+ }
137
143
}
138
144
return new SubscriptionModule . SubscriptionCapabilities ( audio , video ) ;
139
145
}
0 commit comments