summaryrefslogtreecommitdiff
path: root/plugins/newmail_notifier
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-10-04 18:27:32 +0200
committerAleksander Machniak <alec@alec.pl>2013-10-04 18:27:32 +0200
commitbba13c33a097ac35ef8a29ef255be3ac47858f78 (patch)
tree1fbc276a3eaf70fc980a91c9171dde70368d5de9 /plugins/newmail_notifier
parentfed081229f81fdfe6d943b06abbcd22e59c555df (diff)
Fix sound notification in Internet Explorer (use mp3 file for IE and
other browsers which support audio/mp3 files)
Diffstat (limited to 'plugins/newmail_notifier')
-rw-r--r--plugins/newmail_notifier/composer.json2
-rw-r--r--plugins/newmail_notifier/newmail_notifier.js8
-rw-r--r--plugins/newmail_notifier/package.xml4
-rw-r--r--plugins/newmail_notifier/sound.mp3bin0 -> 7488 bytes
4 files changed, 10 insertions, 4 deletions
diff --git a/plugins/newmail_notifier/composer.json b/plugins/newmail_notifier/composer.json
index 9809237ba..2ca5db709 100644
--- a/plugins/newmail_notifier/composer.json
+++ b/plugins/newmail_notifier/composer.json
@@ -3,7 +3,7 @@
"type": "roundcube-plugin",
"description": "Supports three methods of notification: 1. Basic - focus browser window and change favicon 2. Sound - play wav file 3. Desktop - display desktop notification (using webkitNotifications feature, supported by Chrome and Firefox with 'HTML5 Notifications' plugin).",
"license": "GNU GPLv3+",
- "version": "0.6",
+ "version": "0.7",
"authors": [
{
"name": "Aleksander Machniak",
diff --git a/plugins/newmail_notifier/newmail_notifier.js b/plugins/newmail_notifier/newmail_notifier.js
index 846bc94c3..2beacf650 100644
--- a/plugins/newmail_notifier/newmail_notifier.js
+++ b/plugins/newmail_notifier/newmail_notifier.js
@@ -71,7 +71,13 @@ function newmail_notifier_basic()
// Sound notification
function newmail_notifier_sound()
{
- var elem, src = 'plugins/newmail_notifier/sound.wav';
+ var elem, src = 'plugins/newmail_notifier/sound',
+ plugin = navigator.mimeTypes ? navigator.mimeTypes['audio/mp3'] : {};
+
+ // Internet Explorer does not support wav files,
+ // support in other browsers depends on enabled plugins,
+ // so we use wav as a fallback
+ src += bw.ie || (plugin && plugin.enabledPlugin) ? '.mp3' : '.wav';
// HTML5
try {
diff --git a/plugins/newmail_notifier/package.xml b/plugins/newmail_notifier/package.xml
index e46c9bc92..3d7277bb4 100644
--- a/plugins/newmail_notifier/package.xml
+++ b/plugins/newmail_notifier/package.xml
@@ -19,9 +19,9 @@
<email>alec@alec.pl</email>
<active>yes</active>
</lead>
- <date>2013-09-12</date>
+ <date>2013-10-04</date>
<version>
- <release>0.6</release>
+ <release>0.7</release>
<api>0.5</api>
</version>
<stability>
diff --git a/plugins/newmail_notifier/sound.mp3 b/plugins/newmail_notifier/sound.mp3
new file mode 100644
index 000000000..3b494a94d
--- /dev/null
+++ b/plugins/newmail_notifier/sound.mp3
Binary files differ