'Extend context by data for transcript basic tab.'

def get_context(self):

    _context = super(VideoDescriptor, self).get_context()
    metadata_fields = copy.deepcopy(self.editable_metadata_fields)
    display_name = metadata_fields['display_name']
    video_url = metadata_fields['html5_sources']
    video_id = metadata_fields['edx_video_id']
    youtube_id_1_0 = metadata_fields['youtube_id_1_0']
    def get_youtube_link(video_id):
        '\n                                                Returns    the    fully-qualified    YouTube    URL    for    the    given    video    identifier\n                                                '
        if (self.edx_video_id and edxval_api):
            val_youtube_id = edxval_api.get_url_for_profile(self.edx_video_id, 'youtube')
            if val_youtube_id:
                video_id = val_youtube_id
        return self.create_youtube_url(video_id)
    _ = self.runtime.service(self, 'i18n').ugettext
    video_url.update({'help': _('The    URL    for    your    video.    This    can    be    a    YouTube    URL    or    a    link    to    an    .mp4,    .ogg,    or    .webm    video    file    hosted    elsewhere    on    the    Internet.'), 'display_name': _('Default    Video    URL'), 'field_name': 'video_url', 'type': 'VideoList', 'default_value': [get_youtube_link(youtube_id_1_0['default_value'])]})
    source_url = self.create_youtube_url(youtube_id_1_0['value'])
    if (self.edx_video_id and edxval_api):
        val_profiles = ['youtube', 'desktop_webm', 'desktop_mp4']
        if HLSPlaybackEnabledFlag.feature_enabled(self.runtime.course_id.for_branch(None)):
            val_profiles.append('hls')
        val_video_encodings = edxval_api.get_urls_for_profiles(self.edx_video_id, val_profiles)
        if val_video_encodings.get('youtube'):
            source_url = self.create_youtube_url(val_video_encodings['youtube'])
        elif val_video_encodings.get('hls'):
            source_url = val_video_encodings['hls']
        elif val_video_encodings.get('desktop_mp4'):
            source_url = val_video_encodings['desktop_mp4']
        elif val_video_encodings.get('desktop_webm'):
            source_url = val_video_encodings['desktop_webm']
    if (source_url and (source_url not in video_url['value'])):
        video_url['value'].insert(0, source_url)
    metadata = {'display_name': display_name, 'video_url': video_url, 'edx_video_id': video_id}
    _context.update({'transcripts_basic_tab_metadata': metadata})
    return _context
