def get_poster(video):
 if (not video.bumper.get('enabled')):
  return
 poster = OrderedDict({'url': '', 'type': ''})
 if video.youtube_streams:
  youtube_id = video.youtube_streams.split('1.00:')[1].split(',')[0]
  poster['url'] = settings.YOUTUBE['IMAGE_API'].format(youtube_id=youtube_id)
  poster['type'] = 'youtube'
 else:
  poster['url'] = 'https://www.edx.org/sites/default/files/theme/edx-logo-header.png'
  poster['type'] = 'html5'
 return poster

def get_poster ( video ) : if ( not video . bumper . get ( 'enabled' ) ) : return poster = OrderedDict ( { 'url' : '' , 'type' : '' } ) if video . youtube_streams : youtube_id = video . youtube_streams . split ( '1.00:' ) [ 1 ] . split ( ',' ) [ 0 ] poster [ 'url' ] = settings . YOUTUBE [ 'IMAGE_API' ] . format ( youtube_id = youtube_id ) poster [ 'type' ] = 'youtube' else : poster [ 'url' ] = 'https://www.edx.org/sites/default/files/theme/edx-logo-header.png' poster [ 'type' ] = 'html5' return poster
generate poster metadata .