本文整理汇总了PHP中DocumentManager::generate_jplayer_jquery方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentManager::generate_jplayer_jquery方法的具体用法?PHP DocumentManager::generate_jplayer_jquery怎么用?PHP DocumentManager::generate_jplayer_jquery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentManager
的用法示例。
在下文中一共展示了DocumentManager::generate_jplayer_jquery方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: api_get_course_id
}
//@todo use a js loop to auto generate this code
if (in_array($extension, array('ogg', 'mp3', 'wav'))) {
// Get the document data from the ID
$document_data = DocumentManager::get_document_data_by_id($file['id'], api_get_course_id(), false, $sessionId);
if ($sessionId != 0 && !$document_data) {
/* If there is a session defined and asking for the document
* from the session* didn't work, try it from the
course (out of a session context) */
$document_data = DocumentManager::get_document_data_by_id($file['id'], api_get_course_id(), false, 0);
}
if ($extension == 'ogg') {
$extension = 'oga';
}
$params = array('url' => $document_data['direct_url'], 'extension' => $extension, 'count' => $count);
$jquery .= DocumentManager::generate_jplayer_jquery($params);
$count++;
}
}
}
}
$htmlHeadXtra[] = '<script>
$(document).ready( function() {
//Experimental changes to preview mp3, ogg files
' . $jquery . '
});
</script>';
// Lib for event log, stats & tracking & record of the access
Event::event_access_tool(TOOL_DOCUMENT);
/* DISPLAY */
if ($groupId != 0) {
示例2: show_audio_file
/**
* Show the audio file + a button to download
* @param bool
*/
public function show_audio_file($show_delete_button = false)
{
$html = '';
$file_path = $this->load_filename_if_exists();
if (!empty($file_path)) {
$url = $this->get_public_url(true);
$actions = Display::url(Display::return_icon('save.png', get_lang('Download'), array(), ICON_SIZE_SMALL), $url, array('target' => '_blank'));
$download_button = Display::url(get_lang('Download'), $url, array('class' => 'btn'));
if ($show_delete_button) {
$actions .= ' ' . Display::url(Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL), "#", array('onclick' => 'delete_file();'));
}
$basename = basename($file_path);
$path_info = pathinfo($basename);
if ($path_info['extension'] == 'wav') {
$html .= '<script>
$(document).ready( function() {
var java_enabled = navigator.javaEnabled();
if (java_enabled) {
$("#nanogong_warning").hide();
$("#nanogong_player_id").show();
} else {
$("#nanogong_warning").show();
$("#nanogong_player_id").hide();
}
});
</script>';
$html .= '<div id="nanogong_player_id" class="nanogong_player_container">';
$html .= '<div class="action_player">' . $actions . '</div>';
$html .= '<div class="nanogong_player">';
$html .= '<applet id="nanogong_player" archive="' . api_get_path(WEB_LIBRARY_PATH) . 'nanogong/nanogong.jar" code="gong.NanoGong" width="250" height="40" ALIGN="middle">';
$html .= '<param name="ShowRecordButton" value="false" />';
// default true
$html .= '<param name="ShowSaveButton" value="false" />';
//you can save in local computer | (default true)
//echo '<param name="ShowAudioLevel" value="false" />'; // it displays the audiometer | (default true)
$html .= '<param name="ShowTime" value="true" />';
// default false
$html .= '<param name="Color" value="#FFFFFF" />';
$html .= '<param name="ShowSpeedButton" value="false" />';
//echo '<param name="StartTime" value="10.5" />';
//echo '<param name="EndTime" value="65" />';
$html .= '<param name="AudioFormat" value="ImaADPCM" />';
// ImaADPCM (more speed), Speex (more compression)|(default Speex)
//$html .= '<param name="AudioFormat" value="Speex" />';// ImaADPCM (more speed), Speex (more compression)|(default Speex)
//Quality for ImaADPCM (low 8000, medium 11025, normal 22050, hight 44100) OR Quality for Speex (low 8000, medium 16000, normal 32000, hight 44100) | (default 44100)
//echo '<param name="SamplingRate" value="32000" />';
//echo '<param name="MaxDuration" value="60" />';
$html .= '<param name="SoundFileURL" value="' . $url . '" />';
//load a file |(default "")
$html .= '</applet>';
$html .= '</div>';
$html .= '</div>';
$html .= '<div id="nanogong_warning">' . Display::return_message(get_lang('BrowserDoesNotSupportNanogongPlayer'), 'warning') . $download_button . '</div>';
} elseif (in_array($path_info['extension'], array('mp3', 'ogg', 'wav'))) {
$js_path = api_get_path(WEB_LIBRARY_JS_PATH);
$html .= '<link rel="stylesheet" href="' . $js_path . 'jquery-jplayer/skins/blue/jplayer.blue.monday.css" type="text/css">';
//$html .= '<link rel="stylesheet" href="' . $js_path . 'jquery-jplayer/skins/chamilo/jplayer.blue.monday.css" type="text/css">';
$html .= '<script type="text/javascript" src="' . $js_path . 'jquery-jplayer/jquery.jplayer.min.js"></script>';
$html .= '<div class="nanogong_player"></div>';
$html .= '<br /><div class="action_player">' . $actions . '</div><br /><br /><br />';
$params = array('url' => $url, 'extension' => $path_info['extension'], 'count' => 1);
$jquery = DocumentManager::generate_jplayer_jquery($params);
$html .= '<script>
$(document).ready( function() {
//Experimental changes to preview mp3, ogg files
' . $jquery . '
});
</script>';
$html .= DocumentManager::generate_media_preview(1, 'advanced');
}
}
return $html;
}