Stabilizza live YouTube/RTMP e fix crash rotazione mobile.
Pipeline YouTube con relay, overlay e publisher sync lato backend; fix GL pauseGlDuringRotation su Android per evitare crash in rotazione durante lo streaming Flutter. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -19,32 +19,53 @@ class StreamingChannel {
|
||||
return ok ?? false;
|
||||
}
|
||||
|
||||
/// Dopo rotazione: riallinea preview/stream senza fermare RTMP.
|
||||
static Future<void> syncOrientation() async {
|
||||
await _channel.invokeMethod<void>('syncOrientation');
|
||||
}
|
||||
|
||||
static Future<void> stopPreview() async {
|
||||
await _channel.invokeMethod('stopPreview');
|
||||
}
|
||||
|
||||
static Future<void> startStream({
|
||||
required String rtmpUrl,
|
||||
int targetBitrate = 2500000,
|
||||
int targetBitrate = 3000000,
|
||||
int targetFps = 30,
|
||||
int width = 1280,
|
||||
int height = 720,
|
||||
bool portrait = false,
|
||||
int rotation = 0,
|
||||
}) async {
|
||||
await _channel.invokeMethod('startStream', {
|
||||
'rtmpUrl': rtmpUrl,
|
||||
'videoBitrate': targetBitrate,
|
||||
'fps': targetFps,
|
||||
'width': width,
|
||||
'height': height,
|
||||
'portrait': portrait,
|
||||
'rotation': rotation,
|
||||
});
|
||||
}
|
||||
|
||||
/// Ripresa dopo pausa: resetta stati RTMP residui (CONNECTING/RECONNECTING).
|
||||
static Future<void> resumeStream({
|
||||
required String rtmpUrl,
|
||||
int targetBitrate = 2500000,
|
||||
int targetBitrate = 3000000,
|
||||
int targetFps = 30,
|
||||
int width = 1280,
|
||||
int height = 720,
|
||||
bool portrait = false,
|
||||
int rotation = 0,
|
||||
}) async {
|
||||
await _channel.invokeMethod('resumeStream', {
|
||||
'rtmpUrl': rtmpUrl,
|
||||
'videoBitrate': targetBitrate,
|
||||
'fps': targetFps,
|
||||
'width': width,
|
||||
'height': height,
|
||||
'portrait': portrait,
|
||||
'rotation': rotation,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user