Skip to content

Commit

Permalink
added an audio notice to waiting player #1 when player #2 connects to…
Browse files Browse the repository at this point in the history
… the room
  • Loading branch information
Dmitriy Samoilov committed Mar 27, 2011
1 parent 42202a9 commit a1d214b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Binary file added public/doorbell.mp3
Binary file not shown.
6 changes: 6 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

<div id="log"></div>

<audio preload="auto" autobuffer id="player1_notice_audio">
<source src="doorbell.mp3" />
</audio>

<script type="text/javascript">
// <![CDATA[
$.facebox.settings.closeImage = 'facebox/closelabel.png';
Expand Down Expand Up @@ -244,6 +248,8 @@
case 'round_could_be_started':
if(obj.room_id == window.room_id) {
round_could_be_started = true;
if(jQuery('#player1_notice_audio')[0].play)
jQuery('#player1_notice_audio')[0].play();
jQuery('#player2_flag').html('<img src="/country_icons/' + obj.country_code + '.png" alt="' + obj.country_name + '" width="16" height="11" alt="' + obj.country_name + '"/ >');
jQuery.facebox('Round could be started: please press spacebar to start!');
setTimeout(function() { jQuery.facebox.close() }, 3000); // automatically close the alert after 3 seconds
Expand Down

0 comments on commit a1d214b

Please sign in to comment.