1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00
This commit is contained in:
Daniel Neto 2025-01-12 12:12:49 -03:00
parent ca089ec17e
commit a71f0f4c55
3 changed files with 10 additions and 4 deletions

2
.gitignore vendored
View file

@ -109,4 +109,4 @@ CreatePlugin/plugins/
vendor/james-heinrich/getid3/demos/ vendor/james-heinrich/getid3/demos/
AVideoStorage/ AVideoStorage/
plugin/VideoHLSOverlay/ plugin/VideoHLSOverlay/
plugin/Live/WebRTC/WebRTC2RTMP.json plugin/WebRTC/WebRTC2RTMP.json

View file

@ -2,8 +2,8 @@
"version": 1, "version": 1,
"domain": "vlu.me", "domain": "vlu.me",
"serverPort": 3000, "serverPort": 3000,
"time": "2025-01-12 15:01:04", "time": "2025-01-12 15:12:04",
"phpTimestamp": 1736694064, "phpTimestamp": 1736694724,
"isPremium": true, "isPremium": true,
"maxRtmpRuntimeMinutes": 120, "maxRtmpRuntimeMinutes": 120,
"maxConcurrentRtmp": 4 "maxConcurrentRtmp": 4

View file

@ -70,13 +70,19 @@ function sendStreamToServer(stream) {
console.error('MediaRecorder error:', event.error); console.error('MediaRecorder error:', event.error);
}; };
mediaRecorder.start(1000); // Record and send chunks every second const chunkSize = isIPhone() ? 250 : 1000; // 250ms for iPhone, 1000ms for others
mediaRecorder.start(chunkSize); // Record and send chunks every second
console.log(`MediaRecorder started`); console.log(`MediaRecorder started`);
} catch (error) { } catch (error) {
console.error('Failed to initialize MediaRecorder:', error); console.error('Failed to initialize MediaRecorder:', error);
} }
} }
// Detect if the device is an iPhone
function isIPhone() {
return /iPhone|iPad|iPod/i.test(navigator.userAgent);
}
// Function to stop the MediaRecorder // Function to stop the MediaRecorder
function stopStreamToServer() { function stopStreamToServer() {
if (mediaRecorder && mediaRecorder.state !== 'inactive') { if (mediaRecorder && mediaRecorder.state !== 'inactive') {