var mp3 = require('silent-mp3-datauri')
var DEFAULT_TIMEOUT = 300
var noop = function () {}

module.exports = isAutoplaySupported
function isAutoplaySupported (cb, timeoutDelay) {
  if (typeof cb !== 'function') {
    throw new TypeError('must specify a cb function')
  }
  timeoutDelay = typeof timeoutDelay === 'number' ? timeoutDelay : DEFAULT_TIMEOUT

  var audio, timeout
  try {
    timeout = setTimeout(function () {
      cb(false)
      cb = noop
    }, timeoutDelay)
    audio = new window.Audio()
    audio.autoplay = true
    audio.volume = 0
    audio.addEventListener('play', done, false)
    audio.src = mp3
  } catch (e) {
    cb(false)
    cb = noop
  }

  function done () {
    if (timeout) clearTimeout(timeout)
    if (audio) {
      audio.pause()
      audio.removeEventListener('play', done, false)
    }
    cb(true)
    cb = noop
  }
}

@@ -548,16 +548,52 @@
 ume = 0%0A
+    audio.crossOrigin = 'Anonymous'%0A
     audi
@@ -652,16 +652,50 @@
 c = mp3%0A
+    audio.load()%0A    audio.play()%0A
   %7D catc

load and play the audio; use crossOrigin to avoid warnings; should be more cross-platform compatible now