sendMediaStream method
- @Deprecated('Use sendAudio, sendVideo, or sendText with a stream instead')
- Stream<
InlineDataPart> mediaChunkStream
Starts streaming media chunks to the server from the provided mediaChunkStream.
This function asynchronously processes each InlineDataPart from the given
mediaChunkStream and sends it to the server via the WebSocket connection.
Parameters:
mediaChunkStream: The stream of InlineDataPart objects to send to the server.
Implementation
@Deprecated('Use sendAudio, sendVideo, or sendText with a stream instead')
Future<void> sendMediaStream(Stream<InlineDataPart> mediaChunkStream) async {
_checkWsStatus();
try {
await for (final chunk in mediaChunkStream) {
await _sendMediaChunk(chunk);
}
} catch (e) {
throw FirebaseAISdkException(e.toString());
} finally {
log('Stream processing completed.');
}
}