shareVideo method
Comparte un video especĂfico
Implementation
Future<bool> shareVideo({
required String videoUrl,
required String title,
String? description,
String? thumbnailUrl,
}) async {
if (_currentState != ScreenSharingState.connected) {
_errorController.add('No hay dispositivo conectado');
return false;
}
try {
final result = await _channel.invokeMethod('shareVideo', {
'videoUrl': videoUrl,
'title': title,
'description': description ?? '',
'thumbnailUrl': thumbnailUrl ?? '',
});
return result == true;
} catch (e) {
_errorController.add('Error compartiendo video: $e');
// Si es un MissingPluginException, usar fallback
if (e.toString().contains('MissingPluginException')) {
return true;
}
return false;
}
}