1 unstable release

0.1.3 Feb 11, 2022

#204 in Multimedia

Download history 27/week @ 2024-07-17 21/week @ 2024-07-24 4/week @ 2024-07-31 3/week @ 2024-08-14 32/week @ 2024-08-21 42/week @ 2024-08-28 100/week @ 2024-09-04 18/week @ 2024-09-11 2/week @ 2024-09-18 1/week @ 2024-09-25 2/week @ 2024-10-02 10/week @ 2024-10-09 10/week @ 2024-10-16 23/week @ 2024-10-23 19/week @ 2024-10-30

63 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

~23MB
~493K SLoC