| Crates.io | videocall-sdk |
| lib.rs | videocall-sdk |
| version | 0.1.7 |
| created_at | 2025-04-20 03:41:56.502159+00 |
| updated_at | 2025-08-18 03:32:46.978488+00 |
| description | Cross-platform FFI bindings for videocall |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1641349 |
| size | 238,279 |
Native mobile bindings for the VideoCall project, providing iOS (Swift) and Android (Kotlin) interfaces to the core WebTransport functionality.
Disclaimer: This crate is currently intended for internal use within the VideoCall project. It is a work in progress, and API stability or long-term compatibility is not guaranteed at this stage.
This crate extends the VideoCall project by providing native bindings for iOS and Android platforms using the UniFFI library. It allows mobile developers to easily integrate the VideoCall WebTransport functionality into their iOS and Android applications.
The bindings expose the core VideoCall functionality through platform-specific interfaces, handling the complexities of cross-language communication while maintaining the performance benefits of the Rust implementation.
import VideoCallKit
// Create a client
let client = WebTransportClient()
// Connect to a server
try client.connect(url: "https://example.com")
// Send data
try client.sendDatagram(data: [1, 2, 3, 4])
// Create a queue for receiving data
let queue = DatagramQueue()
// Subscribe to datagrams
try client.subscribeToDatagrams(queue: queue)
// Check if datagrams are available
if try queue.hasDatagrams() {
// Receive a datagram
let data = try queue.receiveDatagram()
// Process the data
}
import com.videocall.uniffi.WebTransportClient
import com.videocall.uniffi.DatagramQueue
// Create a client
val client = WebTransportClient()
// Connect to a server
client.connect("https://example.com")
// Send data
client.sendDatagram(byteArrayOf(1, 2, 3, 4))
// Create a queue for receiving data
val queue = DatagramQueue()
// Subscribe to datagrams
client.subscribeToDatagrams(queue)
// Check if datagrams are available
if (queue.hasDatagrams()) {
// Receive a datagram
val data = queue.receiveDatagram()
// Process the data
}
cargo install uniffi)cd videocall-sdk
./build_ios.sh
This will generate:
VideoCallKit/Frameworks/VideoCallIOS.xcframeworkVideoCallKit/Sources/VideoCallKit/videocall.swiftcd videocall-sdk
./build_android.sh
This will generate:
target/videocall-sdk.aartarget/kotlin/com/videocall/uniffi/videocall.ktThis crate uses UniFFI to generate language-specific bindings for the VideoCall core functionality:
videocall.udl file defines the interface that will be exposed to Swift and KotlinThe library provides comprehensive error handling through the WebTransportError enum:
ConnectionError: Errors related to the connectionTlsError: TLS-related errorsStreamError: Errors related to data streamsInvalidUrl: Invalid URL formatRuntimeError: Runtime-related errorsCertificateError: Certificate-related errorsClientError: Errors related to the clientQueueError: Errors related to the datagram queueThis project is licensed under either of the following licenses:
Contributions are welcome! Please feel free to submit a Pull Request.