- segment_base = ET.SubElement(rep, 'SegmentBase', indexRange="0-60000", indexRangeExact="true")
- ET.SubElement(segment_base, 'Initialization', range='0-60000')
+ segment_base = ET.SubElement(rep, 'SegmentBase', indexRange="0-"+str(init_length), indexRangeExact="true")
+ ET.SubElement(segment_base, 'Initialization', range='0-'+str(init_length))
+
+ # Multiple Adaption Sets for subtiles
+ for text_track in manifest['textTracks']:
+ if 'downloadables' not in text_track or text_track['downloadables'] is None:
+ continue
+ subtiles_adaption_set = ET.SubElement(period, 'AdaptationSet',
+ lang=text_track['bcp47'],
+ codecs='stpp',
+ contentType='text',
+ mimeType='application/ttml+xml')
+ for downloadable in text_track['downloadables']:
+ rep = ET.SubElement(subtiles_adaption_set, 'Representation',
+ nflxProfile=downloadable['contentProfile']
+ )
+ ET.SubElement(rep, 'BaseURL').text = self.__get_base_url(downloadable['urls'])