mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Update socket script
This commit is contained in:
parent
cf85b0b41f
commit
eb296e361b
4 changed files with 54 additions and 13 deletions
|
@ -788,8 +788,6 @@ class API extends PluginAbstract {
|
|||
|
||||
$obj->livestream = LiveTransmition::createTransmitionIfNeed($user->getBdId());
|
||||
$obj->livestream["live_servers_id"] = Live::getCurrentLiveServersId();
|
||||
$liveStreamObject = new LiveStreamObject($obj->livestream['key'], $obj->livestream['live_servers_id']);
|
||||
$obj->livestream['key_with_index'] = $liveStreamObject->getKeyWithIndex(true);
|
||||
$obj->livestream["server"] = $p->getServer($obj->livestream["live_servers_id"]) . "?p=" . $user->getPassword();
|
||||
$obj->livestream["poster"] = $global['webSiteRootURL'] . $p->getPosterImage($user->getBdId(), $obj->livestream["live_servers_id"]);
|
||||
$obj->livestream["joinURL"] = Live::getLinkToLiveFromUsers_idAndLiveServer($user->getBdId(), $obj->livestream["live_servers_id"]);
|
||||
|
|
|
@ -3901,17 +3901,23 @@ class LiveStreamObject {
|
|||
if (is_string($forceIndexIfEnabled) || is_int($forceIndexIfEnabled)) {
|
||||
$this->live_index = $forceIndexIfEnabled;
|
||||
} else {
|
||||
$objLive = AVideoPlugin::getDataObject("Live");
|
||||
if (!empty($objLive->allowMultipleLivesPerUser)) {
|
||||
if (empty($allowOnlineIndex)) {
|
||||
$this->live_index = Live::getLatestValidNotOnlineLiveIndex($this->key);
|
||||
} else {
|
||||
$this->live_index = LiveTransmitionHistory::getLatestIndexFromKey($this->key);
|
||||
}
|
||||
}
|
||||
$this->live_index = $this->getIndex($allowOnlineIndex);
|
||||
}
|
||||
}
|
||||
return Live::getLiveKeyFromRequest($this->key, $this->live_index, $this->playlists_id_live);
|
||||
}
|
||||
|
||||
public function getIndex($allowOnlineIndex = false) {
|
||||
$objLive = AVideoPlugin::getDataObject("Live");
|
||||
$live_index = '';
|
||||
if (!empty($objLive->allowMultipleLivesPerUser)) {
|
||||
if (empty($allowOnlineIndex)) {
|
||||
$live_index = Live::getLatestValidNotOnlineLiveIndex($this->key);
|
||||
} else {
|
||||
$live_index = LiveTransmitionHistory::getLatestIndexFromKey($this->key);
|
||||
}
|
||||
}
|
||||
return $live_index;
|
||||
}
|
||||
|
||||
public function getLive_servers_id() {
|
||||
|
|
|
@ -152,6 +152,10 @@ class LiveTransmition extends ObjectYPT
|
|||
$data = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if ($res != false) {
|
||||
$liveStreamObject = new LiveStreamObject($data['key'], $data['live_servers_id']);
|
||||
$data['key_with_index'] = $liveStreamObject->getKeyWithIndex(true);
|
||||
$data['live_index'] = $liveStreamObject->getIndex();
|
||||
|
||||
$user = $data;
|
||||
} else {
|
||||
$user = false;
|
||||
|
@ -194,7 +198,9 @@ class LiveTransmition extends ObjectYPT
|
|||
|
||||
public static function getFromRequest()
|
||||
{
|
||||
if (!empty($_REQUEST['live_schedule'])) {
|
||||
if (!empty($_REQUEST['live_transmitions_id'])) {
|
||||
return LiveTransmition::getFromDb($_REQUEST['live_transmitions_id']);
|
||||
} else if (!empty($_REQUEST['live_schedule'])) {
|
||||
return LiveTransmition::getFromDbBySchedule($_REQUEST['live_schedule']);
|
||||
} elseif (!empty($_REQUEST['u'])) {
|
||||
return LiveTransmition::getFromDbByUserName($_REQUEST['u']);
|
||||
|
|
|
@ -21,9 +21,13 @@ if (!empty($_REQUEST['user']) && !empty($_REQUEST['pass'])) {
|
|||
}
|
||||
} else if (User::isLogged()) {
|
||||
$users_id = User::getId();
|
||||
$livet = LiveTransmition::createTransmitionIfNeed($users_id);
|
||||
$_REQUEST['live_transmitions_id'] = $livet['id'];
|
||||
$getLiveKey = setLiveKey($livet['key'], $livet['live_servers_id'], $livet['live_index']);
|
||||
//var_dump($livet, $getLiveKey, isLive());exit;
|
||||
if (AVideoPlugin::isEnabledByName('Chat2')) {
|
||||
$latest = LiveTransmitionHistory::getLatestFromUser($users_id);
|
||||
$room_users_id = $users_id;
|
||||
$latest = LiveTransmitionHistory::getLatestFromUser($users_id);
|
||||
$live_transmitions_history_id = $latest['id'];
|
||||
$iframe = 1;
|
||||
$noFade = 1;
|
||||
|
@ -63,7 +67,15 @@ if (!empty($_REQUEST['user']) && !empty($_REQUEST['pass'])) {
|
|||
//include "{$global['systemRootPath']}plugin/Chat2/index.php";
|
||||
//return false;
|
||||
}
|
||||
}else{
|
||||
if (AVideoPlugin::isEnabledByName('LiveUsers')) {
|
||||
$html .= getLiveUsersLabelHTML();
|
||||
$html .= '<div id="LiveUsersLabelLive">'.getLiveUsersLabelLive($livet['key'], $livet['live_servers_id']).'</div>';
|
||||
//$html .= '<div id="LiveUsersLabelLive">'.getLiveUsersLabelLive($lt['key'], $lt['live_servers_id']).'</div>';
|
||||
//$html .= getIncludeFileContent($global['systemRootPath'] . 'plugin/Live/view/menuRight.php');
|
||||
|
||||
//var_dump($lt);exit;
|
||||
}
|
||||
} else {
|
||||
$html .= 'nothing to do ';
|
||||
if (User::isLogged()) {
|
||||
$html .= 'is Logged ';
|
||||
|
@ -85,12 +97,31 @@ if (!empty($_REQUEST['user']) && !empty($_REQUEST['pass'])) {
|
|||
body {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.liveUsersLabel, #LiveUsersLabelLive{
|
||||
position: fixed;
|
||||
top: 80px !important;
|
||||
}
|
||||
.liveUsersLabel{
|
||||
left: 20px !important;
|
||||
}
|
||||
#LiveUsersLabelLive{
|
||||
left: 80px !important;
|
||||
}
|
||||
#recorderToEncoderActionButtons{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body style="background-color: transparent;">
|
||||
<?php
|
||||
echo $html;
|
||||
if(AVideoPlugin::isEnabledByName('SendRecordedToEncoder')){
|
||||
include $global['systemRootPath'] . 'plugin/SendRecordedToEncoder/actionButtonLive.php';
|
||||
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue