Class: IWAudioUtils

IWAudioUtils

A utility class to check if HTML audio is supported and which types can be played.

new IWAudioUtils()

Methods


canPlayType(type)

Checks if the specified audio type should be supported.
Parameters:
Name Type Description
type String a mime type like audio/ogg or audio/mp3; or just ogg or mp3
Returns:
Type
boolean

getSupportedType(types)

Returns the first supported type in the specified array of audio types.
Parameters:
Name Type Description
types Array.<String> an array of audio types (see IWAudioUtils.canPlayType())
Returns:
the first type in the array which is supported, or null if no type is supported
Type
String

isSupported()

Checks if audio is supported.
Returns:
Type
boolean