1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Refactor some plugins code.

This commit is contained in:
Caleb Mazalevskis 2022-01-06 19:43:51 +08:00
parent ab8fd13a56
commit 43c00721ca
No known key found for this signature in database
GPG key ID: 082E6BC1046FAB95
223 changed files with 12595 additions and 11447 deletions

View file

@ -1,24 +1,24 @@
<?php
// this script will be executed on the AVideo side
$meetPlugin = AVideoPlugin::getDataObjectIfEnabled("Meet");
if (empty($meetPlugin)) {
return false;
}
$rtmpLink = "";
$livePlugin = AVideoPlugin::getDataObjectIfEnabled("Live");
if (!empty($livePlugin) && User::canStream()) {
$trasnmition = LiveTransmition::createTransmitionIfNeed(User::getId());
$dropURL = "{$global['webSiteRootURL']}plugin/Live/droplive.json.php?live_transmition_id={$trasnmition['id']}&live_servers_id=" . Live::getCurrentLiveServersId();
$rtmpLink = Live::getRTMPLink(User::getId());
}
if (empty($meet_schedule_id)) {
$meet_schedule_id = 0;
} else {
$meet_schedule_id = intval($meet_schedule_id);
}
?>
<?php
// this script will be executed on the AVideo side
$meetPlugin = AVideoPlugin::getDataObjectIfEnabled("Meet");
if (empty($meetPlugin)) {
return false;
}
$rtmpLink = "";
$livePlugin = AVideoPlugin::getDataObjectIfEnabled("Live");
if (!empty($livePlugin) && User::canStream()) {
$trasnmition = LiveTransmition::createTransmitionIfNeed(User::getId());
$dropURL = "{$global['webSiteRootURL']}plugin/Live/droplive.json.php?live_transmition_id={$trasnmition['id']}&live_servers_id=" . Live::getCurrentLiveServersId();
$rtmpLink = Live::getRTMPLink(User::getId());
}
if (empty($meet_schedule_id)) {
$meet_schedule_id = 0;
} else {
$meet_schedule_id = intval($meet_schedule_id);
}
?>
<script src="<?php echo getCDN(); ?>plugin/Meet/external_api.js" type="text/javascript"></script>
<script src="<?php echo getCDN(); ?>node_modules/sweetalert/dist/sweetalert.min.js" type="text/javascript"></script>
<script>
@ -60,13 +60,13 @@ if (empty($meet_schedule_id)) {
event_on_meetReady();
}
aVideoMeetCreateButtons();
<?php
$css = file_get_contents($global['systemRootPath'] . 'plugin/Meet/meet.mobile.css');
if(!isMobile()){
$css = "@media (max-width: 767px) {{$css}}";
}
$css .= file_get_contents($global['systemRootPath'] . 'plugin/Meet/meet.css');
?>
<?php
$css = file_get_contents($global['systemRootPath'] . 'plugin/Meet/meet.mobile.css');
if (!isMobile()) {
$css = "@media (max-width: 767px) {{$css}}";
}
$css .= file_get_contents($global['systemRootPath'] . 'plugin/Meet/meet.css');
?>
aVideoMeetAppendElement("head", <?php echo json_encode("<style>{$css}</style>"); ?>);
console.log("YPTMeetScript conference is ready");
} else if (typeof e.data.aVideoMeetStartRecording !== 'undefined') {
@ -230,13 +230,13 @@ if (empty($meet_schedule_id)) {
}
function aVideoMeetCreateButtons() {
<?php
if (!empty($rtmpLink) && Meet::isModerator($meet_schedule_id)) {
?>
<?php
if (!empty($rtmpLink) && Meet::isModerator($meet_schedule_id)) {
?>
aVideoMeetAppendElement(".button-group-center", <?php echo json_encode(Meet::createJitsiRecordStartStopButton($rtmpLink, $dropURL)); ?>);
<?php
}
?>
<?php
}
?>
}
function readyToClose() {