dokeos
[ class tree: dokeos ] [ index: dokeos ] [ all elements ]

Source for file audiorecorder.inc.php

Documentation is available at audiorecorder.inc.php

  1. <?php //$id: $
  2. // This file is part of the Dokeos software - See license and credits in the documentation/ directory
  3. /**
  4.  * Created on 27.09.2006
  5.  * Include the lazlo file necessary to use the audiorecorder
  6.  * @author Sebastian Wagner <seba.wagner@gmail.com>
  7.  * @author Eric Marguin <e.marguin@elixir-interactive.com>
  8.  * @author Arnaud Ligot <arnaud@cblue.be>
  9.  */
  10. global $_configuration;
  11. $web_path api_get_path(WEB_CODE_PATH);
  12. $getid3_path api_get_path(LIBRARY_PATH);
  13.  
  14.  
  15. require_once($getid3_path."getid3/getid3.php");
  16.  
  17. function getFLVDuration($flv_path{
  18.     $getid3 new getID3;
  19.     $getid3->encoding 'UTF-8';
  20.     try {
  21.         $getid3->Analyze($flv_path);
  22.         return $getid3->info['playtime_seconds'];
  23.     catch (Exception $e
  24.         return 0;
  25.     
  26. }
  27.  
  28.  
  29. if($audio_recorder_studentview=='false')
  30. {
  31.     $width 295;
  32.     $height90;
  33.     $player 'recorder2.swf';
  34.     $server (api_get_setting('service_visio','visio_use_rtmpt')=='true'?'rtmpt://':'rtmp://').api_get_setting('service_visio','visio_host').':'.(api_get_setting('service_visio','visio_use_rtmpt')=='true'?'80':api_get_setting('service_visio','visio_port')).'/recorder';
  35.     $post_uri urlencode($web_path.'conference/audiopost.php?course_code='.api_get_course_id().'&user_id='.api_get_user_id().'&checker='.md5(api_get_course_id().api_get_user_id().gmdate('Ymd').$_configuration['security_key']));
  36.     $filename 'lpi'.$audio_recorder_item_id.'-'.gmdate('YmdHis').api_get_user_id().'.flv';//using -z- as fields splitter
  37.     $path_to_lzx $web_path.'conference/'.$player.'?server='.urlencode($server).'&postURI='.$post_uri.'&filename='.$filename;
  38. }
  39. else
  40. {
  41.     $width 295;
  42.     $height 24;
  43.     $player 'player2.swf';
  44.     $cp api_get_course_path();
  45.     $select "SELECT * FROM $docs .
  46.             " WHERE path like BINARY '/audio/lpi".Database::escape_string($audio_recorder_item_id)."-%' AND filetype='file' " .
  47.             " ORDER BY path DESC";
  48.     $res api_sql_query($select);
  49.     if(Database::num_rows($res)>0)
  50.     {  
  51.         $row Database::fetch_array($res);
  52.         //$filepath = api_get_path(WEB_COURSE_PATH).$cp.'/document'.$row['path'];
  53.         $duration getFLVDuration(api_get_path(SYS_COURSE_PATH).$cp.'/document'.$row['path']);
  54.         $filepath api_get_path(WEB_CODE_PATH).'document/download.php?'.api_get_cidreq().'&doc_url='.$row['path'];
  55.         $path_to_lzx $web_path.'conference/'.$player.'?uri='.urlencode($filepath).'&autostart=true&duration='.$duration;
  56.     }    
  57. }
  58.  
  59. if(!empty($path_to_lzx)){
  60.     $recorder_content sprintf("<object type=\"application/x-shockwave-flash\" data=\"%s\" ".
  61.             "width='$width' height='$height'>".
  62.              "<param name=\"movie\" value=\"%s\">".
  63.          "<param name=\"quality\" value=\"high\">".
  64.          "<param name=\"scale\" value=\"noscale\">".
  65.          "<param name=\"salign\" value=\"LT\">".
  66.          "<param name=\"menu\" value=\"false\"></object>",$path_to_lzx,$path_to_lzx);
  67.     if($audio_recorder_studentview=='false')
  68.     {
  69.         echo '<script type="text/javascript">
  70.     
  71.         function show_audiorecorder()
  72.         {
  73.             document.getElementById("audiorecorder_frame").innerHTML = "'.addslashes($recorder_content).'";
  74.             document.getElementById("show_audiorecorder_div").style.display="none";
  75.         }
  76.     
  77.         </script>
  78.         ';
  79.         
  80.         echo '<div id="show_audiorecorder_div"><a style="cursor:pointer" onclick="show_audiorecorder()">'.get_lang('ShowAudioRecorder').'</a></div>';
  81.         echo '<div id="audiorecorder_frame"></div>';
  82.     }
  83.     else
  84.     {
  85.         echo $recorder_content;
  86.     }
  87. }
  88. ?>

Documentation generated on Thu, 12 Jun 2008 12:59:28 -0500 by phpDocumentor 1.4.1