|
20 | 20 | import javax.xml.parsers.DocumentBuilderFactory; |
21 | 21 | import java.io.StringReader; |
22 | 22 | import java.util.List; |
| 23 | +import java.util.Locale; |
23 | 24 | import java.util.Random; |
24 | 25 | import java.util.function.Consumer; |
25 | 26 | import java.util.stream.Collectors; |
@@ -191,7 +192,7 @@ private void assertManifestGenerated(final String dashManifest, |
191 | 192 | () -> assertMpdElement(document), |
192 | 193 | () -> assertPeriodElement(document), |
193 | 194 | () -> assertAdaptationSetElement(document, itagItem), |
194 | | - () -> assertRoleElement(document), |
| 195 | + () -> assertRoleElement(document, itagItem), |
195 | 196 | () -> assertRepresentationElement(document, itagItem), |
196 | 197 | () -> { |
197 | 198 | if (itagItem.itagType.equals(ItagItem.ItagType.AUDIO)) { |
@@ -220,10 +221,19 @@ private void assertAdaptationSetElement(@Nonnull final Document document, |
220 | 221 | @Nonnull final ItagItem itagItem) { |
221 | 222 | final Element element = assertGetElement(document, ADAPTATION_SET, PERIOD); |
222 | 223 | assertAttrEquals(itagItem.getMediaFormat().getMimeType(), element, "mimeType"); |
| 224 | + |
| 225 | + if (itagItem.itagType == ItagItem.ItagType.AUDIO) { |
| 226 | + final Locale itagAudioLocale = itagItem.getAudioLocale(); |
| 227 | + if (itagAudioLocale != null) { |
| 228 | + assertAttrEquals(itagAudioLocale.getLanguage(), element, "lang"); |
| 229 | + } |
| 230 | + } |
223 | 231 | } |
224 | 232 |
|
225 | | - private void assertRoleElement(@Nonnull final Document document) { |
226 | | - assertGetElement(document, ROLE, ADAPTATION_SET); |
| 233 | + private void assertRoleElement(@Nonnull final Document document, |
| 234 | + @Nonnull final ItagItem itagItem) { |
| 235 | + final Element element = assertGetElement(document, ROLE, ADAPTATION_SET); |
| 236 | + assertAttrEquals(itagItem.isDescriptiveAudio() ? "alternate" : "main", element, "value"); |
227 | 237 | } |
228 | 238 |
|
229 | 239 | private void assertRepresentationElement(@Nonnull final Document document, |
|
0 commit comments