diff --git a/main/document/record_audio.php b/main/document/record_audio.php index 1b87d9b429..0b09ad64c8 100644 --- a/main/document/record_audio.php +++ b/main/document/record_audio.php @@ -168,6 +168,7 @@ function submitVoice() { // var applet = document.getElementById("nanogong"); var ret = applet.sendGongRequest( "PostToForm", urlnanogong, "voicefile", cookie, "temp");//'PostToForm', postURL, inputname, cookie, filename + if (ret == null) { alert(lang_failled_to_submit); } else { diff --git a/main/document/showinframes.php b/main/document/showinframes.php index 427a1c1ab3..0e316fb318 100644 --- a/main/document/showinframes.php +++ b/main/document/showinframes.php @@ -402,19 +402,14 @@ if ($is_nanogong_available) { } //get file from tmp directory - $to_url=api_get_path(WEB_ARCHIVE_PATH).'temp/audio/'.$file_crip; + $to_url = api_get_path(WEB_ARCHIVE_PATH).'temp/audio/'.$file_crip; echo '
'; echo ''.get_lang('Download').''; echo '
'; echo '
'; - - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; + + echo DocumentManager::readNanogongFile($to_url); //erase temp file in tmp directory when return to documents $_SESSION['temp_audio_nanogong']=$to_sys; diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index e8b072d2d2..6dee48321b 100644 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -1571,11 +1571,21 @@ class Display { return $html; } + /** + * @param string $file + * @param array $params + * @return null|string + */ public static function getMediaPlayer($file, $params = array()) { $fileInfo = pathinfo($file); switch ($fileInfo['extension']) { + case 'wav': + if (isset($params['url'])) { + return DocumentManager::readNanogongFile($params['url']); + } + break; case 'mp3': case 'webm': $autoplay = null; @@ -1587,14 +1597,13 @@ class Display { $class = isset($params['class']) ? ' class="'.$params['class'].'"' : null; $html = '