const getExt = filename => {
  const ext = filename.split('.').pop()
  if (ext === filename) return ''
  return ext.toLowerCase()
}
const playableExtList = [
  // video
  '3g2',
  '3gp',
  'aaf',
  'asf',
  'avchd',
  'avi',
  'drc',
  'dv',
  'flv',
  'iso',
  'm2ts',
  'm2v',
  'm4p',
  'm4v',
  'mkv',
  'mng',
  'mov',
  'mp2',
  'mp4',
  'mpe',
  'mpeg',
  'mpg',
  'mpv',
  'mts',
  'mxf',
  'nsv',
  'ogv',
  'qt',
  'rm',
  'rmvb',
  'roq',
  'svi',
  'ts',
  'vob',
  'webm',
  'wmv',
  'yuv',
  // audio
  'aac',
  'ac3',
  'aiff',
  'ape',
  'au',
  'dff',
  'dsf',
  'flac',
  'gsm',
  'it',
  'm3u',
  'm4a',
  'mid',
  'mod',
  'mp3',
  'mpa',
  'oga',
  'ogg',
  'opus',
  'pls',
  'ra',
  's3m',
  'sid',
  'wav',
  'weba',
  'wma',
  'wv',
  'wvc',
  'xm',
]

// eslint-disable-next-line import/prefer-default-export
export const isFilePlayable = fileName => playableExtList.includes(getExt(fileName))
