1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00

WebRTC updates

This commit is contained in:
Daniel Neto 2025-01-15 17:09:57 -03:00
parent ce15e2a380
commit 2174593665
5 changed files with 29 additions and 27 deletions

View file

@ -2556,7 +2556,7 @@ Click <a href=\"{link}\">here</a> to join our live.";
$playlists_id_live = $parameters['playlists_id_live']; $playlists_id_live = $parameters['playlists_id_live'];
$live_index = $parameters['live_index']; $live_index = $parameters['live_index'];
if (!empty($live_index) && $live_index !== 'false') { if (!empty($live_index) && $live_index !== 'false') {
$title .= " ({$live_index})"; $title .= " <small class=\"text-muted pull-right\">({$live_index})</small>";
} }
return $title; return $title;

Binary file not shown.

View file

@ -1,5 +1,5 @@
{ {
"version": "4.4", "version": "4.5",
"date": "2025-01-15T19:31:31.025Z", "date": "2025-01-15T20:09:31.152Z",
"phpTimestamp": 1736969491 "phpTimestamp": 1736971771
} }

View file

@ -39,7 +39,7 @@ socket.on('reconnect_attempt', () => {
// Handle live-start // Handle live-start
socket.on('live-start', ({ rtmpURL }) => { socket.on('live-start', ({ rtmpURL }) => {
console.log('live-start', rtmpURL); console.log('live-start', rtmpURL);
avideoToastSuccess(`Live streaming started successfully.`); avideoToastSuccess(`<i class="fa-solid fa-sync fa-spin"></i> Live streaming connecting...`);
setIsLive(); setIsLive();
requestNotifications(); requestNotifications();
}); });
@ -55,14 +55,14 @@ socket.on('live-resumed', ({ rtmpURL }) => {
// Handle live-stopped // Handle live-stopped
socket.on('live-stopped', ({ rtmpURL, message }) => { socket.on('live-stopped', ({ rtmpURL, message }) => {
console.log('live-stopped', rtmpURL, message); console.log('live-stopped', rtmpURL, message);
avideoToastWarning(`Live streaming stopped. Reason: ${message}`); avideoToastWarning(`${message}`);
setIsNotLive(); setIsNotLive();
requestNotifications(); requestNotifications();
}); });
socket.on('stream-will-stop', ({ rtmpURL, message }) => { socket.on('stream-will-stop', ({ rtmpURL, message }) => {
console.log('stream-will-stop', rtmpURL, message); console.log('stream-will-stop', rtmpURL, message);
avideoToastWarning(` ${message}`); avideoToastWarning(`<i class="fa-solid fa-triangle-exclamation fa-beat-fade"></i> ${message}`, 30000);
}); });
// Handle general errors // Handle general errors
@ -110,7 +110,7 @@ socket.on('rtmp-status', ({ rtmpURL, isRunning }) => {
// Handle stream-stopped // Handle stream-stopped
socket.on('stream-stopped', ({ rtmpURL, reason }) => { socket.on('stream-stopped', ({ rtmpURL, reason }) => {
console.log(`Stream for ${rtmpURL} stopped: ${reason}`); console.log(`Stream for ${rtmpURL} stopped: ${reason}`);
avideoToastWarning(`Stream stopped. Reason: ${reason}`); avideoToastWarning(`Stream stopped. ${reason}`);
requestNotifications(); requestNotifications();
setIsNotLive(); setIsNotLive();
}); });

View file

@ -1333,19 +1333,21 @@ function avideoAlertOnceForceConfirm(title, msg, type) {
}); });
} }
function _avideoToast(msg, icon) { function _avideoToast(msg, icon, displayTime = 0) {
if (empty(msg)) { if (empty(msg)) {
msg = ''; msg = '';
} }
try { try {
// Average reading speed: around 200 words per minute (or 3.3 words per second) if(displayTime == 0){
var wordsPerSecond = 2; // Average reading speed: around 200 words per minute (or 3.3 words per second)
var words = msg.split(' ').length; var wordsPerSecond = 2;
var readingTimeInSeconds = words / wordsPerSecond; var words = msg.split(' ').length;
var readingTimeInSeconds = words / wordsPerSecond;
// Convert reading time to milliseconds and add a buffer time
var displayTime = Math.max(readingTimeInSeconds * 1000 + 2000, 7000); // Minimum display time of 7000ms // Convert reading time to milliseconds and add a buffer time
displayTime = Math.max(readingTimeInSeconds * 1000 + 2000, 7000); // Minimum display time of 7000ms
}
var options = { text: msg, hideAfter: displayTime }; var options = { text: msg, hideAfter: displayTime };
if (icon) { if (icon) {
options.icon = icon; options.icon = icon;
@ -1356,20 +1358,20 @@ function _avideoToast(msg, icon) {
} }
} }
function avideoToast(msg) { function avideoToast(msg, displayTime = 0) {
_avideoToast(msg, null); _avideoToast(msg, null, displayTime);
} }
function avideoToastInfo(msg) { function avideoToastInfo(msg, displayTime = 0) {
_avideoToast(msg, 'info'); _avideoToast(msg, 'info', displayTime);
} }
function avideoToastError(msg) { function avideoToastError(msg, displayTime = 0) {
_avideoToast(msg, 'error'); _avideoToast(msg, 'error', displayTime);
} }
function avideoToastSuccess(msg) { function avideoToastSuccess(msg, displayTime = 0) {
_avideoToast(msg, 'success'); _avideoToast(msg, 'success', displayTime);
} }
function avideoToastWarning(msg) { function avideoToastWarning(msg, displayTime = 0) {
_avideoToast(msg, 'warning'); _avideoToast(msg, 'warning', displayTime);
} }
function avideoAlertAJAXHTML(url) { function avideoAlertAJAXHTML(url) {