     {sourcesAndTracks, mediaType, height, width} = options
     tag_type = if mediaType is 'video' then 'video' else 'audio'
 
-    sourceTypes = _.map sourcesAndTracks.sources, (source) -> $(source).attr('type')
     # A lot of our recorded audio is actually served up via video/mp4 or video/flv.
     # We need to trick the flash player into playing the video, but looking like
     # an audio player. (Not necessary on iOS/Android - they seem fine playing
     # an mp4 inside an audio tag.)
-    if mediaType is 'audio' and sourceTypes[0].match(/^video\//) and !browserSupportsVideoInAudioTag()
+    if mediaType is 'audio' and sourcesAndTracks.types[0].match(/^video\//) and !browserSupportsVideoInAudioTag()
       tag_type = 'video'
       options.mediaPlayerOptions.isVideo = false
       options.mediaPlayerOptions.videoHeight = 30

  'vendor/mediaelement-and-player'
  'jquery'
], (I18n, _, pubsub, mejs, $) ->

  VIDEO_WIDTH = 550
  VIDEO_HEIGHT = 448

      tracks = _.map data.media_tracks, (track) ->
          languageName = mejs.language.codes[track.locale] || track.locale
          "<track kind='#{track.kind}' label='#{languageName}' src='#{track.url}' srclang='#{track.locale}' />"
      types = _.map data.media_sources, (source) -> source.content_type
      dfd.resolve {sources, tracks, types, can_add_captions: data.can_add_captions}
    dfd

  # After clicking an image to play the video, load the sources and tracks
