Plays a notification on new message using HTML5's audio tag. #23

Merged
merged 2 commits into from Mar 28, 2012

Projects

None yet

3 participants

@richard-ive
Contributor

Media licensed under Creative Commons. .ogg for Firefox and .mp3 for all other browsers.

Richard Ive added some commits Mar 26, 2012
Richard Ive Notification on new message. HTML5 audio tag.
Added html5 audio tag to play notification on new message. Added .ogg
for Firefox and .mp3 for other browsers.
d492ae2
Richard Ive jQuery element selector. 8af5d45
@chrismatthieu
Collaborator

I like the idea of a very short tone on each update. I allows me to just keep it open in a tab and know if anyone has typed anything for me to check.

Alejandro, I agree with you that sometimes that could become annoying. Perhaps there is an easy way to turn it off or on...

@microp11
Collaborator

There a full unused title bar, perhaps a button there, something like the buttons for Unwatch or Your Fork on github?!
There is even space there for some mini-statistics or a link to source code, who knows...

@microp11
Collaborator

Richard, I have added prerequisites for adding tone as suggested on pm only, default disabled, (on the yellow messages as alejandromg put it). I have tested your proposed changes, they do not work in IE.

To enable the sound only for the yellow messages, i suggest to use the validation in the place marked strong below, inside app.js

    var row_class = '';
    if (window.nick){
        var reg = window.nick.replace(/\s+/, "|");
        var regexp = new RegExp(reg,'gi');
        if (regexp.test(message)){
            Tinycon.setBubble(++window.counter);
            row_class='gold';
if (c.getTonesEnabled() == true) { document.getElementById('notification').play(); }
        } else {
            row_class='default';
        }
    }
@richard-ive
Contributor

Thanks for testing on IE, I don't actually have a Windows in the house anymore!

I personally feel the notification should play on each received message, however like Chris said you should be able to turn it on and off.

@microp11
Collaborator

Richard, can you indicate a code that would work in IE as well?
I am running a test local server at http://24.215.9.56:13001/

@richard-ive
Contributor

I'll be honest I didn't think about IE at all when I started this. Having just done some research IE9 is the first version to support . The code that I used should work using the mp3.

On a side note. If this goes ahead, how does it work on github? Do I wait for your fork to be merged into the master brach, or do I have to fork your fork (ha!)?

@microp11
Collaborator

On my IE8 browser there is NO HOPE:

Audio0/20audio element No ✘

PCM audio support No ✘
MP3 support No ✘
AAC support No ✘
Ogg Vorbis support No ✘
WebM support No ✘

I think first we have to reach a consensus of how it is going to be implemented, for all messages or only for the yellow ones. Then we have to hide the button from IE8 :)

After that I would think my code can be pulled in and then you can update and attach your code for a subsequest pull.

@chrismatthieu chrismatthieu merged commit 8af5d45 into nodester:master Mar 28, 2012
@chrismatthieu
Collaborator

merged and deployed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment