aggiunta playsound
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Sun, 18 Feb 2007 10:29:22 +0000 (10:29 +0000)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Sun, 18 Feb 2007 10:29:22 +0000 (10:29 +0000)
web/brisk.phh
web/commons.js

index dae746b..51d8d3a 100644 (file)
@@ -1263,6 +1263,11 @@ function show_table(&$bri, &$user, $sendstep, $is_transition, $is_again)
   if (!$is_again) 
     $ret .= table_wellcome($user);
 
+  if ($is_transition && !$is_again) { // appena seduti al tavolo, play della mucca
+    $ret .= playsound("cow.mp3");
+  }
+
+
   /* CARDS */
   if ($is_transition) { //  && $user->subst ==  "asta" superfluo
     $ret .= "|";
@@ -1521,4 +1526,9 @@ function validate_name($name)
   return (FALSE);
 }
 
+function playsound($filename)
+{
+  return (sprintf('playsound("flasou", "%s");', $filename));
+}
+
 ?>
index 872bdc9..88b97e7 100644 (file)
@@ -806,3 +806,16 @@ function room_checkspace(emme,tables,inpe)
 
     $("esco").innerHTML = "<input name=\"logout\" type=\"button\" value=\"Esco.\" onclick=\"window.onunload = null; act_logout();\" type=\"button\">";
 }
+
+function playsound(tag, sound) {
+   // g_withflash is a global var
+   if (g_withflash) {
+      alert("PLAYSOUND "+sound);
+      $(tag).innerHTML = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '+
+'codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" id="mysound" WIDTH=1 HEIGHT=1>' +
+'<PARAM NAME="movie" VALUE="playsound.swf"><PARAM NAME="PLAY" VALUE="true"><PARAM NAME="LOOP" VALUE="false">' +
+'<PARAM NAME=FlashVars VALUE="streamUrl='+sound+'">' +
+'<EMBED swliveconnect="true" name="mysound" src="playsound.swf" FlashVars="streamUrl='+sound+'" PLAY="true" LOOP="false" '+
+' WIDTH=1 HEIGHT=1 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></OBJECT>';
+   }
+}