Oof, I hope I'm not going to get labeled a spammer here... I just have
lots of questions and this seems to be the place to go. My apologies
in advance.

So I've searched the list archives, the ruby on rails spinoffs
archives, and did a general net search on this one and came up with
nothing so I hope asking this isn't a faux pas.

Anyway, I'm trying to play sound via the Sound.play() scriptaculous
call. The code works fine in Opera, FF3, Safari, and IE6 (boggle
[although it doesn't stream like it does in the others]) but doesn't
work in IE8 (boggle). I have some pngs I'm swapping out whenever the
user asks to play or stop a sound, and that works fine, so I know the
code is being run. It just seems like IE8 is completely ignoring the
Sound call. Is this a known bug or am I missing something?

Source:
var TuneToaster = Class.create({

        initialize: function(ele) {
                this.soundPrefix = "http://[redacted]/cgi-bin/
stealingourtunesaintcoolseriously.py?id="
                this.idPrefix = "Song-";
                this.currentlyPlaying = null;
                var ele = $(ele);
                var players = ele.select('.JSmusicPlayer');
                players.invoke('update', '<img src="images/uglyPlay.png">');
                players.each(this.setupPlayer.bind(this));
        },

        setupPlayer: function(ele) {
                ele.observe('click', 
this.playerClicked.bindAsEventListener(this));
        },

        playerClicked: function(ev) {
                var elm = ev.findElement();
                ev.stop();
                elm = elm.up(); //for some reason elm is the img rather than the
JSmusicPlayer span
                var idText = elm.identify();
                idText = idText.sub(this.idPrefix, '');
                if (this.currentlyPlaying) {
                        this.currentlyPlaying.update('<img 
src="images/uglyPlay.png">');
                        Sound.play('', {replace:true});
                        if (this.currentlyPlaying == elm) {
                                this.currentlyPlaying = null;
                                return;
                        }
                }
                elm.update('<img src="images/uglyStop.png">');
                this.currentlyPlaying = elm;
                Sound.play(this.soundPrefix + idText);
        }
});

Cheers, Junk

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to