• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Feature Requests (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Message notification (sound)

This forum is now locked as we will no longer be developing the v1.x branch

Moderators: OldWolf, re*s.t.a.r.s.*2

Topic locked
28 posts • Page 1 of 2 • 1, 2

Postby cactux » Thu Feb 16, 2006 10:17 am

Hello,

In the roadmap, there is :
"New messages notification, for example : changing the page title by adding [n], n being the number of unread new messages, or by adding (*) when a message contains the user's nickname."
This would be great.

Can we also have a sound notification ? Configurable as option so users can disable it ;-)

Yann
cactux
Member
 
Posts: 16
Joined: Wed Feb 15, 2006 11:08 pm
Location: France
  • Website
Top

Postby phpfreechat » Thu Feb 16, 2006 10:26 am

I don't know if it's fesable only with JavaScript.
Maybe using a Macromedia flash applet coupled with some javascript but I don't want to use such "none-free" technologie.

A only JS solution would be better.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby cactux » Thu Feb 16, 2006 10:42 am

Ca semble en effet difficile sans plugin :
http://www.google.com/search?hl=en&ie=U ... javascript

:-(

Yann
cactux
Member
 
Posts: 16
Joined: Wed Feb 15, 2006 11:08 pm
Location: France
  • Website
Top

Postby mickael » Sat Feb 18, 2006 12:58 am

salut :)
j'ai pt une idée pour jouer les sons mais sous windows...
dans la page, mettre un lecteur de type windows mediaplayer ( comme on en vois svt...) et modifier a l'aide de javascript le son a lire et le lancer ( très simple a mettre en oeuvre ... )
mickael
New member
 
Posts: 3
Joined: Sat Feb 18, 2006 12:47 am
Top

Postby Djamoer » Sat Feb 18, 2006 7:36 am

kerphi check out this system
http://www.helpcenterlive.com/

They use a sound notification. Maybe it will be usefull for you. This is more for live chat on the site, instead of irc like chat.
Djamoer
Member
 
Posts: 29
Joined: Sun Feb 12, 2006 12:06 pm
Top

Postby mickael » Sat Feb 18, 2006 12:48 pm

yop pt une solution :)

le script pour jouer le son

<script type="text/javascript">
function notification(son){
document.embeds[son].play();
}
</script>

coté html :

<embed src="chimes.wav" autostart="false" hidden="true" />
<input type="button" value="essayer" onclick="notification(0);" />
mickael
New member
 
Posts: 3
Joined: Sat Feb 18, 2006 12:47 am
Top

Postby fredcosta » Sat Feb 18, 2006 8:53 pm

mickael wrote:yop pt une solution :)

le script pour jouer le son

<script type="text/javascript">
function notification(son){
document.embeds[son].play();
}
</script>

coté html :

<embed src="chimes.wav" autostart="false" hidden="true" />
<input type="button" value="essayer" onclick="notification(0);" />

Works great in IE but not in FF and others.. :-(
fredcosta
New member
 
Posts: 2
Joined: Sat Feb 18, 2006 8:46 pm
Top

Postby bsemf » Sat Feb 18, 2006 9:17 pm

I found this one and it seems to work on FF and IE
Code: Select all
6. Using Dynamic HTML

Dynamic HTML allows you to use JavaScript to write new HTML code into your page and let it be interpreted by the browser. The trick to using dynamic HTML for sound replay is to write into a region of the document the HTML of an embedded sound set to automatically start replay on load. Here we are going to use a <span> region and write into it using its "innerHTML" attribute:

      function DHTMLSound(surl) {
        document.getElementById("dummyspan").innerHTML=
          "<embed src='"+surl+"' hidden=true autostart=true loop=false>";
      }

We can now create the dummy span region and just pass the URL of the sound file to the function to play it:

      <span id=dummyspan></span>
      <form>
      <input type="button" value="Play Sound" onClick="DHTMLSound('success.wav')">
      </form>
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby bsemf » Sat Feb 18, 2006 10:07 pm

Here is my solution (in 3 steps!!)
Add at the end of ~pfctemplatesdefaultchat.html.tpl.php this line:
Code: Select all
<span id='embeddummy'></span>

Find this line in ~pfcsrcphpfreechat.class.php:
Code: Select all
      $xml_reponse->addScript($c->prefix."parseAndPost(".$m_id.",'".addslashes($m_date)."','".addslashes($m_heure)."','".addslashes($m_nick)."','".addslashes($m_words)."','".addslashes($m_cmd)."',".(date("d/m/Y") == $m_date ? 1 : 0).",".($from_id == 0? 1 : 0).");");

Add after that line this one:
Code: Select all
      $xml_reponse->addAssign("embeddummy","innerHTML","<embed src='success.wav' hidden=true autostart=true loop=false>");

It works fine on win32 with FF and IE. You just have to get a sound file called success.wav into clientfile directory.

I found my one here but I dont like it (Hope there are no copyright problems)^^
http://www.phon.ucl.ac.uk/home/mark/audio/success.wav
Last edited by bsemf on Sat Feb 18, 2006 10:08 pm, edited 1 time in total.
bsemf
Member
 
Posts: 21
Joined: Thu Feb 09, 2006 9:19 pm
Location: Germany
  • Website
  • ICQ
  • YIM
Top

Postby fronck » Thu Feb 23, 2006 12:15 am

mickael wrote:salut :)
j'ai pt une idée pour jouer les sons mais sous windows...
dans la page, mettre un lecteur de type windows mediaplayer ( comme on en vois svt...) et modifier a l'aide de javascript le son a lire et le lancer ( très simple a mettre en oeuvre ... )

c'est à dire? comment tu fais pour "mettre un lecteur windows media player dans la page"?
Tu envoies koi par le ftp?

merci
fronck
Member
 
Posts: 25
Joined: Wed Feb 22, 2006 12:13 am
Top

Postby fronck » Thu Feb 23, 2006 7:05 am

C'est bon çà marche, dsl

bsemf wrote:Here is my solution (in 3 steps!!)

Yes, it works, fine.

I'd like to know if the sound plays only when you load the page or if it does for every connected person, to let them know somebody is entering the chat.

thanks
fronck
Member
 
Posts: 25
Joined: Wed Feb 22, 2006 12:13 am
Top

Postby fronck » Thu Feb 23, 2006 7:11 am

yes it works this way, congratulations,thanks
fronck
Member
 
Posts: 25
Joined: Wed Feb 22, 2006 12:13 am
Top

Postby fronck » Thu Feb 23, 2006 4:10 pm

sorry but I have a error message every two posted message saying:
"une erreur s'est produite au niveau de cette page"
(a mistake occurs regarding this page)
pity
fronck
Member
 
Posts: 25
Joined: Wed Feb 22, 2006 12:13 am
Top

Postby fronck » Thu Feb 23, 2006 4:40 pm

and finally it close the browser, not yesterday. I changed the sound today, but even with the other sound, the same problems occur.
please help
fronck
Member
 
Posts: 25
Joined: Wed Feb 22, 2006 12:13 am
Top

Postby aberkvam2 » Thu Mar 16, 2006 10:08 pm

The solution above doesn't seem to work with 0.8. I can't even find the given places in the files.

I tried recreating the solution but the sound only plays on the sender's browser (which defeats the purpose).

Ideally I'd like a clickable button that will play a sound on everyone's browser when it's clicked. (Yeah, potentially annoying but I will be using this for a limited number of people that can be trusted to use it correctly.)

A sound that plays every time a new message comes in or the feature as listed in the roadmap (New messages notification) would also work for my needs.

Any suggestions on how to get any of these ideas to work?
aberkvam2
New member
 
Posts: 2
Joined: Thu Mar 16, 2006 10:01 pm
Top

Next

Topic locked
28 posts • Page 1 of 2 • 1, 2

Return to Feature Requests (v1.x)

Who is online

Users browsing this forum: No registered users and 6 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub