diff --git a/main/document/create_document.php b/main/document/create_document.php
index d6e69b1a2b..5a815c3429 100644
--- a/main/document/create_document.php
+++ b/main/document/create_document.php
@@ -1,5 +1,5 @@
validate())
$content = str_replace(api_get_path('WEB_COURSE_PATH'), $_configuration['url_append'].'/courses/', $texte);
- // replace fake by flv player if needed (fake is present only in templates)
- $content = str_replace('
-
- ','&autoplay=1" />',$content);
-
- $texte = str_replace('mp3player.swf?son='.urlencode($path_to_remove), 'mp3player.swf?son=.%2F', $texte);
-
+ // change the path of mp3 to absolute
+ $content = preg_replace("|(flashvars=\"file=)([\./]*)|","$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/',$content);
+
+
fputs($fp, $content);
fclose($fp);
diff --git a/main/document/edit_document.php b/main/document/edit_document.php
index d168241abe..92960a9f6b 100644
--- a/main/document/edit_document.php
+++ b/main/document/edit_document.php
@@ -1,4 +1,4 @@
-