|
104 | 104 | }
|
105 | 105 |
|
106 | 106 | $pathinfo = pathinfo($header_file);
|
107 |
| -$jplayer_supported_files = array('mp4', 'ogv','flv'); |
| 107 | +$jplayer_supported_files = array('mp4', 'ogv', 'flv', 'm4v'); |
108 | 108 | $jplayer_supported = false;
|
109 | 109 |
|
110 | 110 | if (in_array(strtolower($pathinfo['extension']), $jplayer_supported_files)) {
|
@@ -250,33 +250,40 @@ function init() {
|
250 | 250 | }
|
251 | 251 |
|
252 | 252 | $execute_iframe = true;
|
253 |
| - |
254 | 253 | if ($jplayer_supported) {
|
255 | 254 | $extension = api_strtolower($pathinfo['extension']);
|
| 255 | + if ($extension == 'mp4') { |
| 256 | + $extension = 'm4v'; |
| 257 | + } |
256 | 258 | $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
|
257 | 259 | $htmlHeadXtra[] = '<link rel="stylesheet" href="'.$js_path.'jquery-jplayer/skin/blue.monday/css/jplayer.blue.monday.css" type="text/css">';
|
258 | 260 | $htmlHeadXtra[] = '<script type="text/javascript" src="'.$js_path.'jquery-jplayer/jplayer/jquery.jplayer.min.js"></script>';
|
259 | 261 |
|
260 |
| - $jquery = ' $("#jquery_jplayer_1").jPlayer({ |
261 |
| - ready: function() { |
262 |
| - $(this).jPlayer("setMedia", { |
263 |
| - '.$extension.' : "'.$document_data['direct_url'].'" |
264 |
| - }); |
265 |
| - }, |
266 |
| - errorAlerts: false, |
267 |
| - warningAlerts: false, |
268 |
| - swfPath: "'.$js_path.'jquery-jplayer/jplayer/", |
269 |
| - //supplied: "m4a, oga, mp3, ogg, wav", |
270 |
| - supplied: "'.$extension.'", |
271 |
| - //wmode: "window", |
272 |
| - solution: "flash, html", // Do not change this setting |
273 |
| - cssSelectorAncestor: "#jp_container_1", |
274 |
| - });'; |
| 262 | + $jquery = ' |
| 263 | + $("#jquery_jplayer_1").jPlayer({ |
| 264 | + ready: function() { |
| 265 | + $(this).jPlayer("setMedia", { |
| 266 | + '.$extension.' : "'.$document_data['direct_url'].'" |
| 267 | + }); |
| 268 | + }, |
| 269 | + cssSelectorAncestor: "#jp_container_1", |
| 270 | + swfPath: "'.$js_path.'jquery-jplayer/jplayer/", |
| 271 | + supplied: "'.$extension.'", |
| 272 | + useStateClassSkin: true, |
| 273 | + autoBlur: false, |
| 274 | + keyEnabled: false, |
| 275 | + remainingDuration: true, |
| 276 | + toggleDuration: true, |
| 277 | + solution: "html, flash", |
| 278 | + errorAlerts: false, |
| 279 | + warningAlerts: false |
| 280 | + }); |
| 281 | + '; |
275 | 282 |
|
276 | 283 | $htmlHeadXtra[] = '<script>
|
277 | 284 | $(document).ready( function() {
|
278 | 285 | //Experimental changes to preview mp3, ogg files
|
279 |
| - '.$jquery.' |
| 286 | + '.$jquery.' |
280 | 287 | });
|
281 | 288 | </script>';
|
282 | 289 | $execute_iframe = false;
|
@@ -356,9 +363,13 @@ function init() {
|
356 | 363 | echo '</div>';
|
357 | 364 |
|
358 | 365 | if ($jplayer_supported) {
|
359 |
| - echo '<br /><div class="span12" style="margin:0 auto; width:100%; text-align:center;">'; |
| 366 | + echo '<br />'; |
| 367 | + echo '<div class="col-md-3 col-md-offset-3">'; |
360 | 368 | echo DocumentManager::generate_video_preview($document_data);
|
361 | 369 | echo '</div>';
|
| 370 | + |
| 371 | + // media_element blocks jplayer disable it |
| 372 | + Display::$global_template->assign('show_media_element', 0); |
362 | 373 | }
|
363 | 374 |
|
364 | 375 | if ($is_freemind_available) {
|
@@ -442,7 +453,7 @@ function getMap(map){
|
442 | 453 | $content = Security::remove_XSS(file_get_contents($file_url_sys));
|
443 | 454 | echo $content;
|
444 | 455 | } else {
|
445 |
| - echo '<iframe id="mainFrame" name="mainFrame" border="0" frameborder="0" scrolling="no" style="width:100%;" height="600" src="'.$file_url_web.'&rand='.mt_rand(1, 10000).'" height="500" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>'; |
| 456 | + echo '<iframe id="mainFrame" name="mainFrame" border="0" frameborder="0" scrolling="no" style="width:100%;" height="600" src="'.$file_url_web.'&rand='.mt_rand(1, 10000).'" height="500" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>'; |
446 | 457 | }
|
447 | 458 | }
|
448 | 459 | Display::display_footer();
|
0 commit comments