Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
28f1d885f2
|
@ -11,16 +11,7 @@ require_once __DIR__."/configs/constants.php";
|
|||
require_once __DIR__."/configs/conf.php";
|
||||
require_once 'DB.php';
|
||||
|
||||
require_once 'Soundcloud.php';
|
||||
//require_once 'MusicDir.php';
|
||||
//require_once 'Playlist.php';
|
||||
//require_once 'StoredFile.php';
|
||||
//require_once 'Schedule.php';
|
||||
require_once 'Preference.php';
|
||||
//require_once 'Shows.php';
|
||||
//require_once 'User.php';
|
||||
require_once 'RabbitMq.php';
|
||||
require_once 'DateHelper.php';
|
||||
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
||||
|
||||
global $CC_CONFIG, $CC_DBC;
|
||||
|
|
|
@ -158,7 +158,7 @@ class ApiController extends Zend_Controller_Action
|
|||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timeNow = $date->getTimestamp();
|
||||
$result = array("env"=>APPLICATION_ENV,
|
||||
"schedulerTime"=>gmdate("Y-m-d H:i:s"),
|
||||
|
@ -400,7 +400,7 @@ class ApiController extends Zend_Controller_Action
|
|||
$tags = array_merge($hosts, array($show_name));
|
||||
|
||||
try {
|
||||
$soundcloud = new ATSoundcloud();
|
||||
$soundcloud = new Application_Model_AtSoundcloud();
|
||||
$soundcloud_id = $soundcloud->uploadTrack($file->getFilePath(), $tmpTitle, $description, $tags, $show_start_time, $show_genre);
|
||||
$file->setSoundCloudFileId($soundcloud_id);
|
||||
break;
|
||||
|
@ -673,7 +673,6 @@ class ApiController extends Zend_Controller_Action
|
|||
"platform"=>Application_Model_Systemstatus::GetPlatformInfo(),
|
||||
"airtime_version"=>Application_Model_Preference::GetAirtimeVersion(),
|
||||
"services"=>array(
|
||||
"icecast2"=>Application_Model_Systemstatus::GetIcecastStatus(),
|
||||
"rabbitmq"=>Application_Model_Systemstatus::GetRabbitMqStatus(),
|
||||
"pypo"=>Application_Model_Systemstatus::GetPypoStatus(),
|
||||
"liquidsoap"=>Application_Model_Systemstatus::GetLiquidsoapStatus(),
|
||||
|
|
|
@ -164,7 +164,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
else {
|
||||
$res = settype($res, "integer");
|
||||
$data = array("filepath" => $file->getFilePath(), "delete" => $res);
|
||||
RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
|
||||
$data = $file->getMetadata();
|
||||
|
||||
RabbitMq::SendMessageToMediaMonitor("md_update", $data);
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("md_update", $data);
|
||||
|
||||
$this->_helper->redirector('index');
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_StreamSetting::setStreamSetting($values);
|
||||
$data = array();
|
||||
$data['setting'] = Application_Model_StreamSetting::getStreamSetting();
|
||||
RabbitMq::SendMessageToPypo("update_stream_setting", $data);
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
|
||||
$this->view->statusMsg = "<div class='success'>Stream Setting Updated.</div>";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,8 +152,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
$params = '/format/json/id/#id#';
|
||||
|
||||
$showStartDateHelper = DateHelper::ConvertToLocalDateTime($show->getShowStart());
|
||||
$showEndDateHelper = DateHelper::ConvertToLocalDateTime($show->getShowEnd());
|
||||
$showStartDateHelper = Application_Model_DateHelper::ConvertToLocalDateTime($show->getShowStart());
|
||||
$showEndDateHelper = Application_Model_DateHelper::ConvertToLocalDateTime($show->getShowEnd());
|
||||
|
||||
if ($epochNow < $showStartDateHelper->getTimestamp()) {
|
||||
|
||||
|
@ -461,7 +461,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$i = 1;
|
||||
foreach ($rebroadcastsRelative as $rebroadcast){
|
||||
$rebroadcastFormValues["add_show_rebroadcast_date_$i"] = $rebroadcast['day_offset'];
|
||||
$rebroadcastFormValues["add_show_rebroadcast_time_$i"] = DateHelper::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$rebroadcastFormValues["add_show_rebroadcast_time_$i"] = Application_Model_DateHelper::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$i++;
|
||||
}
|
||||
$formRebroadcast->populate($rebroadcastFormValues);
|
||||
|
@ -471,7 +471,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$i = 1;
|
||||
foreach ($rebroadcastsAbsolute as $rebroadcast){
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date'];
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = DateHelper::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = Application_Model_DateHelper::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$i++;
|
||||
}
|
||||
$formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues);
|
||||
|
@ -700,7 +700,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$show->clearShow();
|
||||
$show->deleteShow();
|
||||
// send 'cancel-current-show' command to pypo
|
||||
RabbitMq::SendMessageToPypo("cancel_current_show", array());
|
||||
Application_Model_RabbitMq::SendMessageToPypo("cancel_current_show", array());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,7 @@ class SystemstatusController extends Zend_Controller_Action
|
|||
"liquidsoap"=>Application_Model_Systemstatus::GetLiquidsoapStatus(),
|
||||
"show-recorder"=>Application_Model_Systemstatus::GetShowRecorderStatus(),
|
||||
"media-monitor"=>Application_Model_Systemstatus::GetMediaMonitorStatus(),
|
||||
"rabbitmq-server"=>Application_Model_Systemstatus::GetRabbitMqStatus(),
|
||||
"icecast2"=>Application_Model_Systemstatus::GetIcecastStatus()
|
||||
"rabbitmq-server"=>Application_Model_Systemstatus::GetRabbitMqStatus()
|
||||
);
|
||||
|
||||
$partitions = Application_Model_Systemstatus::GetDiskInfo();
|
||||
|
@ -27,7 +26,6 @@ class SystemstatusController extends Zend_Controller_Action
|
|||
$this->view->status = new StdClass;
|
||||
$this->view->status->services = $services;
|
||||
$this->view->status->partitions = $partitions;
|
||||
|
||||
}
|
||||
|
||||
public function getLogFileAction()
|
||||
|
|
|
@ -4,10 +4,10 @@ class RabbitMqPlugin extends Zend_Controller_Plugin_Abstract
|
|||
{
|
||||
public function dispatchLoopShutdown()
|
||||
{
|
||||
if (RabbitMq::$doPush) {
|
||||
if (Application_Model_RabbitMq::$doPush) {
|
||||
$md = array('schedule' => Application_Model_Schedule::GetScheduledPlaylists());
|
||||
RabbitMq::SendMessageToPypo("update_schedule", $md);
|
||||
RabbitMq::SendMessageToShowRecorder("update_schedule");
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
|
||||
Application_Model_RabbitMq::SendMessageToShowRecorder("update_schedule");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class DateHelper
|
||||
class Application_Model_DateHelper
|
||||
{
|
||||
private $_dateTime;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class Application_Model_MusicDir {
|
|||
$temp_show->updateScheduledTime();
|
||||
}
|
||||
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -184,7 +184,7 @@ class Application_Model_MusicDir {
|
|||
|
||||
$data = array();
|
||||
$data["directory"] = $p_path;
|
||||
RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ class Application_Model_MusicDir {
|
|||
$data = array();
|
||||
$data["directory"] = $p_dir;
|
||||
$data["dir_id"] = $dirId;
|
||||
RabbitMq::SendMessageToMediaMonitor("change_stor", $data);
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("change_stor", $data);
|
||||
return array("code"=>0);
|
||||
}else{
|
||||
return array("code"=>1, "error"=>"'$p_dir' is already set as the current storage dir or in the watched folders list.");
|
||||
|
@ -292,7 +292,7 @@ class Application_Model_MusicDir {
|
|||
$dir->remove();
|
||||
$data = array();
|
||||
$data["directory"] = $p_dir;
|
||||
RabbitMq::SendMessageToMediaMonitor("remove_watch", $data);
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("remove_watch", $data);
|
||||
return array("code"=>0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,10 +14,10 @@ class Application_Model_Nowplaying
|
|||
|
||||
foreach ($p_dbRows as $dbRow){
|
||||
|
||||
$showStartDateTime = DateHelper::ConvertToLocalDateTime($dbRow['show_starts']);
|
||||
$showEndDateTime = DateHelper::ConvertToLocalDateTime($dbRow['show_ends']);
|
||||
$itemStartDateTime = DateHelper::ConvertToLocalDateTime($dbRow['item_starts']);
|
||||
$itemEndDateTime = DateHelper::ConvertToLocalDateTime($dbRow['item_ends']);
|
||||
$showStartDateTime = Application_Model_DateHelper::ConvertToLocalDateTime($dbRow['show_starts']);
|
||||
$showEndDateTime = Application_Model_DateHelper::ConvertToLocalDateTime($dbRow['show_ends']);
|
||||
$itemStartDateTime = Application_Model_DateHelper::ConvertToLocalDateTime($dbRow['item_starts']);
|
||||
$itemEndDateTime = Application_Model_DateHelper::ConvertToLocalDateTime($dbRow['item_ends']);
|
||||
|
||||
$showStarts = $showStartDateTime->format("Y-m-d H:i:s");
|
||||
$showEnds = $showEndDateTime->format("Y-m-d H:i:s");
|
||||
|
@ -61,7 +61,7 @@ class Application_Model_Nowplaying
|
|||
$startCutoff = 60;
|
||||
$endCutoff = 86400; //60*60*24 - seconds in a day
|
||||
} else {
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$time = $date->getTime();
|
||||
$date->setDate($dateString." ".$time);
|
||||
$timeNow = $date->getUtcTimestamp();
|
||||
|
@ -81,8 +81,8 @@ class Application_Model_Nowplaying
|
|||
$showId = $si->getShowId();
|
||||
$show = new Application_Model_Show($showId);
|
||||
|
||||
$showStartDateTime = DateHelper::ConvertToLocalDateTime($si->getShowStart());
|
||||
$showEndDateTime = DateHelper::ConvertToLocalDateTime($si->getShowEnd());
|
||||
$showStartDateTime = Application_Model_DateHelper::ConvertToLocalDateTime($si->getShowStart());
|
||||
$showEndDateTime = Application_Model_DateHelper::ConvertToLocalDateTime($si->getShowEnd());
|
||||
|
||||
//append show header row
|
||||
$data[] = self::CreateHeaderRow($show->getName(), $showStartDateTime->format("Y-m-d H:i:s"), $showEndDateTime->format("Y-m-d H:i:s"));
|
||||
|
|
|
@ -81,7 +81,7 @@ class Application_Model_Preference
|
|||
self::SetValue("station_name", $title);
|
||||
$defaultNamespace = new Zend_Session_Namespace('title_name');
|
||||
$defaultNamespace->title = $title;
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
|
||||
//set session variable to new station name so that html title is updated.
|
||||
//should probably do this in a view helper to keep this controller as minimal as possible.
|
||||
|
@ -107,7 +107,7 @@ class Application_Model_Preference
|
|||
|
||||
public static function SetStreamLabelFormat($type){
|
||||
self::SetValue("stream_label_format", $type);
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
public static function GetStreamLabelFormat(){
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
require_once 'php-amqplib/amqp.inc';
|
||||
|
||||
class RabbitMq
|
||||
class Application_Model_RabbitMq
|
||||
{
|
||||
static public $doPush = FALSE;
|
||||
|
||||
|
@ -9,7 +9,7 @@ class RabbitMq
|
|||
* Sets a flag to push the schedule at the end of the request.
|
||||
*/
|
||||
public static function PushSchedule() {
|
||||
RabbitMq::$doPush = TRUE;
|
||||
Application_Model_RabbitMq::$doPush = TRUE;
|
||||
}
|
||||
|
||||
public static function SendMessageToPypo($event_type, $md)
|
||||
|
|
|
@ -143,7 +143,7 @@ class Application_Model_Schedule {
|
|||
|
||||
global $CC_CONFIG;
|
||||
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timeNow = $date->getUtcTimestamp();
|
||||
return array("env"=>APPLICATION_ENV,
|
||||
"schedulerTime"=>$timeNow,
|
||||
|
@ -499,8 +499,8 @@ class Application_Model_Schedule {
|
|||
'fade_in' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_in"]),
|
||||
'fade_out' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_out"]),
|
||||
'fade_cross' => 0,
|
||||
'cue_in' => DateHelper::CalculateLengthInSeconds($item["cue_in"]),
|
||||
'cue_out' => DateHelper::CalculateLengthInSeconds($item["cue_out"]),
|
||||
'cue_in' => Application_Model_DateHelper::CalculateLengthInSeconds($item["cue_in"]),
|
||||
'cue_out' => Application_Model_DateHelper::CalculateLengthInSeconds($item["cue_out"]),
|
||||
'export_source' => 'scheduler',
|
||||
'start' => $starts,
|
||||
'end' => Application_Model_Schedule::AirtimeTimeToPypoTime($item["ends"])
|
||||
|
|
|
@ -116,7 +116,7 @@ class Application_Model_ScheduleGroup {
|
|||
}
|
||||
}
|
||||
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
return $this->groupId;
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ class Application_Model_ScheduleGroup {
|
|||
." WHERE group_id = ".$this->groupId;
|
||||
//echo $sql;
|
||||
$retVal = $CC_DBC->query($sql);
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
return $retVal;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class Application_Model_Show {
|
|||
{
|
||||
$show = CcShowQuery::create()->findPK($this->_showId);
|
||||
$show->setDbName($name);
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
|
@ -119,7 +119,7 @@ class Application_Model_Show {
|
|||
WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}";
|
||||
|
||||
$CC_DBC->query($sql);
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -137,7 +137,7 @@ class Application_Model_Show {
|
|||
$uncheckedDaysImploded = implode(",", $p_uncheckedDays);
|
||||
$showId = $this->getId();
|
||||
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timestamp = $date->getTimestamp();
|
||||
|
||||
$sql = "DELETE FROM cc_show_instances"
|
||||
|
@ -302,7 +302,7 @@ class Application_Model_Show {
|
|||
public function deleteAllInstances(){
|
||||
global $CC_DBC;
|
||||
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timestamp = $date->getTimestamp();
|
||||
|
||||
$showId = $this->getId();
|
||||
|
@ -321,7 +321,7 @@ class Application_Model_Show {
|
|||
public function deleteAllRebroadcasts(){
|
||||
global $CC_DBC;
|
||||
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timestamp = $date->getTimestamp();
|
||||
|
||||
$showId = $this->getId();
|
||||
|
@ -343,11 +343,11 @@ class Application_Model_Show {
|
|||
public function removeAllInstancesFromDate($p_date=null){
|
||||
global $CC_DBC;
|
||||
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timestamp = $date->getTimestamp();
|
||||
|
||||
if(is_null($p_date)) {
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$p_date = $date->getDate();
|
||||
}
|
||||
|
||||
|
@ -377,7 +377,7 @@ class Application_Model_Show {
|
|||
public function removeAllInstancesBeforeDate($p_date){
|
||||
global $CC_DBC;
|
||||
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timestamp = $date->getTimestamp();
|
||||
|
||||
$showId = $this->getId();
|
||||
|
@ -481,7 +481,7 @@ class Application_Model_Show {
|
|||
* true if the StartDate is in the past, false otherwise
|
||||
*/
|
||||
public function isStartDateTimeInPast(){
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$current_timestamp = $date->getTimestamp();
|
||||
return ($current_timestamp > $this->getStartDate()." ".$this->getStartTime());
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ class Application_Model_Show {
|
|||
public function getAllFutureInstanceIds(){
|
||||
global $CC_DBC;
|
||||
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timestamp = $date->getTimestamp();
|
||||
|
||||
$showId = $this->getId();
|
||||
|
@ -517,7 +517,7 @@ class Application_Model_Show {
|
|||
|
||||
global $CC_DBC;
|
||||
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timestamp = $date->getTimestamp();
|
||||
|
||||
$sql = "UPDATE cc_show_days "
|
||||
|
@ -538,7 +538,7 @@ class Application_Model_Show {
|
|||
|
||||
global $CC_DBC;
|
||||
|
||||
$date = new DateHelper;
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timestamp = $date->getTimestamp();
|
||||
|
||||
$sql = "UPDATE cc_show_days "
|
||||
|
@ -871,7 +871,7 @@ class Application_Model_Show {
|
|||
}
|
||||
|
||||
Application_Model_Show::populateShowUntil($showId);
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
return $showId;
|
||||
}
|
||||
|
||||
|
@ -955,7 +955,7 @@ class Application_Model_Show {
|
|||
$sql = "SELECT timestamp '{$start}' + interval '{$duration}'";
|
||||
$end = $CC_DBC->GetOne($sql);
|
||||
|
||||
$date = new DateHelper();
|
||||
$date = new Application_Model_DateHelper();
|
||||
$currentTimestamp = $date->getTimestamp();
|
||||
|
||||
$show = new Application_Model_Show($show_id);
|
||||
|
@ -1008,7 +1008,7 @@ class Application_Model_Show {
|
|||
}
|
||||
}
|
||||
}
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
//for a show with repeat_type == 0,1,2
|
||||
|
@ -1028,7 +1028,7 @@ class Application_Model_Show {
|
|||
$rebroadcasts = $CC_DBC->GetAll($sql);
|
||||
$show = new Application_Model_Show($show_id);
|
||||
|
||||
$date = new DateHelper();
|
||||
$date = new Application_Model_DateHelper();
|
||||
$currentTimestamp = $date->getTimestamp();
|
||||
|
||||
while(strtotime($next_date) <= strtotime($end_timestamp) && (strtotime($last_show) > strtotime($next_date) || is_null($last_show))) {
|
||||
|
@ -1091,7 +1091,7 @@ class Application_Model_Show {
|
|||
}
|
||||
|
||||
Application_Model_Show::setNextPop($next_date, $show_id, $day);
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
private static function populateShow($repeatType, $show_id, $next_pop_date,
|
||||
|
|
|
@ -111,14 +111,14 @@ class Application_Model_ShowInstance {
|
|||
{
|
||||
$this->_showInstance->setDbStarts($start)
|
||||
->save();
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
public function setShowEnd($end)
|
||||
{
|
||||
$this->_showInstance->setDbEnds($end)
|
||||
->save();
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
public function updateScheduledTime()
|
||||
|
@ -153,7 +153,7 @@ class Application_Model_ShowInstance {
|
|||
$CC_DBC->query($sql);
|
||||
}
|
||||
}
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
public function moveShow($deltaDay, $deltaMin)
|
||||
|
@ -219,7 +219,7 @@ class Application_Model_ShowInstance {
|
|||
$show->setShowLastShow($new_ends);
|
||||
}
|
||||
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
public function resizeShow($deltaDay, $deltaMin)
|
||||
|
@ -263,7 +263,7 @@ class Application_Model_ShowInstance {
|
|||
}
|
||||
|
||||
$this->setShowEnd($new_ends);
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -295,7 +295,7 @@ class Application_Model_ShowInstance {
|
|||
else {
|
||||
$groupId = $sched->addPlaylistAfter($this->_instanceId, $lastGroupId, $plId);
|
||||
}
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
$this->updateScheduledTime();
|
||||
}
|
||||
|
||||
|
@ -315,7 +315,7 @@ class Application_Model_ShowInstance {
|
|||
else {
|
||||
$groupId = $sched->addFileAfter($this->_instanceId, $lastGroupId, $file_id);
|
||||
}
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
$this->updateScheduledTime();
|
||||
}
|
||||
|
||||
|
@ -351,7 +351,7 @@ class Application_Model_ShowInstance {
|
|||
WHERE starts >= '{$groupBoundry["end_timestamp"]}' AND instance_id = {$this->_instanceId}";
|
||||
|
||||
$CC_DBC->query($sql);
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
$this->updateScheduledTime();
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ class Application_Model_ShowInstance {
|
|||
CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($this->_instanceId)
|
||||
->delete();
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
$this->updateScheduledTime();
|
||||
}
|
||||
|
||||
|
@ -373,9 +373,9 @@ class Application_Model_ShowInstance {
|
|||
CcShowInstancesQuery::create()
|
||||
->findPK($this->_instanceId)
|
||||
->delete();
|
||||
RabbitMq::PushSchedule();
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
if($recording){
|
||||
RabbitMq::SendMessageToShowRecorder("cancel_recording");
|
||||
Application_Model_RabbitMq::SendMessageToShowRecorder("cancel_recording");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require_once 'soundcloud-api/Services/Soundcloud.php';
|
||||
|
||||
class ATSoundcloud {
|
||||
class Application_Model_AtSoundcloud {
|
||||
|
||||
private $_soundcloud;
|
||||
|
||||
|
|
|
@ -945,7 +945,7 @@ class Application_Model_StoredFile {
|
|||
$release = $file->getDbYear();
|
||||
|
||||
try {
|
||||
$soundcloud = new ATSoundcloud();
|
||||
$soundcloud = new Application_Model_AtSoundcloud();
|
||||
$soundcloud_id = $soundcloud->uploadTrack($this->getFilePath(), $this->getName(), $description, $tag, $release, $genre);
|
||||
$this->setSoundCloudFileId($soundcloud_id);
|
||||
break;
|
||||
|
|
|
@ -1,7 +1,43 @@
|
|||
<?php
|
||||
class Application_Model_StreamSetting {
|
||||
public function __construct(){
|
||||
|
||||
|
||||
/* Returns the id's of all streams that are enabled in an array. An
|
||||
* example of the array returned in JSON notation is ["s1", "s2", "s3"] */
|
||||
public static function getEnabledStreamIds(){
|
||||
global $CC_DBC;
|
||||
$sql = "SELECT * "
|
||||
."FROM cc_stream_setting "
|
||||
."WHERE keyname LIKE '%_output' "
|
||||
."AND value != 'disabled'";
|
||||
|
||||
$rows = $CC_DBC->getAll($sql);
|
||||
$ids = array();
|
||||
|
||||
foreach ($rows as $row){
|
||||
$ids[] = substr($row["keyname"], 0, strpos($row["keyname"], "_"));
|
||||
}
|
||||
|
||||
//Logging::log(print_r($ids, true));
|
||||
|
||||
return $ids;
|
||||
}
|
||||
|
||||
/* Returns all information related to a specific stream. An example
|
||||
* of a stream id is 's1' or 's2'. */
|
||||
public static function getStreamData($p_streamId){
|
||||
global $CC_DBC;
|
||||
$sql = "SELECT * "
|
||||
."FROM cc_stream_setting "
|
||||
."WHERE keyname LIKE '${p_streamId}_%'";
|
||||
|
||||
$rows = $CC_DBC->getAll($sql);
|
||||
$data = array();
|
||||
|
||||
foreach($rows as $row){
|
||||
$data[$row["keyname"]] = $row["value"];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getStreamSetting(){
|
||||
|
@ -12,6 +48,7 @@ class Application_Model_StreamSetting {
|
|||
$rows = $CC_DBC->getAll($sql);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public static function setStreamSetting($data){
|
||||
global $CC_DBC;
|
||||
foreach($data as $key=>$d){
|
||||
|
@ -37,4 +74,4 @@ class Application_Model_StreamSetting {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,9 +97,9 @@ while ($showTime < $endDate) {
|
|||
$showNumber = $showNumber + 1;
|
||||
}
|
||||
|
||||
if (RabbitMq::$doPush) {
|
||||
if (Application_Model_RabbitMq::$doPush) {
|
||||
$md = array('schedule' => Application_Model_Schedule::GetScheduledPlaylists());
|
||||
RabbitMq::SendMessageToPypo("update_schedule", $md);
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,34 +1,83 @@
|
|||
<div id="content" class="jp-container">
|
||||
<?php $ids = Application_Model_StreamSetting::getEnabledStreamIds(); ?>
|
||||
<script>
|
||||
function setjPlayer(url, type){
|
||||
var obj = new Object();
|
||||
obj[type] = url;
|
||||
|
||||
$("#jquery_jplayer_1").jPlayer("destroy");
|
||||
$("#jquery_jplayer_1").jPlayer({
|
||||
ready: function () {
|
||||
$(this).jPlayer("setMedia", obj).jPlayer("play");
|
||||
},
|
||||
ended: function (event) {
|
||||
$(this).jPlayer("play");
|
||||
},
|
||||
swfPath: "js",
|
||||
supplied: type,
|
||||
wmode: "window"
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$("#jquery_jplayer_1").jPlayer({
|
||||
ready: function () {
|
||||
$(this).jPlayer("setMedia", {
|
||||
oga: "http://localhost:8000/airtime_128"
|
||||
}).jPlayer("play");
|
||||
},
|
||||
ended: function (event) {
|
||||
$(this).jPlayer("play");
|
||||
},
|
||||
swfPath: "js",
|
||||
supplied: "oga"
|
||||
});
|
||||
$('.bit-rates').click(function(eventObject){
|
||||
var elem = $(eventObject.target);
|
||||
|
||||
setjPlayer(elem.attr("data-url"), elem.attr("data-type"));
|
||||
});
|
||||
|
||||
<?php
|
||||
if (count($ids) > 0){
|
||||
$id = $ids[0];
|
||||
$streamData = Application_Model_StreamSetting::getStreamData($id);
|
||||
$url = "http://".$streamData["${id}_host"].":".$streamData["${id}_port"]."/".$streamData["${id}_mount"];
|
||||
$type = $streamData["${id}_type"];
|
||||
if ($type == "ogg")
|
||||
$type = "oga";
|
||||
echo "setjPlayer('$url', '$type');";
|
||||
}
|
||||
?>
|
||||
});
|
||||
</script>
|
||||
<div class="jp-logo"></div>
|
||||
<div class="jp-stream">
|
||||
<div class="jp-stream-text">Select stream:</div>
|
||||
<form id="form1" method="post" action="">
|
||||
|
||||
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
|
||||
<?php
|
||||
$i=0;
|
||||
foreach($ids as $id):
|
||||
$streamData = Application_Model_StreamSetting::getStreamData($id);
|
||||
Logging::log("id: ".print_r($streamData, true));
|
||||
|
||||
<div class="jp-audio">
|
||||
<div class="jp-type-single">
|
||||
<div id="jp_interface_1" class="jp-interface">
|
||||
<ul class="jp-controls">
|
||||
<li><a href="#" class="jp-play" tabindex="1">play</a></li>
|
||||
<li><a href="#" class="jp-pause" tabindex="1">pause</a></li>
|
||||
<li><a href="#" class="jp-mute" tabindex="1">mute</a></li>
|
||||
<li><a href="#" class="jp-unmute" tabindex="1">unmute</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="jp_playlist_1" class="jp-playlist">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
$url = "http://".$streamData["${id}_host"].":".$streamData["${id}_port"]."/".$streamData["${id}_mount"];
|
||||
$type = $streamData["${id}_type"];
|
||||
|
||||
if ($type == "ogg")
|
||||
$type = "oga";
|
||||
?>
|
||||
<label>
|
||||
<input class='bit-rates' type="radio" name="select-stream" value="radio" data-url="<?php echo $url ?>" data-type="<?php echo $type ?>" id="select-stream_<?php echo $id ?>" <?php echo $i==0 ? "checked=\"checked\"": ""; ?>/>
|
||||
<?php echo "Stream ".substr($id, 1)." (".$streamData["${id}_bitrate"]; ?> Kbit/s)</label>
|
||||
<?php $i++; endforeach; ?>
|
||||
</form>
|
||||
</div>
|
||||
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
|
||||
|
||||
<div id="jp_container_1" class="jp-audio">
|
||||
<div class="jp-type-single">
|
||||
<div id="jp_interface_1" class="jp-gui jp-interface">
|
||||
<ul class="jp-controls">
|
||||
<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
|
||||
<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
|
||||
<li><a href="javascript:;" class="jp-mute" tabindex="1">mute</a></li>
|
||||
<li><a href="javascript:;" class="jp-unmute" tabindex="1">unmute</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="jp_playlist_1" class="jp-playlist">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
margin: 0;
|
||||
padding: 4px 0;
|
||||
text-align: left;
|
||||
min-width:100px;
|
||||
min-width:103px;
|
||||
clear:left;
|
||||
}
|
||||
#schedule-add-show dt.big {
|
||||
|
@ -94,7 +94,7 @@ label.wrapp-label input[type="checkbox"] {
|
|||
margin-right:5px;
|
||||
}
|
||||
#add_show_name-element .input_text {
|
||||
width:99%;
|
||||
/*width:99%;*/
|
||||
}
|
||||
|
||||
#schedule-add-show-overlap {
|
||||
|
@ -113,12 +113,13 @@ label.wrapp-label input[type="checkbox"] {
|
|||
}
|
||||
|
||||
#add_show_start_time, #add_show_end_time {
|
||||
width: 60px;
|
||||
width: 54px;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
#add_show_end_date_no_repeat, #add_show_start_date {
|
||||
width: 95px;
|
||||
width: 89px;
|
||||
|
||||
}
|
||||
|
||||
#add_show_duration {
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
|
@ -456,7 +456,7 @@ dl.inline-list dd {
|
|||
background-color: #95d5f7 !important;
|
||||
}
|
||||
|
||||
.datatable tr td:first-child, .datatable tr th:first-child, .datatable tr th.ui-state-default:first-child, tr td:first-child, tr th:first-child {
|
||||
.datatable tr td:first-child, .datatable tr th:first-child, .datatable tr th.ui-state-default:first-child {
|
||||
border-left-width:0 !important;
|
||||
}
|
||||
.ui-widget-header + .datatable {
|
||||
|
@ -1057,7 +1057,7 @@ h2#scheduled_playlist_name span {
|
|||
}
|
||||
|
||||
.stream-setting-content dd.block-display {
|
||||
width: 60%;
|
||||
/*width: 60%;*/
|
||||
}
|
||||
|
||||
.simple-formblock.padded-strong {
|
||||
|
@ -1566,9 +1566,6 @@ div.success{
|
|||
background:url(images/icon_soundcloud.png) no-repeat 0 0;
|
||||
width:21px;
|
||||
}
|
||||
.small-icon.sc-error {
|
||||
background:url(images/icon_soundcloud_error2.png) no-repeat 0 0;
|
||||
}
|
||||
.small-icon.progress {
|
||||
background:url(images/upload-icon.gif) no-repeat;
|
||||
background-color:black;
|
||||
|
@ -1658,8 +1655,10 @@ dd.radio-inline-list, .preferences dd.radio-inline-list, .stream-config dd.radio
|
|||
.preferences dd.block-display .input_select, .stream-config dd.block-display .input_select {
|
||||
width: 100%;
|
||||
}
|
||||
.preferences dd.block-display .input_text_area, .preferences dd.block-display .input_text {
|
||||
width: 99.5%;
|
||||
.preferences dd.block-display .input_text_area, .preferences dd.block-display .input_text
|
||||
.stream-config dd.block-display .input_text_area, .stream-config dd.block-display .input_text,
|
||||
.stream-config dd.block-display input[type="text"], .stream-config dd.block-display input[type="password"] {
|
||||
width: 98.5%;
|
||||
}
|
||||
|
||||
.preferences dd#SoundCloudTags-element.block-display .input_text_area {
|
||||
|
@ -1935,12 +1934,13 @@ dd .info-text-small {
|
|||
line-height:140%;
|
||||
}
|
||||
|
||||
.stream-config dd input {
|
||||
width:300px;
|
||||
.stream-config dd input[type="text"] {
|
||||
/*width:98.5%;*/
|
||||
min-width:152px;
|
||||
}
|
||||
|
||||
.stream-config dd input[id$=port] {
|
||||
width:160px;
|
||||
width:152px;
|
||||
}
|
||||
|
||||
dt.block-display.info-block {
|
||||
|
@ -1979,7 +1979,7 @@ dt.block-display.info-block {
|
|||
}
|
||||
|
||||
.stream-config dt.block-display, .stream-config dd.block-display {
|
||||
float: left;
|
||||
/*float: left;*/
|
||||
}
|
||||
.collapsible-header-disabled {
|
||||
cursor:default;
|
||||
|
@ -2049,8 +2049,7 @@ dt.block-display.info-block {
|
|||
table {
|
||||
border-color: #5b5b5b;
|
||||
border-style: solid;
|
||||
border-width: 2px 1px 1px 1px;
|
||||
background-color: #D8D8D8;
|
||||
border-width: 0;
|
||||
}
|
||||
tbody tr th {
|
||||
color: #000000;
|
||||
|
@ -2067,7 +2066,7 @@ tbody tr th {
|
|||
}
|
||||
thead tr th {
|
||||
color: #FFFFFF;
|
||||
font-size: 13px;
|
||||
font-size: 12px;
|
||||
padding: 5px 5px;
|
||||
border-color:#CCCCCC;
|
||||
background-color: #6e6e6e;
|
||||
|
@ -2079,8 +2078,8 @@ thead tr th {
|
|||
tr td {
|
||||
border-color: #b1b1b1;
|
||||
border-style: solid;
|
||||
border-width: 1px 0 0 1px;
|
||||
font-size: 13px;
|
||||
border-width: 0;
|
||||
font-size: 12px;
|
||||
padding: 5px 5px;
|
||||
}
|
||||
tfoot tr td, tfoot tr th {
|
||||
|
@ -2101,13 +2100,21 @@ tfoot tr th {
|
|||
|
||||
|
||||
/*---//////////////////// STATUS TABLE ////////////////////---*/
|
||||
|
||||
.statustable tr td {
|
||||
.statustable {
|
||||
background-color: #D8D8D8;
|
||||
border-width: 2px 1px 1px;
|
||||
}
|
||||
.statustable tr td, .statustable tr th {
|
||||
text-align:center;
|
||||
vertical-align:text-top;
|
||||
font-size:13px;
|
||||
}
|
||||
.statustable tr td {
|
||||
border-width: 1px 0 0 1px;
|
||||
}
|
||||
.statustable tr td:first-child, .statustable tr th:first-child {
|
||||
text-align:left;
|
||||
border-left-width: 0 !important;
|
||||
}
|
||||
.checked-icon {
|
||||
width:100%;
|
||||
|
@ -2140,7 +2147,7 @@ tfoot tr th {
|
|||
-moz-border-radius: 4px;
|
||||
font-size:13px;
|
||||
}
|
||||
.big {
|
||||
.statustable .big {
|
||||
width:120px;
|
||||
height:10px;
|
||||
background:#444444;
|
||||
|
@ -2195,3 +2202,94 @@ tfoot tr th {
|
|||
border:none;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
/*---//////////////////// TRIAL BOX HEADER ////////////////////---*/
|
||||
|
||||
.trial-box {
|
||||
width:142px;
|
||||
height:38px;
|
||||
display:block;
|
||||
position:absolute;
|
||||
right:20px;
|
||||
bottom:10px;
|
||||
background-color:#222;
|
||||
background-color:rgba(0, 0, 0, 0.7);
|
||||
z-index:100;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
color:#FFF;
|
||||
font-size:11px;
|
||||
padding:7px;
|
||||
}
|
||||
.trial-box p {
|
||||
padding:0 0 3px 0;
|
||||
margin:0 0 5px 0;
|
||||
float:left;
|
||||
}
|
||||
.trial-box-button a {
|
||||
width:92px;
|
||||
height:14px;
|
||||
display:block;
|
||||
padding: 1px 3px;
|
||||
-moz-border-radius: 1px;
|
||||
-webkit-border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
text-transform:uppercase;
|
||||
text-align:center;
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
font-weight:bold;
|
||||
text-decoration:none;
|
||||
color:#FFFFFF;
|
||||
background-color:#ff5d1a;
|
||||
background: -moz-linear-gradient(top, #ff5d1a 0, #dd4202 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ff5d1a), color-stop(100%, #dd4202));
|
||||
box-shadow: rgba(248, 248, 248, 0.4) 0 1px 1px inset;
|
||||
-moz-box-shadow: rgba(248, 248, 248, 0.4) 0 1px 1px inset;
|
||||
-webkit-box-shadow: rgba(248, 248, 248, 0.4) 0 1px 1px inset;
|
||||
float:left;
|
||||
}
|
||||
.trial-box-button a:hover {
|
||||
background-color:#dd4202;
|
||||
background: -moz-linear-gradient(top, #dd4202 0, #ff5d1a 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #dd4202), color-stop(100%, #ff5d1a));
|
||||
box-shadow: rgba(248, 248, 248, 0.4) 0 1px 1px inset;
|
||||
-moz-box-shadow: rgba(248, 248, 248, 0.4) 0 1px 1px inset;
|
||||
-webkit-box-shadow: rgba(248, 248, 248, 0.4) 0 1px 1px inset;
|
||||
}
|
||||
.trial-box-calendar {
|
||||
float:right;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
}
|
||||
.trial-box-calendar-white {
|
||||
font-size:18px;
|
||||
color:#ff5d1a;
|
||||
background:#FFF;
|
||||
width:36px;
|
||||
height:22px;
|
||||
display:block;
|
||||
-webkit-border-top-right-radius: 1px;
|
||||
-moz-border-radius-topright: 1px;
|
||||
-webkit-border-top-left-radius: 1px;
|
||||
-moz-border-radius-topleft: 1px;
|
||||
}
|
||||
.trial-box-calendar-gray {
|
||||
width:36px;
|
||||
height:14px;
|
||||
display:block;
|
||||
color:#FFF;
|
||||
font-size:11px;
|
||||
padding:1px 0;
|
||||
text-transform:uppercase;
|
||||
background-color:#676767;
|
||||
background: -moz-linear-gradient(top, #7f7f7f 0, #555555 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #7f7f7f), color-stop(100%, #555555));
|
||||
-webkit-border-bottom-right-radius: 1px;
|
||||
-moz-border-radius-bottomright: 1px;
|
||||
-webkit-border-bottom-left-radius: 1px;
|
||||
-moz-border-radius-bottomleft: 1px;
|
||||
box-shadow: rgba(0, 0, 0, 0.4) 0 2px 1px inset;
|
||||
-moz-box-shadow: rgba(0, 0, 0, 0.4) 0 2px 2px inset;
|
||||
-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0 2px 2px inset;
|
||||
}
|
|
@ -259,7 +259,7 @@ function init() {
|
|||
setupQtip();
|
||||
|
||||
$('#on-air-info').click(function() {
|
||||
newwindow=window.open("Dashboard/stream-player", 'name', 'height=200,width=450');
|
||||
newwindow=window.open("Dashboard/stream-player", 'name', 'width=380,height=168');
|
||||
if (window.focus) {newwindow.focus()}
|
||||
return false;
|
||||
});
|
||||
|
|
Binary file not shown.
|
@ -1,78 +1,97 @@
|
|||
/*
|
||||
* jPlayer Plugin for jQuery JavaScript Library
|
||||
* http://www.happyworm.com/jquery/jplayer
|
||||
* http://www.jplayer.org
|
||||
*
|
||||
* Copyright (c) 2009 - 2010 Happyworm Ltd
|
||||
* Copyright (c) 2009 - 2011 Happyworm Ltd
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* - http://www.opensource.org/licenses/mit-license.php
|
||||
* - http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
* Author: Mark J Panaghiston
|
||||
* Version: 2.0.0
|
||||
* Date: 20th December 2010
|
||||
* Version: 2.1.0
|
||||
* Date: 1st September 2011
|
||||
*/
|
||||
|
||||
(function(c,h){c.fn.jPlayer=function(a){var b=typeof a==="string",d=Array.prototype.slice.call(arguments,1),f=this;a=!b&&d.length?c.extend.apply(null,[true,a].concat(d)):a;if(b&&a.charAt(0)==="_")return f;b?this.each(function(){var e=c.data(this,"jPlayer"),g=e&&c.isFunction(e[a])?e[a].apply(e,d):e;if(g!==e&&g!==h){f=g;return false}}):this.each(function(){var e=c.data(this,"jPlayer");if(e){e.option(a||{})._init();e.option(a||{})}else c.data(this,"jPlayer",new c.jPlayer(a,this))});return f};c.jPlayer=
|
||||
function(a,b){if(arguments.length){this.element=c(b);this.options=c.extend(true,{},this.options,a);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()});this._init()}};c.jPlayer.event={ready:"jPlayer_ready",resize:"jPlayer_resize",error:"jPlayer_error",warning:"jPlayer_warning",loadstart:"jPlayer_loadstart",progress:"jPlayer_progress",suspend:"jPlayer_suspend",abort:"jPlayer_abort",emptied:"jPlayer_emptied",stalled:"jPlayer_stalled",play:"jPlayer_play",pause:"jPlayer_pause",loadedmetadata:"jPlayer_loadedmetadata",
|
||||
loadeddata:"jPlayer_loadeddata",waiting:"jPlayer_waiting",playing:"jPlayer_playing",canplay:"jPlayer_canplay",canplaythrough:"jPlayer_canplaythrough",seeking:"jPlayer_seeking",seeked:"jPlayer_seeked",timeupdate:"jPlayer_timeupdate",ended:"jPlayer_ended",ratechange:"jPlayer_ratechange",durationchange:"jPlayer_durationchange",volumechange:"jPlayer_volumechange"};c.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","loadeddata","canplaythrough","ratechange"];c.jPlayer.pause=
|
||||
function(){c.each(c.jPlayer.prototype.instances,function(a,b){b.data("jPlayer").status.srcSet&&b.jPlayer("pause")})};c.jPlayer.timeFormat={showHour:false,showMin:true,showSec:true,padHour:false,padMin:true,padSec:true,sepHour:":",sepMin:":",sepSec:""};c.jPlayer.convertTime=function(a){a=new Date(a*1E3);var b=a.getUTCHours(),d=a.getUTCMinutes();a=a.getUTCSeconds();b=c.jPlayer.timeFormat.padHour&&b<10?"0"+b:b;d=c.jPlayer.timeFormat.padMin&&d<10?"0"+d:d;a=c.jPlayer.timeFormat.padSec&&a<10?"0"+a:a;return(c.jPlayer.timeFormat.showHour?
|
||||
b+c.jPlayer.timeFormat.sepHour:"")+(c.jPlayer.timeFormat.showMin?d+c.jPlayer.timeFormat.sepMin:"")+(c.jPlayer.timeFormat.showSec?a+c.jPlayer.timeFormat.sepSec:"")};c.jPlayer.uaMatch=function(a){a=a.toLowerCase();var b=/(opera)(?:.*version)?[ \/]([\w.]+)/,d=/(msie) ([\w.]+)/,f=/(mozilla)(?:.*? rv:([\w.]+))?/;a=/(webkit)[ \/]([\w.]+)/.exec(a)||b.exec(a)||d.exec(a)||a.indexOf("compatible")<0&&f.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}};c.jPlayer.browser={};var m=c.jPlayer.uaMatch(navigator.userAgent);
|
||||
if(m.browser){c.jPlayer.browser[m.browser]=true;c.jPlayer.browser.version=m.version}c.jPlayer.prototype={count:0,version:{script:"2.0.0",needFlash:"2.0.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",preload:"metadata",volume:0.8,muted:false,backgroundColor:"#000000",cssSelectorAncestor:"#jp_interface_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",
|
||||
volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",currentTime:".jp-current-time",duration:".jp-duration"},idPrefix:"jp",errorAlerts:false,warningAlerts:false},instances:{},status:{src:"",media:{},paused:true,format:{},formatType:"",waitForPlay:true,waitForLoad:true,srcSet:false,video:false,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0},_status:{volume:h,muted:false,width:0,height:0},internal:{ready:false,instance:h,htmlDlyCmdId:h},solution:{html:true,
|
||||
flash:true},format:{mp3:{codec:'audio/mpeg; codecs="mp3"',flashCanPlay:true,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:true,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis"',flashCanPlay:false,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:false,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:false,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:true,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',
|
||||
flashCanPlay:false,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:false,media:"video"}},_init:function(){var a=this;this.element.empty();this.status=c.extend({},this.status,this._status);this.internal=c.extend({},this.internal);this.formats=[];this.solutions=[];this.require={};this.htmlElement={};this.html={};this.html.audio={};this.html.video={};this.flash={};this.css={};this.css.cs={};this.css.jq={};this.status.volume=this._limitValue(this.options.volume,0,1);this.status.muted=
|
||||
this.options.muted;this.status.width=this.element.css("width");this.status.height=this.element.css("height");this.element.css({"background-color":this.options.backgroundColor});c.each(this.options.supplied.toLowerCase().split(","),function(e,g){var i=g.replace(/^\s+|\s+$/g,"");if(a.format[i]){var j=false;c.each(a.formats,function(n,k){if(i===k){j=true;return false}});j||a.formats.push(i)}});c.each(this.options.solution.toLowerCase().split(","),function(e,g){var i=g.replace(/^\s+|\s+$/g,"");if(a.solution[i]){var j=
|
||||
false;c.each(a.solutions,function(n,k){if(i===k){j=true;return false}});j||a.solutions.push(i)}});this.internal.instance="jp_"+this.count;this.instances[this.internal.instance]=this.element;this.element.attr("id")===""&&this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count);this.internal.self=c.extend({},{id:this.element.attr("id"),jq:this.element});this.internal.audio=c.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:h});this.internal.video=c.extend({},{id:this.options.idPrefix+
|
||||
"_video_"+this.count,jq:h});this.internal.flash=c.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:h,swf:this.options.swfPath+(this.options.swfPath!==""&&this.options.swfPath.slice(-1)!=="/"?"/":"")+"Jplayer.swf"});this.internal.poster=c.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:h});c.each(c.jPlayer.event,function(e,g){if(a.options[e]!==h){a.element.bind(g+".jPlayer",a.options[e]);a.options[e]=h}});this.htmlElement.poster=document.createElement("img");this.htmlElement.poster.id=
|
||||
this.internal.poster.id;this.htmlElement.poster.onload=function(){if(!a.status.video||a.status.waitForPlay)a.internal.poster.jq.show()};this.element.append(this.htmlElement.poster);this.internal.poster.jq=c("#"+this.internal.poster.id);this.internal.poster.jq.css({width:this.status.width,height:this.status.height});this.internal.poster.jq.hide();this.require.audio=false;this.require.video=false;c.each(this.formats,function(e,g){a.require[a.format[g].media]=true});this.html.audio.available=false;if(this.require.audio){this.htmlElement.audio=
|
||||
document.createElement("audio");this.htmlElement.audio.id=this.internal.audio.id;this.html.audio.available=!!this.htmlElement.audio.canPlayType}this.html.video.available=false;if(this.require.video){this.htmlElement.video=document.createElement("video");this.htmlElement.video.id=this.internal.video.id;this.html.video.available=!!this.htmlElement.video.canPlayType}this.flash.available=this._checkForFlash(10);this.html.canPlay={};this.flash.canPlay={};c.each(this.formats,function(e,g){a.html.canPlay[g]=
|
||||
a.html[a.format[g].media].available&&""!==a.htmlElement[a.format[g].media].canPlayType(a.format[g].codec);a.flash.canPlay[g]=a.format[g].flashCanPlay&&a.flash.available});this.html.desired=false;this.flash.desired=false;c.each(this.solutions,function(e,g){if(e===0)a[g].desired=true;else{var i=false,j=false;c.each(a.formats,function(n,k){if(a[a.solutions[0]].canPlay[k])if(a.format[k].media==="video")j=true;else i=true});a[g].desired=a.require.audio&&!i||a.require.video&&!j}});this.html.support={};
|
||||
this.flash.support={};c.each(this.formats,function(e,g){a.html.support[g]=a.html.canPlay[g]&&a.html.desired;a.flash.support[g]=a.flash.canPlay[g]&&a.flash.desired});this.html.used=false;this.flash.used=false;c.each(this.solutions,function(e,g){c.each(a.formats,function(i,j){if(a[g].support[j]){a[g].used=true;return false}})});this.html.used||this.flash.used||this._error({type:c.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:c.jPlayer.errorMsg.NO_SOLUTION,
|
||||
hint:c.jPlayer.errorHint.NO_SOLUTION});this.html.active=false;this.html.audio.gate=false;this.html.video.gate=false;this.flash.active=false;this.flash.gate=false;if(this.flash.used){var b="id="+escape(this.internal.self.id)+"&vol="+this.status.volume+"&muted="+this.status.muted;if(c.browser.msie&&Number(c.browser.version)<=8){var d='<object id="'+this.internal.flash.id+'"';d+=' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';d+=' codebase="'+document.URL.substring(0,document.URL.indexOf(":"))+
|
||||
'://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"';d+=' type="application/x-shockwave-flash"';d+=' width="0" height="0">';d+="</object>";var f=[];f[0]='<param name="movie" value="'+this.internal.flash.swf+'" />';f[1]='<param name="quality" value="high" />';f[2]='<param name="FlashVars" value="'+b+'" />';f[3]='<param name="allowScriptAccess" value="always" />';f[4]='<param name="bgcolor" value="'+this.options.backgroundColor+'" />';b=document.createElement(d);for(d=0;d<f.length;d++)b.appendChild(document.createElement(f[d]));
|
||||
this.element.append(b)}else{f='<embed name="'+this.internal.flash.id+'" id="'+this.internal.flash.id+'" src="'+this.internal.flash.swf+'"';f+=' width="0" height="0" bgcolor="'+this.options.backgroundColor+'"';f+=' quality="high" FlashVars="'+b+'"';f+=' allowScriptAccess="always"';f+=' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';this.element.append(f)}this.internal.flash.jq=c("#"+this.internal.flash.id);this.internal.flash.jq.css({width:"0px",
|
||||
height:"0px"})}if(this.html.used){if(this.html.audio.available){this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio);this.element.append(this.htmlElement.audio);this.internal.audio.jq=c("#"+this.internal.audio.id)}if(this.html.video.available){this._addHtmlEventListeners(this.htmlElement.video,this.html.video);this.element.append(this.htmlElement.video);this.internal.video.jq=c("#"+this.internal.video.id);this.internal.video.jq.css({width:"0px",height:"0px"})}}this.html.used&&!this.flash.used&&
|
||||
window.setTimeout(function(){a.internal.ready=true;a.version.flash="n/a";a._trigger(c.jPlayer.event.ready)},100);c.each(this.options.cssSelector,function(e,g){a._cssSelector(e,g)});this._updateInterface();this._updateButtons(false);this._updateVolume(this.status.volume);this._updateMute(this.status.muted);this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();c.jPlayer.prototype.count++},destroy:function(){this._resetStatus();this._updateInterface();this._seeked();this.css.jq.currentTime.length&&
|
||||
this.css.jq.currentTime.text("");this.css.jq.duration.length&&this.css.jq.duration.text("");this.status.srcSet&&this.pause();c.each(this.css.jq,function(a,b){b.unbind(".jPlayer")});this.element.removeData("jPlayer");this.element.unbind(".jPlayer");this.element.empty();this.instances[this.internal.instance]=h},enable:function(){},disable:function(){},_addHtmlEventListeners:function(a,b){var d=this;a.preload=this.options.preload;a.muted=this.options.muted;a.addEventListener("progress",function(){if(b.gate&&
|
||||
!d.status.waitForLoad){d._getHtmlStatus(a);d._updateInterface();d._trigger(c.jPlayer.event.progress)}},false);a.addEventListener("timeupdate",function(){if(b.gate&&!d.status.waitForLoad){d._getHtmlStatus(a);d._updateInterface();d._trigger(c.jPlayer.event.timeupdate)}},false);a.addEventListener("durationchange",function(){if(b.gate&&!d.status.waitForLoad){d.status.duration=this.duration;d._getHtmlStatus(a);d._updateInterface();d._trigger(c.jPlayer.event.durationchange)}},false);a.addEventListener("play",
|
||||
function(){if(b.gate&&!d.status.waitForLoad){d._updateButtons(true);d._trigger(c.jPlayer.event.play)}},false);a.addEventListener("playing",function(){if(b.gate&&!d.status.waitForLoad){d._updateButtons(true);d._seeked();d._trigger(c.jPlayer.event.playing)}},false);a.addEventListener("pause",function(){if(b.gate&&!d.status.waitForLoad){d._updateButtons(false);d._trigger(c.jPlayer.event.pause)}},false);a.addEventListener("waiting",function(){if(b.gate&&!d.status.waitForLoad){d._seeking();d._trigger(c.jPlayer.event.waiting)}},
|
||||
false);a.addEventListener("canplay",function(){if(b.gate&&!d.status.waitForLoad){a.volume=d._volumeFix(d.status.volume);d._trigger(c.jPlayer.event.canplay)}},false);a.addEventListener("seeking",function(){if(b.gate&&!d.status.waitForLoad){d._seeking();d._trigger(c.jPlayer.event.seeking)}},false);a.addEventListener("seeked",function(){if(b.gate&&!d.status.waitForLoad){d._seeked();d._trigger(c.jPlayer.event.seeked)}},false);a.addEventListener("suspend",function(){if(b.gate&&!d.status.waitForLoad){d._seeked();
|
||||
d._trigger(c.jPlayer.event.suspend)}},false);a.addEventListener("ended",function(){if(b.gate&&!d.status.waitForLoad){if(!c.jPlayer.browser.webkit)d.htmlElement.media.currentTime=0;d.htmlElement.media.pause();d._updateButtons(false);d._getHtmlStatus(a,true);d._updateInterface();d._trigger(c.jPlayer.event.ended)}},false);a.addEventListener("error",function(){if(b.gate&&!d.status.waitForLoad){d._updateButtons(false);d._seeked();if(d.status.srcSet){d.status.waitForLoad=true;d.status.waitForPlay=true;
|
||||
d.status.video&&d.internal.video.jq.css({width:"0px",height:"0px"});d._validString(d.status.media.poster)&&d.internal.poster.jq.show();d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show();d._error({type:c.jPlayer.error.URL,context:d.status.src,message:c.jPlayer.errorMsg.URL,hint:c.jPlayer.errorHint.URL})}}},false);c.each(c.jPlayer.htmlEvent,function(f,e){a.addEventListener(this,function(){b.gate&&!d.status.waitForLoad&&d._trigger(c.jPlayer.event[e])},false)})},_getHtmlStatus:function(a,b){var d=0,
|
||||
f=0,e=0,g=0;d=a.currentTime;f=this.status.duration>0?100*d/this.status.duration:0;if(typeof a.seekable==="object"&&a.seekable.length>0){e=this.status.duration>0?100*a.seekable.end(a.seekable.length-1)/this.status.duration:100;g=100*a.currentTime/a.seekable.end(a.seekable.length-1)}else{e=100;g=f}if(b)f=g=d=0;this.status.seekPercent=e;this.status.currentPercentRelative=g;this.status.currentPercentAbsolute=f;this.status.currentTime=d},_resetStatus:function(){this.status=c.extend({},this.status,c.jPlayer.prototype.status)},
|
||||
_trigger:function(a,b,d){a=c.Event(a);a.jPlayer={};a.jPlayer.version=c.extend({},this.version);a.jPlayer.status=c.extend(true,{},this.status);a.jPlayer.html=c.extend(true,{},this.html);a.jPlayer.flash=c.extend(true,{},this.flash);if(b)a.jPlayer.error=c.extend({},b);if(d)a.jPlayer.warning=c.extend({},d);this.element.trigger(a)},jPlayerFlashEvent:function(a,b){if(a===c.jPlayer.event.ready&&!this.internal.ready){this.internal.ready=true;this.version.flash=b.version;this.version.needFlash!==this.version.flash&&
|
||||
this._error({type:c.jPlayer.error.VERSION,context:this.version.flash,message:c.jPlayer.errorMsg.VERSION+this.version.flash,hint:c.jPlayer.errorHint.VERSION});this._trigger(a)}if(this.flash.gate)switch(a){case c.jPlayer.event.progress:this._getFlashStatus(b);this._updateInterface();this._trigger(a);break;case c.jPlayer.event.timeupdate:this._getFlashStatus(b);this._updateInterface();this._trigger(a);break;case c.jPlayer.event.play:this._seeked();this._updateButtons(true);this._trigger(a);break;case c.jPlayer.event.pause:this._updateButtons(false);
|
||||
this._trigger(a);break;case c.jPlayer.event.ended:this._updateButtons(false);this._trigger(a);break;case c.jPlayer.event.error:this.status.waitForLoad=true;this.status.waitForPlay=true;this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._validString(this.status.media.poster)&&this.internal.poster.jq.show();this.css.jq.videoPlay.length&&this.css.jq.videoPlay.show();this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media);this._error({type:c.jPlayer.error.URL,
|
||||
context:b.src,message:c.jPlayer.errorMsg.URL,hint:c.jPlayer.errorHint.URL});break;case c.jPlayer.event.seeking:this._seeking();this._trigger(a);break;case c.jPlayer.event.seeked:this._seeked();this._trigger(a);break;default:this._trigger(a)}return false},_getFlashStatus:function(a){this.status.seekPercent=a.seekPercent;this.status.currentPercentRelative=a.currentPercentRelative;this.status.currentPercentAbsolute=a.currentPercentAbsolute;this.status.currentTime=a.currentTime;this.status.duration=a.duration},
|
||||
_updateButtons:function(a){this.status.paused=!a;if(this.css.jq.play.length&&this.css.jq.pause.length)if(a){this.css.jq.play.hide();this.css.jq.pause.show()}else{this.css.jq.play.show();this.css.jq.pause.hide()}},_updateInterface:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%");this.css.jq.playBar.length&&this.css.jq.playBar.width(this.status.currentPercentRelative+"%");this.css.jq.currentTime.length&&this.css.jq.currentTime.text(c.jPlayer.convertTime(this.status.currentTime));
|
||||
this.css.jq.duration.length&&this.css.jq.duration.text(c.jPlayer.convertTime(this.status.duration))},_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg")},setMedia:function(a){var b=this;this._seeked();clearTimeout(this.internal.htmlDlyCmdId);var d=this.html.audio.gate,f=this.html.video.gate,e=false;c.each(this.formats,function(g,i){var j=b.format[i].media==="video";
|
||||
c.each(b.solutions,function(n,k){if(b[k].support[i]&&b._validString(a[i])){var l=k==="html";if(j)if(l){b.html.audio.gate=false;b.html.video.gate=true;b.flash.gate=false}else{b.html.audio.gate=false;b.html.video.gate=false;b.flash.gate=true}else if(l){b.html.audio.gate=true;b.html.video.gate=false;b.flash.gate=false}else{b.html.audio.gate=false;b.html.video.gate=false;b.flash.gate=true}if(b.flash.active||b.html.active&&b.flash.gate||d===b.html.audio.gate&&f===b.html.video.gate)b.clearMedia();else if(d!==
|
||||
b.html.audio.gate&&f!==b.html.video.gate){b._html_pause();b.status.video&&b.internal.video.jq.css({width:"0px",height:"0px"});b._resetStatus()}if(j){if(l){b._html_setVideo(a);b.html.active=true;b.flash.active=false}else{b._flash_setVideo(a);b.html.active=false;b.flash.active=true}b.css.jq.videoPlay.length&&b.css.jq.videoPlay.show();b.status.video=true}else{if(l){b._html_setAudio(a);b.html.active=true;b.flash.active=false}else{b._flash_setAudio(a);b.html.active=false;b.flash.active=true}b.css.jq.videoPlay.length&&
|
||||
b.css.jq.videoPlay.hide();b.status.video=false}e=true;return false}});if(e)return false});if(e){if(this._validString(a.poster))if(this.htmlElement.poster.src!==a.poster)this.htmlElement.poster.src=a.poster;else this.internal.poster.jq.show();else this.internal.poster.jq.hide();this.status.srcSet=true;this.status.media=c.extend({},a);this._updateButtons(false);this._updateInterface()}else{this.status.srcSet&&!this.status.waitForPlay&&this.pause();this.html.audio.gate=false;this.html.video.gate=false;
|
||||
this.flash.gate=false;this.html.active=false;this.flash.active=false;this._resetStatus();this._updateInterface();this._updateButtons(false);this.internal.poster.jq.hide();this.html.used&&this.require.video&&this.internal.video.jq.css({width:"0px",height:"0px"});this.flash.used&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._error({type:c.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:c.jPlayer.errorMsg.NO_SUPPORT,hint:c.jPlayer.errorHint.NO_SUPPORT})}},
|
||||
clearMedia:function(){this._resetStatus();this._updateButtons(false);this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);if(this.html.active)this._html_clearMedia();else this.flash.active&&this._flash_clearMedia()},load:function(){if(this.status.srcSet)if(this.html.active)this._html_load();else this.flash.active&&this._flash_load();else this._urlNotSetError("load")},play:function(a){a=typeof a==="number"?a:NaN;if(this.status.srcSet)if(this.html.active)this._html_play(a);else this.flash.active&&
|
||||
this._flash_play(a);else this._urlNotSetError("play")},videoPlay:function(){this.play()},pause:function(a){a=typeof a==="number"?a:NaN;if(this.status.srcSet)if(this.html.active)this._html_pause(a);else this.flash.active&&this._flash_pause(a);else this._urlNotSetError("pause")},pauseOthers:function(){var a=this;c.each(this.instances,function(b,d){a.element!==d&&d.data("jPlayer").status.srcSet&&d.jPlayer("pause")})},stop:function(){if(this.status.srcSet)if(this.html.active)this._html_pause(0);else this.flash.active&&
|
||||
this._flash_pause(0);else this._urlNotSetError("stop")},playHead:function(a){a=this._limitValue(a,0,100);if(this.status.srcSet)if(this.html.active)this._html_playHead(a);else this.flash.active&&this._flash_playHead(a);else this._urlNotSetError("playHead")},mute:function(){this.status.muted=true;this.html.used&&this._html_mute(true);this.flash.used&&this._flash_mute(true);this._updateMute(true);this._updateVolume(0);this._trigger(c.jPlayer.event.volumechange)},unmute:function(){this.status.muted=false;
|
||||
this.html.used&&this._html_mute(false);this.flash.used&&this._flash_mute(false);this._updateMute(false);this._updateVolume(this.status.volume);this._trigger(c.jPlayer.event.volumechange)},_updateMute:function(a){if(this.css.jq.mute.length&&this.css.jq.unmute.length)if(a){this.css.jq.mute.hide();this.css.jq.unmute.show()}else{this.css.jq.mute.show();this.css.jq.unmute.hide()}},volume:function(a){a=this._limitValue(a,0,1);this.status.volume=a;this.html.used&&this._html_volume(a);this.flash.used&&this._flash_volume(a);
|
||||
this.status.muted||this._updateVolume(a);this._trigger(c.jPlayer.event.volumechange)},volumeBar:function(a){if(!this.status.muted&&this.css.jq.volumeBar){var b=this.css.jq.volumeBar.offset();a=a.pageX-b.left;b=this.css.jq.volumeBar.width();this.volume(a/b)}},volumeBarValue:function(a){this.volumeBar(a)},_updateVolume:function(a){this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.width(a*100+"%")},_volumeFix:function(a){var b=0.0010*Math.random();return a+(a<0.5?b:-b)},_cssSelectorAncestor:function(a,
|
||||
b){this.options.cssSelectorAncestor=a;b&&c.each(this.options.cssSelector,function(d,f){self._cssSelector(d,f)})},_cssSelector:function(a,b){var d=this;if(typeof b==="string")if(c.jPlayer.prototype.options.cssSelector[a]){this.css.jq[a]&&this.css.jq[a].length&&this.css.jq[a].unbind(".jPlayer");this.options.cssSelector[a]=b;this.css.cs[a]=this.options.cssSelectorAncestor+" "+b;this.css.jq[a]=b?c(this.css.cs[a]):[];this.css.jq[a].length&&this.css.jq[a].bind("click.jPlayer",function(f){d[a](f);c(this).blur();
|
||||
return false});b&&this.css.jq[a].length!==1&&this._warning({type:c.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[a],message:c.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[a].length+" found for "+a+" method.",hint:c.jPlayer.warningHint.CSS_SELECTOR_COUNT})}else this._warning({type:c.jPlayer.warning.CSS_SELECTOR_METHOD,context:a,message:c.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:c.jPlayer.warningHint.CSS_SELECTOR_METHOD});else this._warning({type:c.jPlayer.warning.CSS_SELECTOR_STRING,
|
||||
context:b,message:c.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:c.jPlayer.warningHint.CSS_SELECTOR_STRING})},seekBar:function(a){if(this.css.jq.seekBar){var b=this.css.jq.seekBar.offset();a=a.pageX-b.left;b=this.css.jq.seekBar.width();this.playHead(100*a/b)}},playBar:function(a){this.seekBar(a)},currentTime:function(){},duration:function(){},option:function(a,b){var d=a;if(arguments.length===0)return c.extend(true,{},this.options);if(typeof a==="string"){var f=a.split(".");if(b===h){for(var e=c.extend(true,
|
||||
{},this.options),g=0;g<f.length;g++)if(e[f[g]]!==h)e=e[f[g]];else{this._warning({type:c.jPlayer.warning.OPTION_KEY,context:a,message:c.jPlayer.warningMsg.OPTION_KEY,hint:c.jPlayer.warningHint.OPTION_KEY});return h}return e}e=d={};for(g=0;g<f.length;g++)if(g<f.length-1){e[f[g]]={};e=e[f[g]]}else e[f[g]]=b}this._setOptions(d);return this},_setOptions:function(a){var b=this;c.each(a,function(d,f){b._setOption(d,f)});return this},_setOption:function(a,b){var d=this;switch(a){case "cssSelectorAncestor":this.options[a]=
|
||||
b;c.each(d.options.cssSelector,function(f,e){d._cssSelector(f,e)});break;case "cssSelector":c.each(b,function(f,e){d._cssSelector(f,e)})}return this},resize:function(a){this.html.active&&this._resizeHtml(a);this.flash.active&&this._resizeFlash(a);this._trigger(c.jPlayer.event.resize)},_resizePoster:function(){},_resizeHtml:function(){},_resizeFlash:function(a){this.internal.flash.jq.css({width:a.width,height:a.height})},_html_initMedia:function(){this.status.srcSet&&!this.status.waitForPlay&&this.htmlElement.media.pause();
|
||||
this.options.preload!=="none"&&this._html_load();this._trigger(c.jPlayer.event.timeupdate)},_html_setAudio:function(a){var b=this;c.each(this.formats,function(d,f){if(b.html.support[f]&&a[f]){b.status.src=a[f];b.status.format[f]=true;b.status.formatType=f;return false}});this.htmlElement.media=this.htmlElement.audio;this._html_initMedia()},_html_setVideo:function(a){var b=this;c.each(this.formats,function(d,f){if(b.html.support[f]&&a[f]){b.status.src=a[f];b.status.format[f]=true;b.status.formatType=
|
||||
f;return false}});this.htmlElement.media=this.htmlElement.video;this._html_initMedia()},_html_clearMedia:function(){if(this.htmlElement.media){this.htmlElement.media.id===this.internal.video.id&&this.internal.video.jq.css({width:"0px",height:"0px"});this.htmlElement.media.pause();this.htmlElement.media.src="";c.browser.msie&&Number(c.browser.version)>=9||this.htmlElement.media.load()}},_html_load:function(){if(this.status.waitForLoad){this.status.waitForLoad=false;this.htmlElement.media.src=this.status.src;
|
||||
try{this.htmlElement.media.load()}catch(a){}}clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(a){var b=this;this._html_load();this.htmlElement.media.play();if(!isNaN(a))try{this.htmlElement.media.currentTime=a}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.play(a)},100);return}this._html_checkWaitForPlay()},_html_pause:function(a){var b=this;a>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId);this.htmlElement.media.pause();if(!isNaN(a))try{this.htmlElement.media.currentTime=
|
||||
a}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.pause(a)},100);return}a>0&&this._html_checkWaitForPlay()},_html_playHead:function(a){var b=this;this._html_load();try{if(typeof this.htmlElement.media.seekable==="object"&&this.htmlElement.media.seekable.length>0)this.htmlElement.media.currentTime=a*this.htmlElement.media.seekable.end(this.htmlElement.media.seekable.length-1)/100;else if(this.htmlElement.media.duration>0&&!isNaN(this.htmlElement.media.duration))this.htmlElement.media.currentTime=
|
||||
a*this.htmlElement.media.duration/100;else throw"e";}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.playHead(a)},100);return}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();if(this.status.video){this.internal.poster.jq.hide();this.internal.video.jq.css({width:this.status.width,height:this.status.height})}}},_html_volume:function(a){if(this.html.audio.available)this.htmlElement.audio.volume=
|
||||
a;if(this.html.video.available)this.htmlElement.video.volume=a},_html_mute:function(a){if(this.html.audio.available)this.htmlElement.audio.muted=a;if(this.html.video.available)this.htmlElement.video.muted=a},_flash_setAudio:function(a){var b=this;try{c.each(this.formats,function(f,e){if(b.flash.support[e]&&a[e]){switch(e){case "m4a":b._getMovie().fl_setAudio_m4a(a[e]);break;case "mp3":b._getMovie().fl_setAudio_mp3(a[e])}b.status.src=a[e];b.status.format[e]=true;b.status.formatType=e;return false}});
|
||||
if(this.options.preload==="auto"){this._flash_load();this.status.waitForLoad=false}}catch(d){this._flashError(d)}},_flash_setVideo:function(a){var b=this;try{c.each(this.formats,function(f,e){if(b.flash.support[e]&&a[e]){switch(e){case "m4v":b._getMovie().fl_setVideo_m4v(a[e])}b.status.src=a[e];b.status.format[e]=true;b.status.formatType=e;return false}});if(this.options.preload==="auto"){this._flash_load();this.status.waitForLoad=false}}catch(d){this._flashError(d)}},_flash_clearMedia:function(){this.internal.flash.jq.css({width:"0px",
|
||||
height:"0px"});try{this._getMovie().fl_clearMedia()}catch(a){this._flashError(a)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(a){this._flashError(a)}this.status.waitForLoad=false},_flash_play:function(a){try{this._getMovie().fl_play(a)}catch(b){this._flashError(b)}this.status.waitForLoad=false;this._flash_checkWaitForPlay()},_flash_pause:function(a){try{this._getMovie().fl_pause(a)}catch(b){this._flashError(b)}if(a>0){this.status.waitForLoad=false;this._flash_checkWaitForPlay()}},
|
||||
_flash_playHead:function(a){try{this._getMovie().fl_play_head(a)}catch(b){this._flashError(b)}this.status.waitForLoad||this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();if(this.status.video){this.internal.poster.jq.hide();this.internal.flash.jq.css({width:this.status.width,height:this.status.height})}}},_flash_volume:function(a){try{this._getMovie().fl_volume(a)}catch(b){this._flashError(b)}},
|
||||
_flash_mute:function(a){try{this._getMovie().fl_mute(a)}catch(b){this._flashError(b)}},_getMovie:function(){return document[this.internal.flash.id]},_checkForFlash:function(a){var b=false,d;if(window.ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+a);b=true}catch(f){}else if(navigator.plugins&&navigator.mimeTypes.length>0)if(d=navigator.plugins["Shockwave Flash"])if(navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")>=a)b=true;return c.browser.msie&&
|
||||
Number(c.browser.version)>=9?false:b},_validString:function(a){return a&&typeof a==="string"},_limitValue:function(a,b,d){return a<b?b:a>d?d:a},_urlNotSetError:function(a){this._error({type:c.jPlayer.error.URL_NOT_SET,context:a,message:c.jPlayer.errorMsg.URL_NOT_SET,hint:c.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(a){this._error({type:c.jPlayer.error.FLASH,context:this.internal.flash.swf,message:c.jPlayer.errorMsg.FLASH+a.message,hint:c.jPlayer.errorHint.FLASH})},_error:function(a){this._trigger(c.jPlayer.event.error,
|
||||
a);if(this.options.errorAlerts)this._alert("Error!"+(a.message?"\n\n"+a.message:"")+(a.hint?"\n\n"+a.hint:"")+"\n\nContext: "+a.context)},_warning:function(a){this._trigger(c.jPlayer.event.warning,h,a);if(this.options.errorAlerts)this._alert("Warning!"+(a.message?"\n\n"+a.message:"")+(a.hint?"\n\n"+a.hint:"")+"\n\nContext: "+a.context)},_alert:function(a){alert("jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+a)}};c.jPlayer.error={FLASH:"e_flash",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",
|
||||
URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};c.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",
|
||||
VERSION:"jPlayer "+c.jPlayer.prototype.version.script+" needs Jplayer.swf version "+c.jPlayer.prototype.version.needFlash+" but found "};c.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};c.jPlayer.warning=
|
||||
{CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};c.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of methodCssSelectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};
|
||||
c.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}})(jQuery);
|
||||
(function(b,f){b.fn.jPlayer=function(a){var c=typeof a==="string",d=Array.prototype.slice.call(arguments,1),e=this,a=!c&&d.length?b.extend.apply(null,[!0,a].concat(d)):a;if(c&&a.charAt(0)==="_")return e;c?this.each(function(){var c=b.data(this,"jPlayer"),h=c&&b.isFunction(c[a])?c[a].apply(c,d):c;if(h!==c&&h!==f)return e=h,!1}):this.each(function(){var c=b.data(this,"jPlayer");c?c.option(a||{}):b.data(this,"jPlayer",new b.jPlayer(a,this))});return e};b.jPlayer=function(a,c){if(arguments.length){this.element=
|
||||
b(c);this.options=b.extend(!0,{},this.options,a);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()});this._init()}};b.jPlayer.emulateMethods="load play pause";b.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";b.jPlayer.emulateOptions="muted volume";b.jPlayer.reservedEvent="ready flashreset resize repeat error warning";b.jPlayer.event={ready:"jPlayer_ready",flashreset:"jPlayer_flashreset",resize:"jPlayer_resize",repeat:"jPlayer_repeat",
|
||||
click:"jPlayer_click",error:"jPlayer_error",warning:"jPlayer_warning",loadstart:"jPlayer_loadstart",progress:"jPlayer_progress",suspend:"jPlayer_suspend",abort:"jPlayer_abort",emptied:"jPlayer_emptied",stalled:"jPlayer_stalled",play:"jPlayer_play",pause:"jPlayer_pause",loadedmetadata:"jPlayer_loadedmetadata",loadeddata:"jPlayer_loadeddata",waiting:"jPlayer_waiting",playing:"jPlayer_playing",canplay:"jPlayer_canplay",canplaythrough:"jPlayer_canplaythrough",seeking:"jPlayer_seeking",seeked:"jPlayer_seeked",
|
||||
timeupdate:"jPlayer_timeupdate",ended:"jPlayer_ended",ratechange:"jPlayer_ratechange",durationchange:"jPlayer_durationchange",volumechange:"jPlayer_volumechange"};b.jPlayer.htmlEvent="loadstart,abort,emptied,stalled,loadedmetadata,loadeddata,canplay,canplaythrough,ratechange".split(",");b.jPlayer.pause=function(){b.each(b.jPlayer.prototype.instances,function(a,b){b.data("jPlayer").status.srcSet&&b.jPlayer("pause")})};b.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,
|
||||
sepHour:":",sepMin:":",sepSec:""};b.jPlayer.convertTime=function(a){var c=new Date(a*1E3),d=c.getUTCHours(),a=c.getUTCMinutes(),c=c.getUTCSeconds(),d=b.jPlayer.timeFormat.padHour&&d<10?"0"+d:d,a=b.jPlayer.timeFormat.padMin&&a<10?"0"+a:a,c=b.jPlayer.timeFormat.padSec&&c<10?"0"+c:c;return(b.jPlayer.timeFormat.showHour?d+b.jPlayer.timeFormat.sepHour:"")+(b.jPlayer.timeFormat.showMin?a+b.jPlayer.timeFormat.sepMin:"")+(b.jPlayer.timeFormat.showSec?c+b.jPlayer.timeFormat.sepSec:"")};b.jPlayer.uaBrowser=
|
||||
function(a){var a=a.toLowerCase(),b=/(opera)(?:.*version)?[ \/]([\w.]+)/,d=/(msie) ([\w.]+)/,e=/(mozilla)(?:.*? rv:([\w.]+))?/,a=/(webkit)[ \/]([\w.]+)/.exec(a)||b.exec(a)||d.exec(a)||a.indexOf("compatible")<0&&e.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}};b.jPlayer.uaPlatform=function(a){var b=a.toLowerCase(),d=/(android)/,e=/(mobile)/,a=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(b)||[],b=/(ipad|playbook)/.exec(b)||!e.exec(b)&&d.exec(b)||[];a[1]&&(a[1]=a[1].replace(/\s/g,
|
||||
"_"));return{platform:a[1]||"",tablet:b[1]||""}};b.jPlayer.browser={};b.jPlayer.platform={};var i=b.jPlayer.uaBrowser(navigator.userAgent);if(i.browser)b.jPlayer.browser[i.browser]=!0,b.jPlayer.browser.version=i.version;i=b.jPlayer.uaPlatform(navigator.userAgent);if(i.platform)b.jPlayer.platform[i.platform]=!0,b.jPlayer.platform.mobile=!i.tablet,b.jPlayer.platform.tablet=!!i.tablet;b.jPlayer.prototype={count:0,version:{script:"2.1.0",needFlash:"2.1.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",
|
||||
supplied:"mp3",preload:"metadata",volume:0.8,muted:!1,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",currentTime:".jp-current-time",duration:".jp-duration",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",
|
||||
repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},fullScreen:!1,autohide:{restored:!1,full:!0,fadeIn:200,fadeOut:600,hold:1E3},loop:!1,repeat:function(a){a.jPlayer.options.loop?b(this).unbind(".jPlayerRepeat").bind(b.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){b(this).jPlayer("play")}):b(this).unbind(".jPlayerRepeat")},nativeVideoControls:{},noFullScreen:{msie:/msie [0-6]/,ipad:/ipad.*?os [0-4]/,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3](?!.*?mobile)/,
|
||||
android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,webos:/webos/,playbook:/playbook/},verticalVolume:!1,idPrefix:"jp",noConflict:"jQuery",emulateHtml:!1,errorAlerts:!1,warningAlerts:!1},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},
|
||||
optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:!0,format:{},formatType:"",waitForPlay:!0,waitForLoad:!0,srcSet:!1,video:!1,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:!1},solution:{html:!0,flash:!0},format:{mp3:{codec:'audio/mpeg; codecs="mp3"',flashCanPlay:!0,
|
||||
media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis"',flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!0,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,
|
||||
media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"}},_init:function(){var a=this;this.element.empty();this.status=b.extend({},this.status);this.internal=b.extend({},this.internal);this.internal.domNode=this.element.get(0);this.formats=[];this.solutions=[];this.require={};this.htmlElement={};this.html={};this.html.audio={};this.html.video={};this.flash={};this.css={};this.css.cs={};this.css.jq={};this.ancestorJq=
|
||||
[];this.options.volume=this._limitValue(this.options.volume,0,1);b.each(this.options.supplied.toLowerCase().split(","),function(c,d){var e=d.replace(/^\s+|\s+$/g,"");if(a.format[e]){var f=!1;b.each(a.formats,function(a,b){if(e===b)return f=!0,!1});f||a.formats.push(e)}});b.each(this.options.solution.toLowerCase().split(","),function(c,d){var e=d.replace(/^\s+|\s+$/g,"");if(a.solution[e]){var f=!1;b.each(a.solutions,function(a,b){if(e===b)return f=!0,!1});f||a.solutions.push(e)}});this.internal.instance=
|
||||
"jp_"+this.count;this.instances[this.internal.instance]=this.element;this.element.attr("id")||this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count);this.internal.self=b.extend({},{id:this.element.attr("id"),jq:this.element});this.internal.audio=b.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:f});this.internal.video=b.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:f});this.internal.flash=b.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:f,swf:this.options.swfPath+
|
||||
(this.options.swfPath.toLowerCase().slice(-4)!==".swf"?(this.options.swfPath&&this.options.swfPath.slice(-1)!=="/"?"/":"")+"Jplayer.swf":"")});this.internal.poster=b.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:f});b.each(b.jPlayer.event,function(b,c){a.options[b]!==f&&(a.element.bind(c+".jPlayer",a.options[b]),a.options[b]=f)});this.require.audio=!1;this.require.video=!1;b.each(this.formats,function(b,c){a.require[a.format[c].media]=!0});this.options=this.require.video?b.extend(!0,
|
||||
{},this.optionsVideo,this.options):b.extend(!0,{},this.optionsAudio,this.options);this._setSize();this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullScreen=this._uaBlocklist(this.options.noFullScreen);this.status.noVolume=this._uaBlocklist(this.options.noVolume);this._restrictNativeVideoControls();this.htmlElement.poster=document.createElement("img");this.htmlElement.poster.id=this.internal.poster.id;this.htmlElement.poster.onload=function(){(!a.status.video||
|
||||
a.status.waitForPlay)&&a.internal.poster.jq.show()};this.element.append(this.htmlElement.poster);this.internal.poster.jq=b("#"+this.internal.poster.id);this.internal.poster.jq.css({width:this.status.width,height:this.status.height});this.internal.poster.jq.hide();this.internal.poster.jq.bind("click.jPlayer",function(){a._trigger(b.jPlayer.event.click)});this.html.audio.available=!1;if(this.require.audio)this.htmlElement.audio=document.createElement("audio"),this.htmlElement.audio.id=this.internal.audio.id,
|
||||
this.html.audio.available=!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio);this.html.video.available=!1;if(this.require.video)this.htmlElement.video=document.createElement("video"),this.htmlElement.video.id=this.internal.video.id,this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video);this.flash.available=this._checkForFlash(10);this.html.canPlay={};this.flash.canPlay={};b.each(this.formats,function(b,c){a.html.canPlay[c]=
|
||||
a.html[a.format[c].media].available&&""!==a.htmlElement[a.format[c].media].canPlayType(a.format[c].codec);a.flash.canPlay[c]=a.format[c].flashCanPlay&&a.flash.available});this.html.desired=!1;this.flash.desired=!1;b.each(this.solutions,function(c,d){if(c===0)a[d].desired=!0;else{var e=!1,f=!1;b.each(a.formats,function(b,c){a[a.solutions[0]].canPlay[c]&&(a.format[c].media==="video"?f=!0:e=!0)});a[d].desired=a.require.audio&&!e||a.require.video&&!f}});this.html.support={};this.flash.support={};b.each(this.formats,
|
||||
function(b,c){a.html.support[c]=a.html.canPlay[c]&&a.html.desired;a.flash.support[c]=a.flash.canPlay[c]&&a.flash.desired});this.html.used=!1;this.flash.used=!1;b.each(this.solutions,function(c,d){b.each(a.formats,function(b,c){if(a[d].support[c])return a[d].used=!0,!1})});this._resetActive();this._resetGate();this._cssSelectorAncestor(this.options.cssSelectorAncestor);!this.html.used&&!this.flash.used?(this._error({type:b.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+
|
||||
this.options.supplied+"'}",message:b.jPlayer.errorMsg.NO_SOLUTION,hint:b.jPlayer.errorHint.NO_SOLUTION}),this.css.jq.noSolution.length&&this.css.jq.noSolution.show()):this.css.jq.noSolution.length&&this.css.jq.noSolution.hide();if(this.flash.used){var c,d="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+"&muted="+this.options.muted;if(b.browser.msie&&Number(b.browser.version)<=8){d=['<param name="movie" value="'+this.internal.flash.swf+
|
||||
'" />','<param name="FlashVars" value="'+d+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'];c=document.createElement('<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0"></object>');for(var e=0;e<d.length;e++)c.appendChild(document.createElement(d[e]))}else e=function(a,b,c){var d=document.createElement("param");
|
||||
d.setAttribute("name",b);d.setAttribute("value",c);a.appendChild(d)},c=document.createElement("object"),c.setAttribute("id",this.internal.flash.id),c.setAttribute("data",this.internal.flash.swf),c.setAttribute("type","application/x-shockwave-flash"),c.setAttribute("width","1"),c.setAttribute("height","1"),e(c,"flashvars",d),e(c,"allowscriptaccess","always"),e(c,"bgcolor",this.options.backgroundColor),e(c,"wmode",this.options.wmode);this.element.append(c);this.internal.flash.jq=b(c)}if(this.html.used){if(this.html.audio.available)this._addHtmlEventListeners(this.htmlElement.audio,
|
||||
this.html.audio),this.element.append(this.htmlElement.audio),this.internal.audio.jq=b("#"+this.internal.audio.id);if(this.html.video.available)this._addHtmlEventListeners(this.htmlElement.video,this.html.video),this.element.append(this.htmlElement.video),this.internal.video.jq=b("#"+this.internal.video.id),this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):this.internal.video.jq.css({width:"0px",height:"0px"}),this.internal.video.jq.bind("click.jPlayer",
|
||||
function(){a._trigger(b.jPlayer.event.click)})}this.options.emulateHtml&&this._emulateHtmlBridge();this.html.used&&!this.flash.used&&setTimeout(function(){a.internal.ready=!0;a.version.flash="n/a";a._trigger(b.jPlayer.event.repeat);a._trigger(b.jPlayer.event.ready)},100);this._updateNativeVideoControls();this._updateInterface();this._updateButtons(!1);this._updateAutohide();this._updateVolume(this.options.volume);this._updateMute(this.options.muted);this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();
|
||||
b.jPlayer.prototype.count++},destroy:function(){this.clearMedia();this._removeUiClass();this.css.jq.currentTime.length&&this.css.jq.currentTime.text("");this.css.jq.duration.length&&this.css.jq.duration.text("");b.each(this.css.jq,function(a,b){b.length&&b.unbind(".jPlayer")});this.internal.poster.jq.unbind(".jPlayer");this.internal.video.jq&&this.internal.video.jq.unbind(".jPlayer");this.options.emulateHtml&&this._destroyHtmlBridge();this.element.removeData("jPlayer");this.element.unbind(".jPlayer");
|
||||
this.element.empty();delete this.instances[this.internal.instance]},enable:function(){},disable:function(){},_testCanPlayType:function(a){try{return a.canPlayType(this.format.mp3.codec),!0}catch(b){return!1}},_uaBlocklist:function(a){var c=navigator.userAgent.toLowerCase(),d=!1;b.each(a,function(a,b){if(b&&b.test(c))return d=!0,!1});return d},_restrictNativeVideoControls:function(){if(this.require.audio&&this.status.nativeVideoControls)this.status.nativeVideoControls=!1,this.status.noFullScreen=!0},
|
||||
_updateNativeVideoControls:function(){if(this.html.video.available&&this.html.used)this.htmlElement.video.controls=this.status.nativeVideoControls,this._updateAutohide(),this.status.nativeVideoControls&&this.require.video?(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})):this.status.waitForPlay&&this.status.video&&(this.internal.poster.jq.show(),this.internal.video.jq.css({width:"0px",height:"0px"}))},_addHtmlEventListeners:function(a,
|
||||
c){var d=this;a.preload=this.options.preload;a.muted=this.options.muted;a.volume=this.options.volume;a.addEventListener("progress",function(){c.gate&&(d._getHtmlStatus(a),d._updateInterface(),d._trigger(b.jPlayer.event.progress))},!1);a.addEventListener("timeupdate",function(){c.gate&&(d._getHtmlStatus(a),d._updateInterface(),d._trigger(b.jPlayer.event.timeupdate))},!1);a.addEventListener("durationchange",function(){if(c.gate)d.status.duration=this.duration,d._getHtmlStatus(a),d._updateInterface(),
|
||||
d._trigger(b.jPlayer.event.durationchange)},!1);a.addEventListener("play",function(){c.gate&&(d._updateButtons(!0),d._html_checkWaitForPlay(),d._trigger(b.jPlayer.event.play))},!1);a.addEventListener("playing",function(){c.gate&&(d._updateButtons(!0),d._seeked(),d._trigger(b.jPlayer.event.playing))},!1);a.addEventListener("pause",function(){c.gate&&(d._updateButtons(!1),d._trigger(b.jPlayer.event.pause))},!1);a.addEventListener("waiting",function(){c.gate&&(d._seeking(),d._trigger(b.jPlayer.event.waiting))},
|
||||
!1);a.addEventListener("seeking",function(){c.gate&&(d._seeking(),d._trigger(b.jPlayer.event.seeking))},!1);a.addEventListener("seeked",function(){c.gate&&(d._seeked(),d._trigger(b.jPlayer.event.seeked))},!1);a.addEventListener("volumechange",function(){if(c.gate)d.options.volume=a.volume,d.options.muted=a.muted,d._updateMute(),d._updateVolume(),d._trigger(b.jPlayer.event.volumechange)},!1);a.addEventListener("suspend",function(){c.gate&&(d._seeked(),d._trigger(b.jPlayer.event.suspend))},!1);a.addEventListener("ended",
|
||||
function(){if(c.gate){if(!b.jPlayer.browser.webkit)d.htmlElement.media.currentTime=0;d.htmlElement.media.pause();d._updateButtons(!1);d._getHtmlStatus(a,!0);d._updateInterface();d._trigger(b.jPlayer.event.ended)}},!1);a.addEventListener("error",function(){if(c.gate&&(d._updateButtons(!1),d._seeked(),d.status.srcSet))clearTimeout(d.internal.htmlDlyCmdId),d.status.waitForLoad=!0,d.status.waitForPlay=!0,d.status.video&&!d.status.nativeVideoControls&&d.internal.video.jq.css({width:"0px",height:"0px"}),
|
||||
d._validString(d.status.media.poster)&&!d.status.nativeVideoControls&&d.internal.poster.jq.show(),d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show(),d._error({type:b.jPlayer.error.URL,context:d.status.src,message:b.jPlayer.errorMsg.URL,hint:b.jPlayer.errorHint.URL})},!1);b.each(b.jPlayer.htmlEvent,function(e,g){a.addEventListener(this,function(){c.gate&&d._trigger(b.jPlayer.event[g])},!1)})},_getHtmlStatus:function(a,b){var d=0,e=0,g=0,f=0;if(a.duration)this.status.duration=a.duration;d=a.currentTime;
|
||||
e=this.status.duration>0?100*d/this.status.duration:0;typeof a.seekable==="object"&&a.seekable.length>0?(g=this.status.duration>0?100*a.seekable.end(a.seekable.length-1)/this.status.duration:100,f=100*a.currentTime/a.seekable.end(a.seekable.length-1)):(g=100,f=e);b&&(e=f=d=0);this.status.seekPercent=g;this.status.currentPercentRelative=f;this.status.currentPercentAbsolute=e;this.status.currentTime=d;this.status.readyState=a.readyState;this.status.networkState=a.networkState;this.status.playbackRate=
|
||||
a.playbackRate;this.status.ended=a.ended},_resetStatus:function(){this.status=b.extend({},this.status,b.jPlayer.prototype.status)},_trigger:function(a,c,d){a=b.Event(a);a.jPlayer={};a.jPlayer.version=b.extend({},this.version);a.jPlayer.options=b.extend(!0,{},this.options);a.jPlayer.status=b.extend(!0,{},this.status);a.jPlayer.html=b.extend(!0,{},this.html);a.jPlayer.flash=b.extend(!0,{},this.flash);if(c)a.jPlayer.error=b.extend({},c);if(d)a.jPlayer.warning=b.extend({},d);this.element.trigger(a)},
|
||||
jPlayerFlashEvent:function(a,c){if(a===b.jPlayer.event.ready)if(this.internal.ready){if(this.flash.gate){if(this.status.srcSet){var d=this.status.currentTime,e=this.status.paused;this.setMedia(this.status.media);d>0&&(e?this.pause(d):this.play(d))}this._trigger(b.jPlayer.event.flashreset)}}else this.internal.ready=!0,this.internal.flash.jq.css({width:"0px",height:"0px"}),this.version.flash=c.version,this.version.needFlash!==this.version.flash&&this._error({type:b.jPlayer.error.VERSION,context:this.version.flash,
|
||||
message:b.jPlayer.errorMsg.VERSION+this.version.flash,hint:b.jPlayer.errorHint.VERSION}),this._trigger(b.jPlayer.event.repeat),this._trigger(a);if(this.flash.gate)switch(a){case b.jPlayer.event.progress:this._getFlashStatus(c);this._updateInterface();this._trigger(a);break;case b.jPlayer.event.timeupdate:this._getFlashStatus(c);this._updateInterface();this._trigger(a);break;case b.jPlayer.event.play:this._seeked();this._updateButtons(!0);this._trigger(a);break;case b.jPlayer.event.pause:this._updateButtons(!1);
|
||||
this._trigger(a);break;case b.jPlayer.event.ended:this._updateButtons(!1);this._trigger(a);break;case b.jPlayer.event.click:this._trigger(a);break;case b.jPlayer.event.error:this.status.waitForLoad=!0;this.status.waitForPlay=!0;this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._validString(this.status.media.poster)&&this.internal.poster.jq.show();this.css.jq.videoPlay.length&&this.status.video&&this.css.jq.videoPlay.show();this.status.video?this._flash_setVideo(this.status.media):
|
||||
this._flash_setAudio(this.status.media);this._updateButtons(!1);this._error({type:b.jPlayer.error.URL,context:c.src,message:b.jPlayer.errorMsg.URL,hint:b.jPlayer.errorHint.URL});break;case b.jPlayer.event.seeking:this._seeking();this._trigger(a);break;case b.jPlayer.event.seeked:this._seeked();this._trigger(a);break;case b.jPlayer.event.ready:break;default:this._trigger(a)}return!1},_getFlashStatus:function(a){this.status.seekPercent=a.seekPercent;this.status.currentPercentRelative=a.currentPercentRelative;
|
||||
this.status.currentPercentAbsolute=a.currentPercentAbsolute;this.status.currentTime=a.currentTime;this.status.duration=a.duration;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=!1},_updateButtons:function(a){if(a!==f)this.status.paused=!a,this.css.jq.play.length&&this.css.jq.pause.length&&(a?(this.css.jq.play.hide(),this.css.jq.pause.show()):(this.css.jq.play.show(),this.css.jq.pause.hide()));this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length&&
|
||||
(this.status.noFullScreen?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.hide()):this.options.fullScreen?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.show()):(this.css.jq.fullScreen.show(),this.css.jq.restoreScreen.hide()));this.css.jq.repeat.length&&this.css.jq.repeatOff.length&&(this.options.loop?(this.css.jq.repeat.hide(),this.css.jq.repeatOff.show()):(this.css.jq.repeat.show(),this.css.jq.repeatOff.hide()))},_updateInterface:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+
|
||||
"%");this.css.jq.playBar.length&&this.css.jq.playBar.width(this.status.currentPercentRelative+"%");this.css.jq.currentTime.length&&this.css.jq.currentTime.text(b.jPlayer.convertTime(this.status.currentTime));this.css.jq.duration.length&&this.css.jq.duration.text(b.jPlayer.convertTime(this.status.duration))},_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg")},
|
||||
_resetGate:function(){this.html.audio.gate=!1;this.html.video.gate=!1;this.flash.gate=!1},_resetActive:function(){this.html.active=!1;this.flash.active=!1},setMedia:function(a){var c=this,d=!1,e=this.status.media.poster!==a.poster;this._resetMedia();this._resetGate();this._resetActive();b.each(this.formats,function(e,f){var i=c.format[f].media==="video";b.each(c.solutions,function(b,e){if(c[e].support[f]&&c._validString(a[f])){var g=e==="html";i?(g?(c.html.video.gate=!0,c._html_setVideo(a),c.html.active=
|
||||
!0):(c.flash.gate=!0,c._flash_setVideo(a),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.show(),c.status.video=!0):(g?(c.html.audio.gate=!0,c._html_setAudio(a),c.html.active=!0):(c.flash.gate=!0,c._flash_setAudio(a),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.hide(),c.status.video=!1);d=!0;return!1}});if(d)return!1});if(d){if((!this.status.nativeVideoControls||!this.html.video.gate)&&this._validString(a.poster))e?this.htmlElement.poster.src=a.poster:this.internal.poster.jq.show();
|
||||
this.status.srcSet=!0;this.status.media=b.extend({},a);this._updateButtons(!1);this._updateInterface()}else this._error({type:b.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:b.jPlayer.errorMsg.NO_SUPPORT,hint:b.jPlayer.errorHint.NO_SUPPORT})},_resetMedia:function(){this._resetStatus();this._updateButtons(!1);this._updateInterface();this._seeked();this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);this.html.active?this._html_resetMedia():this.flash.active&&
|
||||
this._flash_resetMedia()},clearMedia:function(){this._resetMedia();this.html.active?this._html_clearMedia():this.flash.active&&this._flash_clearMedia();this._resetGate();this._resetActive()},load:function(){this.status.srcSet?this.html.active?this._html_load():this.flash.active&&this._flash_load():this._urlNotSetError("load")},play:function(a){a=typeof a==="number"?a:NaN;this.status.srcSet?this.html.active?this._html_play(a):this.flash.active&&this._flash_play(a):this._urlNotSetError("play")},videoPlay:function(){this.play()},
|
||||
pause:function(a){a=typeof a==="number"?a:NaN;this.status.srcSet?this.html.active?this._html_pause(a):this.flash.active&&this._flash_pause(a):this._urlNotSetError("pause")},pauseOthers:function(){var a=this;b.each(this.instances,function(b,d){a.element!==d&&d.data("jPlayer").status.srcSet&&d.jPlayer("pause")})},stop:function(){this.status.srcSet?this.html.active?this._html_pause(0):this.flash.active&&this._flash_pause(0):this._urlNotSetError("stop")},playHead:function(a){a=this._limitValue(a,0,100);
|
||||
this.status.srcSet?this.html.active?this._html_playHead(a):this.flash.active&&this._flash_playHead(a):this._urlNotSetError("playHead")},_muted:function(a){this.options.muted=a;this.html.used&&this._html_mute(a);this.flash.used&&this._flash_mute(a);!this.html.video.gate&&!this.html.audio.gate&&(this._updateMute(a),this._updateVolume(this.options.volume),this._trigger(b.jPlayer.event.volumechange))},mute:function(a){a=a===f?!0:!!a;this._muted(a)},unmute:function(a){a=a===f?!0:!!a;this._muted(!a)},_updateMute:function(a){if(a===
|
||||
f)a=this.options.muted;this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.noVolume?(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):a?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(a){a=this._limitValue(a,0,1);this.options.volume=a;this.html.used&&this._html_volume(a);this.flash.used&&this._flash_volume(a);!this.html.video.gate&&!this.html.audio.gate&&(this._updateVolume(a),this._trigger(b.jPlayer.event.volumechange))},
|
||||
volumeBar:function(a){if(this.css.jq.volumeBar.length){var b=this.css.jq.volumeBar.offset(),d=a.pageX-b.left,e=this.css.jq.volumeBar.width(),a=this.css.jq.volumeBar.height()-a.pageY+b.top,b=this.css.jq.volumeBar.height();this.options.verticalVolume?this.volume(a/b):this.volume(d/e)}this.options.muted&&this._muted(!1)},volumeBarValue:function(a){this.volumeBar(a)},_updateVolume:function(a){if(a===f)a=this.options.volume;a=this.options.muted?0:a;this.status.noVolume?(this.css.jq.volumeBar.length&&this.css.jq.volumeBar.hide(),
|
||||
this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.hide(),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.hide()):(this.css.jq.volumeBar.length&&this.css.jq.volumeBar.show(),this.css.jq.volumeBarValue.length&&(this.css.jq.volumeBarValue.show(),this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"](a*100+"%")),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.show())},volumeMax:function(){this.volume(1);this.options.muted&&this._muted(!1)},_cssSelectorAncestor:function(a){var c=
|
||||
this;this.options.cssSelectorAncestor=a;this._removeUiClass();this.ancestorJq=a?b(a):[];a&&this.ancestorJq.length!==1&&this._warning({type:b.jPlayer.warning.CSS_SELECTOR_COUNT,context:a,message:b.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:b.jPlayer.warningHint.CSS_SELECTOR_COUNT});this._addUiClass();b.each(this.options.cssSelector,function(a,b){c._cssSelector(a,b)})},_cssSelector:function(a,c){var d=this;typeof c==="string"?b.jPlayer.prototype.options.cssSelector[a]?
|
||||
(this.css.jq[a]&&this.css.jq[a].length&&this.css.jq[a].unbind(".jPlayer"),this.options.cssSelector[a]=c,this.css.cs[a]=this.options.cssSelectorAncestor+" "+c,this.css.jq[a]=c?b(this.css.cs[a]):[],this.css.jq[a].length&&this.css.jq[a].bind("click.jPlayer",function(c){d[a](c);b(this).blur();return!1}),c&&this.css.jq[a].length!==1&&this._warning({type:b.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[a],message:b.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[a].length+" found for "+a+" method.",
|
||||
hint:b.jPlayer.warningHint.CSS_SELECTOR_COUNT})):this._warning({type:b.jPlayer.warning.CSS_SELECTOR_METHOD,context:a,message:b.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:b.jPlayer.warningHint.CSS_SELECTOR_METHOD}):this._warning({type:b.jPlayer.warning.CSS_SELECTOR_STRING,context:c,message:b.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:b.jPlayer.warningHint.CSS_SELECTOR_STRING})},seekBar:function(a){if(this.css.jq.seekBar){var b=this.css.jq.seekBar.offset(),a=a.pageX-b.left,b=this.css.jq.seekBar.width();
|
||||
this.playHead(100*a/b)}},playBar:function(a){this.seekBar(a)},repeat:function(){this._loop(!0)},repeatOff:function(){this._loop(!1)},_loop:function(a){if(this.options.loop!==a)this.options.loop=a,this._updateButtons(),this._trigger(b.jPlayer.event.repeat)},currentTime:function(){},duration:function(){},gui:function(){},noSolution:function(){},option:function(a,c){var d=a;if(arguments.length===0)return b.extend(!0,{},this.options);if(typeof a==="string"){var e=a.split(".");if(c===f){for(var d=b.extend(!0,
|
||||
{},this.options),g=0;g<e.length;g++)if(d[e[g]]!==f)d=d[e[g]];else return this._warning({type:b.jPlayer.warning.OPTION_KEY,context:a,message:b.jPlayer.warningMsg.OPTION_KEY,hint:b.jPlayer.warningHint.OPTION_KEY}),f;return d}for(var g=d={},h=0;h<e.length;h++)h<e.length-1?(g[e[h]]={},g=g[e[h]]):g[e[h]]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,c){var d=this;switch(a){case "volume":this.volume(c);
|
||||
break;case "muted":this._muted(c);break;case "cssSelectorAncestor":this._cssSelectorAncestor(c);break;case "cssSelector":b.each(c,function(a,b){d._cssSelector(a,b)});break;case "fullScreen":this.options[a]!==c&&(this._removeUiClass(),this.options[a]=c,this._refreshSize());break;case "size":!this.options.fullScreen&&this.options[a].cssClass!==c.cssClass&&this._removeUiClass();this.options[a]=b.extend({},this.options[a],c);this._refreshSize();break;case "sizeFull":this.options.fullScreen&&this.options[a].cssClass!==
|
||||
c.cssClass&&this._removeUiClass();this.options[a]=b.extend({},this.options[a],c);this._refreshSize();break;case "autohide":this.options[a]=b.extend({},this.options[a],c);this._updateAutohide();break;case "loop":this._loop(c);break;case "nativeVideoControls":this.options[a]=b.extend({},this.options[a],c);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this._restrictNativeVideoControls();this._updateNativeVideoControls();break;case "noFullScreen":this.options[a]=
|
||||
b.extend({},this.options[a],c);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullScreen=this._uaBlocklist(this.options.noFullScreen);this._restrictNativeVideoControls();this._updateButtons();break;case "noVolume":this.options[a]=b.extend({},this.options[a],c);this.status.noVolume=this._uaBlocklist(this.options.noVolume);this._updateVolume();this._updateMute();break;case "emulateHtml":this.options[a]!==c&&((this.options[a]=c)?this._emulateHtmlBridge():
|
||||
this._destroyHtmlBridge())}return this},_refreshSize:function(){this._setSize();this._addUiClass();this._updateSize();this._updateButtons();this._updateAutohide();this._trigger(b.jPlayer.event.resize)},_setSize:function(){this.options.fullScreen?(this.status.width=this.options.sizeFull.width,this.status.height=this.options.sizeFull.height,this.status.cssClass=this.options.sizeFull.cssClass):(this.status.width=this.options.size.width,this.status.height=this.options.size.height,this.status.cssClass=
|
||||
this.options.size.cssClass);this.element.css({width:this.status.width,height:this.status.height})},_addUiClass:function(){this.ancestorJq.length&&this.ancestorJq.addClass(this.status.cssClass)},_removeUiClass:function(){this.ancestorJq.length&&this.ancestorJq.removeClass(this.status.cssClass)},_updateSize:function(){this.internal.poster.jq.css({width:this.status.width,height:this.status.height});!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&
|
||||
this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):!this.status.waitForPlay&&this.flash.active&&this.status.video&&this.internal.flash.jq.css({width:this.status.width,height:this.status.height})},_updateAutohide:function(){var a=this,b=function(){a.css.jq.gui.fadeIn(a.options.autohide.fadeIn,function(){clearTimeout(a.internal.autohideId);a.internal.autohideId=setTimeout(function(){a.css.jq.gui.fadeOut(a.options.autohide.fadeOut)},a.options.autohide.hold)})};
|
||||
this.css.jq.gui.length&&(this.css.jq.gui.stop(!0,!0),clearTimeout(this.internal.autohideId),this.element.unbind(".jPlayerAutohide"),this.css.jq.gui.unbind(".jPlayerAutohide"),this.status.nativeVideoControls?this.css.jq.gui.hide():this.options.fullScreen&&this.options.autohide.full||!this.options.fullScreen&&this.options.autohide.restored?(this.element.bind("mousemove.jPlayer.jPlayerAutohide",b),this.css.jq.gui.bind("mousemove.jPlayer.jPlayerAutohide",b),this.css.jq.gui.hide()):this.css.jq.gui.show())},
|
||||
fullScreen:function(){this._setOption("fullScreen",!0)},restoreScreen:function(){this._setOption("fullScreen",!1)},_html_initMedia:function(){this.htmlElement.media.src=this.status.src;this.options.preload!=="none"&&this._html_load();this._trigger(b.jPlayer.event.timeupdate)},_html_setAudio:function(a){var c=this;b.each(this.formats,function(b,e){if(c.html.support[e]&&a[e])return c.status.src=a[e],c.status.format[e]=!0,c.status.formatType=e,!1});this.htmlElement.media=this.htmlElement.audio;this._html_initMedia()},
|
||||
_html_setVideo:function(a){var c=this;b.each(this.formats,function(b,e){if(c.html.support[e]&&a[e])return c.status.src=a[e],c.status.format[e]=!0,c.status.formatType=e,!1});if(this.status.nativeVideoControls)this.htmlElement.video.poster=this._validString(a.poster)?a.poster:"";this.htmlElement.media=this.htmlElement.video;this._html_initMedia()},_html_resetMedia:function(){this.htmlElement.media&&(this.htmlElement.media.id===this.internal.video.id&&!this.status.nativeVideoControls&&this.internal.video.jq.css({width:"0px",
|
||||
height:"0px"}),this.htmlElement.media.pause())},_html_clearMedia:function(){if(this.htmlElement.media)this.htmlElement.media.src="",this.htmlElement.media.load()},_html_load:function(){if(this.status.waitForLoad)this.status.waitForLoad=!1,this.htmlElement.media.load();clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(a){var b=this;this._html_load();this.htmlElement.media.play();if(!isNaN(a))try{this.htmlElement.media.currentTime=a}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.play(a)},
|
||||
100);return}this._html_checkWaitForPlay()},_html_pause:function(a){var b=this;a>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId);this.htmlElement.media.pause();if(!isNaN(a))try{this.htmlElement.media.currentTime=a}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.pause(a)},100);return}a>0&&this._html_checkWaitForPlay()},_html_playHead:function(a){var b=this;this._html_load();try{if(typeof this.htmlElement.media.seekable==="object"&&this.htmlElement.media.seekable.length>0)this.htmlElement.media.currentTime=
|
||||
a*this.htmlElement.media.seekable.end(this.htmlElement.media.seekable.length-1)/100;else if(this.htmlElement.media.duration>0&&!isNaN(this.htmlElement.media.duration))this.htmlElement.media.currentTime=a*this.htmlElement.media.duration/100;else throw"e";}catch(d){this.internal.htmlDlyCmdId=setTimeout(function(){b.playHead(a)},100);return}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){if(this.status.waitForPlay)this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&
|
||||
this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height}))},_html_volume:function(a){if(this.html.audio.available)this.htmlElement.audio.volume=a;if(this.html.video.available)this.htmlElement.video.volume=a},_html_mute:function(a){if(this.html.audio.available)this.htmlElement.audio.muted=a;if(this.html.video.available)this.htmlElement.video.muted=a},_flash_setAudio:function(a){var c=this;try{if(b.each(this.formats,
|
||||
function(b,d){if(c.flash.support[d]&&a[d]){switch(d){case "m4a":case "fla":c._getMovie().fl_setAudio_m4a(a[d]);break;case "mp3":c._getMovie().fl_setAudio_mp3(a[d])}c.status.src=a[d];c.status.format[d]=!0;c.status.formatType=d;return!1}}),this.options.preload==="auto")this._flash_load(),this.status.waitForLoad=!1}catch(d){this._flashError(d)}},_flash_setVideo:function(a){var c=this;try{if(b.each(this.formats,function(b,d){if(c.flash.support[d]&&a[d]){switch(d){case "m4v":case "flv":c._getMovie().fl_setVideo_m4v(a[d])}c.status.src=
|
||||
a[d];c.status.format[d]=!0;c.status.formatType=d;return!1}}),this.options.preload==="auto")this._flash_load(),this.status.waitForLoad=!1}catch(d){this._flashError(d)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"});this._flash_pause(NaN)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(a){this._flashError(a)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(a){this._flashError(a)}this.status.waitForLoad=!1},_flash_play:function(a){try{this._getMovie().fl_play(a)}catch(b){this._flashError(b)}this.status.waitForLoad=
|
||||
!1;this._flash_checkWaitForPlay()},_flash_pause:function(a){try{this._getMovie().fl_pause(a)}catch(b){this._flashError(b)}if(a>0)this.status.waitForLoad=!1,this._flash_checkWaitForPlay()},_flash_playHead:function(a){try{this._getMovie().fl_play_head(a)}catch(b){this._flashError(b)}this.status.waitForLoad||this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){if(this.status.waitForPlay)this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&
|
||||
(this.internal.poster.jq.hide(),this.internal.flash.jq.css({width:this.status.width,height:this.status.height}))},_flash_volume:function(a){try{this._getMovie().fl_volume(a)}catch(b){this._flashError(b)}},_flash_mute:function(a){try{this._getMovie().fl_mute(a)}catch(b){this._flashError(b)}},_getMovie:function(){return document[this.internal.flash.id]},_checkForFlash:function(a){var b=!1,d;if(window.ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+a),b=!0}catch(e){}else navigator.plugins&&
|
||||
navigator.mimeTypes.length>0&&(d=navigator.plugins["Shockwave Flash"])&&navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")>=a&&(b=!0);return b},_validString:function(a){return a&&typeof a==="string"},_limitValue:function(a,b,d){return a<b?b:a>d?d:a},_urlNotSetError:function(a){this._error({type:b.jPlayer.error.URL_NOT_SET,context:a,message:b.jPlayer.errorMsg.URL_NOT_SET,hint:b.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(a){var c;c=this.internal.ready?"FLASH_DISABLED":
|
||||
"FLASH";this._error({type:b.jPlayer.error[c],context:this.internal.flash.swf,message:b.jPlayer.errorMsg[c]+a.message,hint:b.jPlayer.errorHint[c]});this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(a){this._trigger(b.jPlayer.event.error,a);this.options.errorAlerts&&this._alert("Error!"+(a.message?"\n\n"+a.message:"")+(a.hint?"\n\n"+a.hint:"")+"\n\nContext: "+a.context)},_warning:function(a){this._trigger(b.jPlayer.event.warning,f,a);this.options.warningAlerts&&this._alert("Warning!"+
|
||||
(a.message?"\n\n"+a.message:"")+(a.hint?"\n\n"+a.hint:"")+"\n\nContext: "+a.context)},_alert:function(a){alert("jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+a)},_emulateHtmlBridge:function(){var a=this;b.each(b.jPlayer.emulateMethods.split(/\s+/g),function(b,d){a.internal.domNode[d]=function(b){a[d](b)}});b.each(b.jPlayer.event,function(c,d){var e=!0;b.each(b.jPlayer.reservedEvent.split(/\s+/g),function(a,b){if(b===c)return e=!1});e&&a.element.bind(d+".jPlayer.jPlayerHtml",
|
||||
function(){a._emulateHtmlUpdate();var b=document.createEvent("Event");b.initEvent(c,!1,!0);a.internal.domNode.dispatchEvent(b)})})},_emulateHtmlUpdate:function(){var a=this;b.each(b.jPlayer.emulateStatus.split(/\s+/g),function(b,d){a.internal.domNode[d]=a.status[d]});b.each(b.jPlayer.emulateOptions.split(/\s+/g),function(b,d){a.internal.domNode[d]=a.options[d]})},_destroyHtmlBridge:function(){var a=this;this.element.unbind(".jPlayerHtml");b.each((b.jPlayer.emulateMethods+" "+b.jPlayer.emulateStatus+
|
||||
" "+b.jPlayer.emulateOptions).split(/\s+/g),function(b,d){delete a.internal.domNode[d]})}};b.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};b.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",
|
||||
NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+b.jPlayer.prototype.version.script+" needs Jplayer.swf version "+b.jPlayer.prototype.version.needFlash+" but found "};b.jPlayer.errorHint=
|
||||
{FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};b.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",
|
||||
CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};b.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};b.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",
|
||||
CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}})(jQuery);
|
|
@ -14,6 +14,48 @@
|
|||
* Date: 20th December 2010
|
||||
*/
|
||||
|
||||
.jp-container {
|
||||
background: #282828;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.jp-logo {
|
||||
width:380px;
|
||||
height: 67px;
|
||||
background:#282828 url(../../../css/images/airtime_logo_jp.png) no-repeat 120px 14px;
|
||||
background: url(../../../css/images/airtime_logo_jp.png) no-repeat 120px 14px, -moz-radial-gradient(200px 0px, circle cover, rgba(70,70,70,1) 0%, rgba(40,40,40,1) 90%);
|
||||
background: url(../../../css/images/airtime_logo_jp.png) no-repeat 120px 14px, -webkit-radial-gradient(170px 20px, rgba(70,70,70,1) 0%,rgba(40,40,40,1) 70%);
|
||||
display:block;
|
||||
}
|
||||
.jp-stream {
|
||||
height: 18px;
|
||||
display:block;
|
||||
border-top:1px solid #050505;
|
||||
color:#ff5d1a;
|
||||
font-size:12px;
|
||||
padding:6px 4px 4px 10px;
|
||||
background:#313131;
|
||||
background: -moz-linear-gradient(top, #292929 0, #3a3a3a 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #292929), color-stop(100%, #3a3a3a));
|
||||
box-shadow: rgba(248,248,248,.3) 0px 1px 0px, rgba(0, 0, 0, 0.2) 0 2px 2px inset;
|
||||
-moz-box-shadow: rgba(0, 0, 0, 0.7) 0 0 5px inset;
|
||||
-webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 0 5px inset;
|
||||
}
|
||||
.jp-stream-text,
|
||||
.jp-stream form {
|
||||
float:left;
|
||||
}
|
||||
.jp-stream form {
|
||||
margin-left:10px;
|
||||
}
|
||||
.jp-stream label {
|
||||
color:#ababab;
|
||||
padding: 0 10px 0 0;
|
||||
font-size:12px;
|
||||
}
|
||||
.jp-stream label input[type="radio"] {
|
||||
}
|
||||
div.jp-audio,
|
||||
div.jp-video {
|
||||
|
||||
|
@ -28,7 +70,7 @@ div.jp-video {
|
|||
color: #666;
|
||||
}
|
||||
div.jp-audio {
|
||||
width:180px;
|
||||
/*width:180px;*/
|
||||
}
|
||||
div.jp-video-270p {
|
||||
width:480px;
|
||||
|
@ -38,14 +80,17 @@ div.jp-video-360p {
|
|||
}
|
||||
div.jp-interface {
|
||||
position: relative;
|
||||
background-color:#eee;
|
||||
background-color:#3D3D3D;
|
||||
background: -moz-linear-gradient(top, #4e4e4e 0, #3a3a3a 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #4e4e4e), color-stop(100%, #3a3a3a));
|
||||
/* width:418px; */
|
||||
width:100%;
|
||||
border:1px solid #009be3;
|
||||
border-top:1px solid #7c7c7c;
|
||||
border-bottom:1px solid #1a1a1a;
|
||||
}
|
||||
div.jp-audio div.jp-type-single div.jp-interface {
|
||||
height:80px;
|
||||
border-bottom:none;
|
||||
height:70px;
|
||||
/*border-bottom:none;*/
|
||||
}
|
||||
div.jp-audio div.jp-type-playlist div.jp-interface {
|
||||
height:80px;
|
||||
|
@ -73,13 +118,13 @@ div.jp-interface ul.jp-controls a {
|
|||
}
|
||||
a.jp-play,
|
||||
a.jp-pause {
|
||||
width:40px;
|
||||
width:75px;
|
||||
height:40px;
|
||||
z-index:1;
|
||||
}
|
||||
div.jp-audio div.jp-type-single a.jp-play,
|
||||
div.jp-audio div.jp-type-single a.jp-pause {
|
||||
top:20px;
|
||||
top:15px;
|
||||
left:40px;
|
||||
}
|
||||
div.jp-audio div.jp-type-playlist a.jp-play,
|
||||
|
@ -108,17 +153,17 @@ div.jp-video-360p div.jp-type-playlist a.jp-pause {
|
|||
left:300px;
|
||||
}
|
||||
a.jp-play {
|
||||
background: url("jplayer.blue.monday.jpg") 0 0 no-repeat;
|
||||
background: url("jplayer.png") 0 0 no-repeat;
|
||||
}
|
||||
a.jp-play:hover {
|
||||
background: url("jplayer.blue.monday.jpg") -41px 0 no-repeat;
|
||||
background: url("jplayer.png") -75px 0 no-repeat;
|
||||
}
|
||||
a.jp-pause {
|
||||
background: url("jplayer.blue.monday.jpg") 0 -42px no-repeat;
|
||||
background: url("jplayer.png") 0 -40px no-repeat;
|
||||
display: none;
|
||||
}
|
||||
a.jp-pause:hover {
|
||||
background: url("jplayer.blue.monday.jpg") -41px -42px no-repeat;
|
||||
background: url("jplayer.png") -75px -40px no-repeat;
|
||||
}
|
||||
div.jp-audio div.jp-type-single a.jp-stop {
|
||||
top:26px;
|
||||
|
@ -144,13 +189,13 @@ div.jp-video-360p div.jp-type-playlist a.jp-stop {
|
|||
left:378px;
|
||||
}
|
||||
a.jp-stop {
|
||||
background: url("jplayer.blue.monday.jpg") 0 -83px no-repeat;
|
||||
background: url("jplayer.png") 0 -83px no-repeat;
|
||||
width:28px;
|
||||
height:28px;
|
||||
z-index:1;
|
||||
}
|
||||
a.jp-stop:hover {
|
||||
background: url("jplayer.blue.monday.jpg") -29px -83px no-repeat;
|
||||
background: url("jplayer.png") -29px -83px no-repeat;
|
||||
}
|
||||
div.jp-audio div.jp-type-playlist a.jp-previous {
|
||||
left:20px;
|
||||
|
@ -166,12 +211,12 @@ div.jp-video-360p div.jp-type-playlist a.jp-previous {
|
|||
left:272px;
|
||||
}
|
||||
a.jp-previous {
|
||||
background: url("jplayer.blue.monday.jpg") 0 -112px no-repeat;
|
||||
background: url("jplayer.png") 0 -112px no-repeat;
|
||||
width:28px;
|
||||
height:28px;
|
||||
}
|
||||
a.jp-previous:hover {
|
||||
background: url("jplayer.blue.monday.jpg") -29px -112px no-repeat;
|
||||
background: url("jplayer.png") -29px -112px no-repeat;
|
||||
}
|
||||
div.jp-audio div.jp-type-playlist a.jp-next {
|
||||
left:88px;
|
||||
|
@ -187,12 +232,12 @@ div.jp-video-360p div.jp-type-playlist a.jp-next {
|
|||
left:340px;
|
||||
}
|
||||
a.jp-next {
|
||||
background: url("jplayer.blue.monday.jpg") 0 -141px no-repeat;
|
||||
background: url("jplayer.png") 0 -141px no-repeat;
|
||||
width:28px;
|
||||
height:28px;
|
||||
}
|
||||
a.jp-next:hover {
|
||||
background: url("jplayer.blue.monday.jpg") -29px -141px no-repeat;
|
||||
background: url("jplayer.png") -29px -141px no-repeat;
|
||||
}
|
||||
div.jp-progress {
|
||||
position: absolute;
|
||||
|
@ -218,14 +263,14 @@ div.jp-video div.jp-progress {
|
|||
height:10px;
|
||||
}
|
||||
div.jp-seek-bar {
|
||||
background: url("jplayer.blue.monday.jpg") 0 -202px repeat-x;
|
||||
background: url("jplayer.png") 0 -202px repeat-x;
|
||||
width:0px;
|
||||
/* height:15px; */
|
||||
height:100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
div.jp-play-bar {
|
||||
background: url("jplayer.blue.monday.jpg") 0 -218px repeat-x ;
|
||||
background: url("jplayer.png") 0 -218px repeat-x ;
|
||||
width:0px;
|
||||
/* height:15px; */
|
||||
height:100%;
|
||||
|
@ -238,13 +283,13 @@ div.jp-seeking-bg {
|
|||
|
||||
a.jp-mute,
|
||||
a.jp-unmute {
|
||||
width:18px;
|
||||
height:15px;
|
||||
width:30px;
|
||||
height:30px;
|
||||
}
|
||||
div.jp-audio div.jp-type-single a.jp-mute,
|
||||
div.jp-audio div.jp-type-single a.jp-unmute {
|
||||
top:32px;
|
||||
left:124px;
|
||||
top:22px;
|
||||
left:300px;
|
||||
}
|
||||
div.jp-audio div.jp-type-playlist a.jp-mute,
|
||||
div.jp-audio div.jp-type-playlist a.jp-unmute {
|
||||
|
@ -272,22 +317,22 @@ div.jp-video-360p div.jp-type-playlist a.jp-unmute {
|
|||
left:443px;
|
||||
}
|
||||
a.jp-mute {
|
||||
background: url("jplayer.blue.monday.jpg") 0 -186px no-repeat;
|
||||
background: url("jplayer.png") 0 -110px no-repeat;
|
||||
}
|
||||
a.jp-mute:hover {
|
||||
background: url("jplayer.blue.monday.jpg") -19px -170px no-repeat;
|
||||
background: url("jplayer.png") -30px -80px no-repeat;
|
||||
}
|
||||
a.jp-unmute {
|
||||
background: url("jplayer.blue.monday.jpg") 0 -170px no-repeat;
|
||||
background: url("jplayer.png") 0 -80px no-repeat;
|
||||
display: none;
|
||||
}
|
||||
a.jp-unmute:hover {
|
||||
background: url("jplayer.blue.monday.jpg") -19px -186px no-repeat;
|
||||
background: url("jplayer.png") -30px -110px no-repeat;
|
||||
}
|
||||
div.jp-volume-bar {
|
||||
position: absolute;
|
||||
overflow:hidden;
|
||||
background: url("jplayer.blue.monday.jpg") 0 -250px repeat-x;
|
||||
background: url("jplayer.png") 0 -250px repeat-x;
|
||||
width:46px;
|
||||
height:5px;
|
||||
cursor: pointer;
|
||||
|
@ -316,7 +361,7 @@ div.jp-video-360p div.jp-type-playlist div.jp-volume-bar {
|
|||
left:471px;
|
||||
}
|
||||
div.jp-volume-bar-value {
|
||||
background: url("jplayer.blue.monday.jpg") 0 -256px repeat-x;
|
||||
background: url("jplayer.png") 0 -256px repeat-x;
|
||||
width:0px;
|
||||
height:5px;
|
||||
}
|
||||
|
@ -352,7 +397,7 @@ div.jp-playlist {
|
|||
/* width:418px; */
|
||||
width:100%;
|
||||
background-color:#ccc;
|
||||
border:1px solid #009be3;
|
||||
/*border:1px solid #009be3;*/
|
||||
border-top:none;
|
||||
}
|
||||
div.jp-playlist ul {
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
|
@ -18,6 +18,8 @@ rm -rf "/var/tmp/airtime"
|
|||
rm -rf "/opt/pypo"
|
||||
rm -rf "/opt/recorder"
|
||||
rm -rf "/srv/airtime"
|
||||
rm -rf "/etc/monit/conf.d/airtime-monit.cfg"
|
||||
rm -rf /etc/monit/conf.d/monit-airtime-*
|
||||
|
||||
echo "DROP DATABASE AIRTIME;" | su postgres -c psql
|
||||
echo "DROP LANGUAGE plpgsql;" | su postgres -c psql
|
||||
|
|
|
@ -27,7 +27,7 @@ apt-get -y install tar gzip curl apache2 php5-pgsql libapache2-mod-php5 \
|
|||
php-pear php5-gd postgresql odbc-postgresql python2.6 lame libsoundtouch-ocaml \
|
||||
libmp3lame-dev libtaglib-ocaml libao-ocaml libmad-ocaml ecasound \
|
||||
libesd0 icecast2 libportaudio2 libsamplerate0 rabbitmq-server patch \
|
||||
php5-curl mpg123 monit python-virtualenv
|
||||
php5-curl mpg123 monit python-virtualenv multitail
|
||||
|
||||
#possibly remove?
|
||||
#libvorbis-ocaml-dev
|
||||
|
@ -74,16 +74,14 @@ echo "4. Enable Monit"
|
|||
echo "----------------------------------------------------"
|
||||
cd /etc/default/
|
||||
sed -i 's/startup=0/startup=1/g' monit
|
||||
cp $SCRIPTPATH/../../python_apps/monit/airtime-monit.cfg /etc/monit/conf.d
|
||||
|
||||
grep -q "include /etc/monit/conf.d" /etc/monit/monitrc
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -ne 0 ] ; then
|
||||
mkdir -p /etc/monit/conf.d
|
||||
echo "include /etc/monit/conf.d/*" >> /etc/monit/monitrc
|
||||
fi
|
||||
|
||||
service monit start
|
||||
|
||||
# Run Airtime Install
|
||||
echo "----------------------------------------------------"
|
||||
echo "5. Run Airtime Install"
|
||||
|
|
|
@ -42,13 +42,6 @@ elif [ "$result" -ne "0" ]; then
|
|||
fi
|
||||
set -e
|
||||
|
||||
# Need to ensure monit is running before Airtime daemons are run. This is
|
||||
# so we can ensure they can register with monit to monitor them when they start.
|
||||
# If monit is already running, this step is still useful as we need monit to
|
||||
# reload its config files.
|
||||
/etc/init.d/monit restart
|
||||
|
||||
|
||||
echo -e "\n*** API Client Installation ***"
|
||||
python ${SCRIPTPATH}/../python_apps/api_clients/install/api_client_install.py
|
||||
|
||||
|
@ -61,8 +54,20 @@ python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-install.py
|
|||
echo -e "\n*** Media Monitor Installation ***"
|
||||
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-install.py
|
||||
|
||||
monit monitor icecast2
|
||||
# Need to ensure monit is running before Airtime daemons are run. This is
|
||||
# so we can ensure they can register with monit to monitor them when they start.
|
||||
# If monit is already running, this step is still useful as we need monit to
|
||||
# reload its config files.
|
||||
/etc/init.d/monit restart
|
||||
|
||||
|
||||
set +e
|
||||
monit monitor airtime-media-monitor
|
||||
monit monitor airtime-liquidsoap
|
||||
monit monitor airtime-playout
|
||||
monit monitor airtime-show-recorder
|
||||
monit monitor rabbitmq-server
|
||||
set -e
|
||||
|
||||
echo -e "\n*** Verifying your system environment ***"
|
||||
sleep 10
|
||||
|
|
|
@ -25,8 +25,9 @@ SCRIPTPATH=`dirname $SCRIPT`
|
|||
|
||||
echo -e "\n******************************* Uninstall Begin ********************************"
|
||||
|
||||
monit unmonitor icecast2 >/dev/null 2>&1
|
||||
set +e
|
||||
monit unmonitor rabbitmq-server >/dev/null 2>&1
|
||||
set -e
|
||||
|
||||
echo -e "\n*** Uninstalling Pypo ***"
|
||||
python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-uninstall.py
|
||||
|
|
|
@ -120,13 +120,6 @@ class AirtimeIni
|
|||
chmod($filename, 0640));
|
||||
}
|
||||
|
||||
public static function CreateMonitFile(){
|
||||
if (!copy(__DIR__."/../../python_apps/monit/airtime-monit.cfg", AirtimeIni::CONF_FILE_MONIT)){
|
||||
echo "Could not copy airtime-monit.cfg to /etc/monit/conf.d/. Exiting.";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function RemoveMonitFile(){
|
||||
@unlink("/etc/monit/conf.d/airtime-monit.cfg");
|
||||
}
|
||||
|
|
|
@ -110,8 +110,6 @@ if ($overwrite) {
|
|||
echo "* Creating INI files".PHP_EOL;
|
||||
AirtimeIni::CreateIniFiles();
|
||||
}
|
||||
AirtimeIni::CreateMonitFile();
|
||||
|
||||
|
||||
AirtimeInstall::InstallPhpCode();
|
||||
AirtimeInstall::InstallBinaries();
|
||||
|
|
|
@ -238,7 +238,7 @@ class Airtime200Upgrade{
|
|||
}
|
||||
|
||||
public static function InstallAirtimePhpServerCode($phpDir)
|
||||
{
|
||||
{
|
||||
|
||||
$AIRTIME_SRC = realpath(__DIR__.'/../../../airtime_mvc');
|
||||
|
||||
|
@ -247,7 +247,11 @@ class Airtime200Upgrade{
|
|||
echo "* Installing PHP code to ".$phpDir.PHP_EOL;
|
||||
exec("mkdir -p ".$phpDir);
|
||||
exec("cp -R ".$AIRTIME_SRC."/* ".$phpDir);
|
||||
}
|
||||
}
|
||||
|
||||
public static function RemoveOldMonitFile(){
|
||||
unlink("/etc/monit/conf.d/airtime-monit.cfg");
|
||||
}
|
||||
}
|
||||
|
||||
class ConvertToUtc{
|
||||
|
@ -577,6 +581,8 @@ AirtimeInstall::SetDefaultStreamSetting();
|
|||
|
||||
AirtimeInstall::GetOldLiquidsoapCfgAndUpdate();
|
||||
|
||||
AirtimeUpgrade::RemoveOldMonitFile();
|
||||
|
||||
// restart monit
|
||||
exec("service monit restart");
|
||||
|
||||
|
|
|
@ -28,6 +28,10 @@ stop () {
|
|||
rm -f $PIDFILE
|
||||
}
|
||||
|
||||
start_no_monit() {
|
||||
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE --startas $DAEMON
|
||||
}
|
||||
|
||||
|
||||
case "${1:-''}" in
|
||||
'start')
|
||||
|
@ -49,6 +53,12 @@ case "${1:-''}" in
|
|||
start
|
||||
echo "Done."
|
||||
;;
|
||||
'start-no-monit')
|
||||
# restart commands here
|
||||
echo -n "Starting $NAME: "
|
||||
start_no_monit
|
||||
echo "Done."
|
||||
;;
|
||||
'status')
|
||||
# status commands here
|
||||
/usr/bin/airtime-check-system
|
||||
|
|
|
@ -39,6 +39,10 @@ def get_current_script_dir():
|
|||
index = current_script_dir.rindex('/')
|
||||
return current_script_dir[0:index]
|
||||
|
||||
def copy_monit_file(current_script_dir):
|
||||
shutil.copy("%s/../monit-airtime-media-monitor.cfg"%current_script_dir, "/etc/monit/conf.d/")
|
||||
shutil.copy("%s/../../monit/monit-airtime-generic.cfg"%current_script_dir, "/etc/monit/conf.d/")
|
||||
|
||||
|
||||
try:
|
||||
# load config file
|
||||
|
@ -50,6 +54,8 @@ try:
|
|||
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
copy_monit_file(current_script_dir)
|
||||
|
||||
p = Popen("/etc/init.d/airtime-media-monitor stop >/dev/null 2>&1", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
|
@ -72,7 +78,7 @@ try:
|
|||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
print "Waiting for processes to start..."
|
||||
p = Popen("/etc/init.d/airtime-media-monitor start", shell=True)
|
||||
p = Popen("/etc/init.d/airtime-media-monitor start-no-monit", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
except Exception, e:
|
||||
|
|
|
@ -18,6 +18,9 @@ def get_current_script_dir():
|
|||
index = current_script_dir.rindex('/')
|
||||
return current_script_dir[0:index]
|
||||
|
||||
def remove_monit_file():
|
||||
os.system("rm -f /etc/monit/conf.d/monit-airtime-media-monitor.cfg")
|
||||
|
||||
try:
|
||||
# load config file
|
||||
try:
|
||||
|
@ -30,6 +33,9 @@ try:
|
|||
os.system("rm -f /etc/init.d/airtime-media-monitor")
|
||||
os.system("update-rc.d -f airtime-media-monitor remove >/dev/null 2>&1")
|
||||
|
||||
print "Removing monit file"
|
||||
remove_monit_file()
|
||||
|
||||
print "Removing log directories"
|
||||
remove_path(config["log_dir"])
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
set daemon 10 # Poll at 5 second intervals
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set httpd port 2812
|
||||
|
||||
check process airtime-media-monitor
|
||||
with pidfile "/var/run/airtime-media-monitor.pid"
|
||||
start program = "/etc/init.d/airtime-media-monitor start" with timeout 10 seconds
|
||||
stop program = "/etc/init.d/airtime-media-monitor stop"
|
|
@ -1,31 +0,0 @@
|
|||
set daemon 10 # Poll at 5 second intervals
|
||||
#set logfile syslog facility log_daemon
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set httpd port 2812
|
||||
allow admin:monit
|
||||
|
||||
check process airtime-playout
|
||||
with pidfile "/var/run/airtime-playout.pid"
|
||||
start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds
|
||||
stop program = "/etc/init.d/airtime-playout stop"
|
||||
check process airtime-liquidsoap
|
||||
with pidfile "/var/run/airtime-liquidsoap.pid"
|
||||
start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds
|
||||
stop program = "/etc/init.d/airtime-playout stop"
|
||||
check process airtime-media-monitor
|
||||
with pidfile "/var/run/airtime-media-monitor.pid"
|
||||
start program = "/etc/init.d/airtime-media-monitor start" with timeout 10 seconds
|
||||
stop program = "/etc/init.d/airtime-media-monitor stop"
|
||||
check process airtime-show-recorder
|
||||
with pidfile "/var/run/airtime-show-recorder.pid"
|
||||
start program = "/etc/init.d/airtime-show-recorder start" with timeout 10 seconds
|
||||
stop program = "/etc/init.d/airtime-show-recorder stop"
|
||||
check process icecast2
|
||||
matching "/usr/bin/icecast2"
|
||||
start program = "/etc/init.d/icecast2 start" with timeout 10 seconds
|
||||
stop program = "/etc/init.d/icecast2 stop"
|
||||
check process rabbitmq-server
|
||||
with pidfile "/var/run/rabbitmq.pid"
|
||||
start program = "/bin/bash -c '/etc/init.d/rabbitmq-server start; sed "s/.*,\(.*\)\}.*/\1/" /var/lib/rabbitmq/pids > /var/run/rabbitmq.pid'"
|
||||
stop program = "/etc/init.d/rabbitmq-server stop"
|
|
@ -0,0 +1,10 @@
|
|||
set daemon 10 # Poll at 5 second intervals
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set httpd port 2812
|
||||
allow admin:monit
|
||||
|
||||
check process rabbitmq-server
|
||||
with pidfile "/var/run/rabbitmq.pid"
|
||||
start program = "/bin/bash -c '/etc/init.d/rabbitmq-server start; sed "s/.*,\(.*\)\}.*/\1/" /var/lib/rabbitmq/pids > /var/run/rabbitmq.pid'"
|
||||
stop program = "/etc/init.d/rabbitmq-server stop"
|
|
@ -0,0 +1,11 @@
|
|||
set daemon 10 # Poll at 5 second intervals
|
||||
#set logfile syslog facility log_daemon
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set httpd port 2812
|
||||
allow admin:monit
|
||||
|
||||
check process rabbitmq-server
|
||||
with pidfile "/var/run/rabbitmq.pid"
|
||||
start program = "/bin/bash -c '/etc/init.d/rabbitmq-server start; sed "s/.*,\(.*\)\}.*/\1/" /var/lib/rabbitmq/pids > /var/run/rabbitmq.pid'"
|
||||
stop program = "/etc/init.d/rabbitmq-server stop"
|
|
@ -66,6 +66,11 @@ monit_restart() {
|
|||
|
||||
}
|
||||
|
||||
start_no_monit() {
|
||||
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE0 --startas $DAEMON0
|
||||
liquidsoap_start
|
||||
}
|
||||
|
||||
case "${1:-''}" in
|
||||
'start')
|
||||
# start commands here
|
||||
|
@ -86,6 +91,12 @@ case "${1:-''}" in
|
|||
start
|
||||
echo "Done."
|
||||
;;
|
||||
'start-no-monit')
|
||||
# restart commands here
|
||||
echo -n "Starting $NAME: "
|
||||
start_no_monit
|
||||
echo "Done."
|
||||
;;
|
||||
'monit-restart')
|
||||
# restart commands here
|
||||
echo -n "Monit Restarting $NAME: "
|
||||
|
|
|
@ -50,6 +50,10 @@ def is_natty():
|
|||
return True
|
||||
return False
|
||||
|
||||
def copy_monit_file(current_script_dir):
|
||||
shutil.copy("%s/../monit-airtime-playout.cfg"%current_script_dir, "/etc/monit/conf.d/")
|
||||
shutil.copy("%s/../monit-airtime-liquidsoap.cfg"%current_script_dir, "/etc/monit/conf.d/")
|
||||
shutil.copy("%s/../../monit/monit-airtime-generic.cfg"%current_script_dir, "/etc/monit/conf.d/")
|
||||
|
||||
try:
|
||||
# load config file
|
||||
|
@ -61,6 +65,8 @@ try:
|
|||
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
copy_monit_file(current_script_dir)
|
||||
|
||||
p = Popen("/etc/init.d/airtime-playout stop >/dev/null 2>&1", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
|
@ -147,7 +153,7 @@ try:
|
|||
else:
|
||||
print "Unable to connect to the Airtime server."
|
||||
print "Waiting for processes to start..."
|
||||
p = Popen("/etc/init.d/airtime-playout start", shell=True)
|
||||
p = Popen("/etc/init.d/airtime-playout start-no-monit", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@ def get_current_script_dir():
|
|||
current_script_dir = os.path.realpath(__file__)
|
||||
index = current_script_dir.rindex('/')
|
||||
return current_script_dir[0:index]
|
||||
|
||||
def remove_monit_file():
|
||||
os.system("rm -f /etc/monit/conf.d/monit-airtime-playout.cfg")
|
||||
os.system("rm -f /etc/monit/conf.d/monit-airtime-liquidsoap.cfg")
|
||||
|
||||
try:
|
||||
# load config file
|
||||
|
@ -30,8 +34,11 @@ try:
|
|||
os.system("rm -f /etc/init.d/airtime-playout")
|
||||
os.system("update-rc.d -f airtime-playout remove >/dev/null 2>&1")
|
||||
|
||||
#copy logrotate script
|
||||
#remove logrotate script
|
||||
os.system("rm -f /etc/logrotate.d/airtime-liquidsoap")
|
||||
|
||||
print "Removing monit file"
|
||||
remove_monit_file()
|
||||
|
||||
print "Removing cache directories"
|
||||
remove_path(config["cache_base_dir"])
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
set daemon 10 # Poll at 5 second intervals
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set httpd port 2812
|
||||
|
||||
check process airtime-liquidsoap
|
||||
with pidfile "/var/run/airtime-liquidsoap.pid"
|
||||
start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds
|
||||
stop program = "/etc/init.d/airtime-playout stop"
|
|
@ -0,0 +1,9 @@
|
|||
set daemon 10 # Poll at 5 second intervals
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set httpd port 2812
|
||||
|
||||
check process airtime-playout
|
||||
with pidfile "/var/run/airtime-playout.pid"
|
||||
start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds
|
||||
stop program = "/etc/init.d/airtime-playout stop"
|
|
@ -29,6 +29,10 @@ stop () {
|
|||
rm -f $PIDFILE
|
||||
}
|
||||
|
||||
start_no_monit() {
|
||||
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE --startas $DAEMON
|
||||
}
|
||||
|
||||
|
||||
case "${1:-''}" in
|
||||
'start')
|
||||
|
@ -50,6 +54,12 @@ case "${1:-''}" in
|
|||
start
|
||||
echo "Done."
|
||||
;;
|
||||
'start-no-monit')
|
||||
# restart commands here
|
||||
echo -n "Starting $NAME: "
|
||||
start_no_monit
|
||||
echo "Done."
|
||||
;;
|
||||
'status')
|
||||
# status commands here
|
||||
/usr/bin/airtime-check-system
|
||||
|
|
|
@ -32,6 +32,10 @@ def get_current_script_dir():
|
|||
index = current_script_dir.rindex('/')
|
||||
return current_script_dir[0:index]
|
||||
|
||||
def copy_monit_file(current_script_dir):
|
||||
shutil.copy("%s/../monit-airtime-show-recorder.cfg"%current_script_dir, "/etc/monit/conf.d/")
|
||||
shutil.copy("%s/../../monit/monit-airtime-generic.cfg"%current_script_dir, "/etc/monit/conf.d/")
|
||||
|
||||
|
||||
try:
|
||||
# load config file
|
||||
|
@ -43,6 +47,8 @@ try:
|
|||
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
copy_monit_file(current_script_dir)
|
||||
|
||||
p = Popen("/etc/init.d/airtime-show-recorder stop >/dev/null 2>&1", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
|
@ -69,7 +75,7 @@ try:
|
|||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
print "Waiting for processes to start..."
|
||||
p = Popen("/etc/init.d/airtime-show-recorder start", shell=True)
|
||||
p = Popen("/etc/init.d/airtime-show-recorder start-no-monit", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
except Exception, e:
|
||||
|
|
|
@ -17,6 +17,10 @@ def get_current_script_dir():
|
|||
current_script_dir = os.path.realpath(__file__)
|
||||
index = current_script_dir.rindex('/')
|
||||
return current_script_dir[0:index]
|
||||
|
||||
def remove_monit_file():
|
||||
os.system("rm -f /etc/monit/conf.d/monit-airtime-show-recorder.cfg")
|
||||
|
||||
|
||||
try:
|
||||
# load config file
|
||||
|
@ -29,6 +33,9 @@ try:
|
|||
os.system("/etc/init.d/airtime-show-recorder stop")
|
||||
os.system("rm -f /etc/init.d/airtime-show-recorder")
|
||||
os.system("update-rc.d -f airtime-show-recorder remove >/dev/null 2>&1")
|
||||
|
||||
print "Removing monit file"
|
||||
remove_monit_file()
|
||||
|
||||
print "Removing log directories"
|
||||
remove_path(config["log_dir"])
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
set daemon 10 # Poll at 5 second intervals
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set httpd port 2812
|
||||
|
||||
check process airtime-show-recorder
|
||||
with pidfile "/var/run/airtime-show-recorder.pid"
|
||||
start program = "/etc/init.d/airtime-show-recorder start" with timeout 10 seconds
|
||||
stop program = "/etc/init.d/airtime-show-recorder stop"
|
|
@ -85,10 +85,6 @@ class AirtimeCheck {
|
|||
self::output_status("SHOW_RECORDER_RUNNING_SECONDS", $p_status->services->show_recorder->uptime_seconds);
|
||||
self::output_status("SHOW_RECORDER_MEM_PERC", $p_status->services->show_recorder->memory_perc);
|
||||
self::output_status("SHOW_RECORDER_CPU_PERC", $p_status->services->show_recorder->cpu_perc);
|
||||
self::output_status("ICECAST_PROCESS_ID", $p_status->services->icecast2->process_id);
|
||||
self::output_status("ICECAST_RUNNING_SECONDS", $p_status->services->icecast2->uptime_seconds);
|
||||
self::output_status("ICECAST_MEM_PERC", $p_status->services->icecast2->memory_perc);
|
||||
self::output_status("ICECAST_CPU_PERC", $p_status->services->icecast2->cpu_perc);
|
||||
self::output_status("RABBITMQ_PROCESS_ID", $p_status->services->rabbitmq->process_id);
|
||||
self::output_status("RABBITMQ_RUNNING_SECONDS", $p_status->services->rabbitmq->uptime_seconds);
|
||||
self::output_status("RABBITMQ_MEM_PERC", $p_status->services->rabbitmq->memory_perc);
|
||||
|
|
Loading…
Reference in New Issue