1 unstable release

0.1.3 Feb 11, 2022

#199 in Multimedia

Download history 64/week @ 2023-12-11 205/week @ 2023-12-18 140/week @ 2024-01-01 227/week @ 2024-01-08 56/week @ 2024-01-15 92/week @ 2024-01-22 44/week @ 2024-01-29 83/week @ 2024-02-05 119/week @ 2024-02-12 101/week @ 2024-02-19 133/week @ 2024-02-26 52/week @ 2024-03-04 72/week @ 2024-03-11 14/week @ 2024-03-25

138 downloads per month

MIT license

19KB
365 lines

OpenTok Server Rust SDK

Rust

The OpenTok Server Rust SDK wraps the OpenTok REST API. It lets developers securely create sessions and generate tokens for their applications that use the Vonage Video API. Developers can also use the server SDK to work with OpenTok archives. Use it in conjunction with the OpenTok client SDK.

Usage

    let api_key = env::var("OPENTOK_KEY").unwrap();
    let api_secret = env::var("OPENTOK_SECRET").unwrap();
    let opentok = OpenTok::new(api_key, api_secret);
    let session_id = opentok.create_session(SessionOptions::default()).await;
    let token = opentok.generate_token(session_id, TokenRole::Publisher);

Running the tests

The tests expect a working network connection and the following environment variables defined:

export OPENTOK_KEY=<your-opentok-api-key>
export OPENTOK_SECRET=<your-opentok-api-secret>

The tests make use of the OpenTok client SDK, so you'll need to install its dependencies, starting with the OpenTok Linux SDK:

wget https://tokbox.com/downloads/libopentok_linux_llvm_x86_64-2.19.1
tar xvf libopentok_linux_llvm_x86_64-2.19.1 -C /home/quijote/opentok
export LD_LIBRARY_PATH="/home/quijote/opentok/libopentok_linux_llvm_x86_64-2.19.1/lib:$LD_LIBRARY_PATH"
export LIBRARY_PATH="/home/quijote/opentok/libopentok_linux_llvm_x86_64-2.19.1/lib:$LIBRARY_PATH"

GStreamer is also required:

sudo apt -y install libgstreamer-plugins-base1.0-dev

Dependencies

~22MB
~504K SLoC