'Parse video fields out of xml_data. The fields are set if they are
present in the XML.
Arguments:
id_generator is used to generate course-specific urls and identifiers'

@classmethod
def _parse_video_xml(cls, xml, id_generator=None):

    field_data = {}
    conversions = {}
    compat_keys = {'from': 'start_time', 'to': 'end_time'}
    sources = xml.findall('source')
    if sources:
        field_data['html5_sources'] = [ele.get('src') for ele in sources]
    track = xml.find('track')
    if (track is not None):
        field_data['track'] = track.get('src')
    handout = xml.find('handout')
    if (handout is not None):
        field_data['handout'] = handout.get('src')
    transcripts = xml.findall('transcript')
    if transcripts:
        field_data['transcripts'] = {tr.get('language'): tr.get('src') for tr in transcripts}
    for (attr, value) in xml.items():
        if (attr in compat_keys):
            attr = compat_keys[attr]
        if (attr in (cls.metadata_to_strip + ('url_name', 'name'))):
            continue
        if (attr == 'youtube'):
            speeds = cls._parse_youtube(value)
            for (speed, youtube_id) in speeds.items():
                normalized_speed = (speed[:(-1)] if speed.endswith('0') else speed)
                if ((youtube_id != '') or ('html5_sources' in field_data)):
                    field_data['youtube_id_{0}'.format(normalized_speed.replace('.', '_'))] = youtube_id
        elif (attr in conversions):
            field_data[attr] = conversions[attr](value)
        elif (attr not in cls.fields):
            field_data.setdefault('xml_attributes', {})[attr] = value
        else:
            field_data[attr] = deserialize_field(cls.fields[attr], value)
    course_id = getattr(id_generator, 'target_course_id', None)
    if (('handout' in field_data.keys()) and course_id):
        handout_location = StaticContent.get_location_from_path(field_data['handout'])
        if isinstance(handout_location, AssetLocator):
            handout_new_location = StaticContent.compute_location(course_id, handout_location.path)
            field_data['handout'] = StaticContent.serialize_asset_key_with_slash(handout_new_location)
    if (('download_video' not in field_data) and sources):
        field_data['source'] = field_data['html5_sources'][0]
    if (('download_track' not in field_data) and (track is not None)):
        field_data['download_track'] = True
    video_asset_elem = xml.find('video_asset')
    if (edxval_api and (video_asset_elem is not None) and ('edx_video_id' in field_data)):
        edxval_api.import_from_xml(video_asset_elem, field_data['edx_video_id'], course_id=course_id)
    field_data = LicenseMixin.parse_license_from_xml(field_data, xml)
    return field_data
