-IframeResizer = require('./iframe_resizer.coffee')
 SubscribeButtonTrigger = require('./subscribe_button_trigger.coffee')
 PodigeePodcastPlayer = require('./app.coffee')
 $ = require('jquery')

    unless window.location.protocol.match(/^https/)
      @scriptSrc = scriptSrc.replace(/^https/, 'http')
    @scriptSrc = @scriptSrc.match(/(^.*\/)/)[0].replace(/javascripts\/$/, '').replace(/\/$/, '')
    

  getDirectHtml: () ->
    rendered = $.Deferred()


    config = @elem.getAttribute('data-configuration').replace(/(^\s+|\s+$)/g, '')
    @id = @randomId(config)
    @configuration = @getInSiteConfig(config) || {json_config: config}

    try
      @configuration.customOptions = JSON.parse(@elem.getAttribute('data-options'))
    catch
      console.debug('[Podigee Podcast Player] data-options has invalid JSON')

    @buildPlayer(html)
    @configuration.id = @player.id
    @setupSubscribeButton()
    new PodigeePodcastPlayer("##{@playerId()}", @configuration, scriptSrc)
    @replaceElem()

  getInSiteConfig: (config) ->
    inSiteConfig = if !(config.indexOf('http') == 0) && config.match(/\./) && !config.match(/^\//)
      configSplit = config.split('.')
