diff --git a/main/document/showinframes.php b/main/document/showinframes.php index dce3f188a8..a1b66d76a7 100755 --- a/main/document/showinframes.php +++ b/main/document/showinframes.php @@ -104,7 +104,7 @@ if (!api_is_allowed_to_edit() && !$is_visible) { } $pathinfo = pathinfo($header_file); -$jplayer_supported_files = array('mp4', 'ogv','flv'); +$jplayer_supported_files = array('mp4', 'ogv', 'flv', 'm4v'); $jplayer_supported = false; if (in_array(strtolower($pathinfo['extension']), $jplayer_supported_files)) { @@ -250,33 +250,38 @@ if ($isChatFolder) { } $execute_iframe = true; - if ($jplayer_supported) { $extension = api_strtolower($pathinfo['extension']); + if ($extension == 'mp4') { + $extension = 'm4v'; + } $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/'; $htmlHeadXtra[] = ''; $htmlHeadXtra[] = ''; - $jquery = ' $("#jquery_jplayer_1").jPlayer({ - ready: function() { - $(this).jPlayer("setMedia", { - '.$extension.' : "'.$document_data['direct_url'].'" - }); - }, - errorAlerts: false, - warningAlerts: false, - swfPath: "'.$js_path.'jquery-jplayer/jplayer/", - //supplied: "m4a, oga, mp3, ogg, wav", - supplied: "'.$extension.'", - //wmode: "window", - solution: "flash, html", // Do not change this setting - cssSelectorAncestor: "#jp_container_1", - });'; + $jquery = ' + $("#jquery_jplayer_1").jPlayer({ + ready: function() { + $(this).jPlayer("setMedia", { + '.$extension.' : "'.$document_data['direct_url'].'" + }); + }, + cssSelectorAncestor: "#jp_container_1", + swfPath: "'.$js_path.'jquery-jplayer/jplayer/", + supplied: "'.$extension.'", + useStateClassSkin: true, + autoBlur: false, + smoothPlayBar: true, + keyEnabled: false, + remainingDuration: true, + toggleDuration: true + }); + '; $htmlHeadXtra[] = ''; $execute_iframe = false; @@ -356,9 +361,11 @@ if ($show_web_odf) { echo ''; if ($jplayer_supported) { - echo '
'; + echo '
'; echo DocumentManager::generate_video_preview($document_data); echo '
'; + // media_element blocks jplayer disable it + Display::$global_template->assign('show_media_element', 0); } if ($is_freemind_available) { @@ -442,7 +449,7 @@ if ($execute_iframe) { $content = Security::remove_XSS(file_get_contents($file_url_sys)); echo $content; } else { - echo ''; + echo ''; } } Display::display_footer(); diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index 7c87088dd9..077449524c 100755 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -20,7 +20,7 @@ use ChamiloSession as Session; */ class Display { - /* The main template*/ + /** @var Template */ public static $global_template; public static $preview_style = null; @@ -756,12 +756,12 @@ class Display } $icon = api_get_cdn_path($icon); - + if ($return_only_path) { return $icon; - + } - + $img = self::img($icon, $alt_text, $additional_attributes); if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) { if ($show_text) { diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php index 763616cd4d..8dc4292764 100755 --- a/main/inc/lib/document.lib.php +++ b/main/inc/lib/document.lib.php @@ -3199,15 +3199,15 @@ class DocumentManager * @param array $document_data * @return string */ - static function generate_video_preview($document_data = array()) + public static function generate_video_preview($document_data = array()) { $html = ' -
+