mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 23:17:02 +03:00
Added is.js library
This commit is contained in:
parent
2616b911e1
commit
2038acc14a
10 changed files with 3220 additions and 68 deletions
|
|
@ -325,61 +325,6 @@
|
|||
};
|
||||
}());
|
||||
|
||||
Utils.audio = (function () {
|
||||
|
||||
var
|
||||
oAudio = false
|
||||
;
|
||||
|
||||
return function (sMp3File, sOggFile) {
|
||||
|
||||
if (false === oAudio)
|
||||
{
|
||||
if (Globals.bIsiOSDevice)
|
||||
{
|
||||
oAudio = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var
|
||||
bCanPlayMp3 = false,
|
||||
bCanPlayOgg = false,
|
||||
oAudioLocal = window.Audio ? new window.Audio() : null
|
||||
;
|
||||
|
||||
if (oAudioLocal && oAudioLocal.canPlayType && oAudioLocal.play)
|
||||
{
|
||||
bCanPlayMp3 = '' !== oAudioLocal.canPlayType('audio/mpeg; codecs="mp3"');
|
||||
if (!bCanPlayMp3)
|
||||
{
|
||||
bCanPlayOgg = '' !== oAudioLocal.canPlayType('audio/ogg; codecs="vorbis"');
|
||||
}
|
||||
|
||||
if (bCanPlayMp3 || bCanPlayOgg)
|
||||
{
|
||||
oAudio = oAudioLocal;
|
||||
oAudio.preload = 'none';
|
||||
oAudio.loop = false;
|
||||
oAudio.autoplay = false;
|
||||
oAudio.muted = false;
|
||||
oAudio.src = bCanPlayMp3 ? sMp3File : sOggFile;
|
||||
}
|
||||
else
|
||||
{
|
||||
oAudio = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oAudio = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return oAudio;
|
||||
};
|
||||
}());
|
||||
|
||||
/**
|
||||
* @param {(Object|null|undefined)} oObject
|
||||
* @param {string} sProp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue