JW Player Media Management API Wrapper
A Rust library that provides an API wrapper for the JW Player media management. This wrapper allows users to query their media library, filter results by tags, stream large libraries in manageable chunks, and download specific video renditions.
Features
- Query Media Library: Fetch details about all media items in your JW Player library.
- Keyword Filtering: Filter media items based on keywords.
- Stream Large Libraries: Efficiently stream large collections by retrieving items in chunks.
- Download Renditions: Download specific video renditions with ease.
Installation
Add this crate to your Cargo.toml:
[]
= "0.2.0"
Usage
Ensure that you have an API key from JW Player and the necessary permissions to access the media management API.
1. Set Up API Client
Initialize the API client with your JW API key and site id:
let token = var.expect;
let site_id = var.expect;
let client = new;
2. Query the Media Library
Retrieve a static chunk of most recent JW library items, max 10k videos:
let default_response = client.get_library.await; //returns 10 items
let different_size_response = client.get_library.await; //sets return size to 42
let tags_include = client.get_library_by_tags.await;
let tag_exclude = client.get_library_excluding_tags.await;
3. Stream Media in Chunks
For large libraries, retrieve items in streamed chunks:
use StreamExt;
let mut streamed_data = client.get_library_stream.await;
while let Some = streamed_data.next.await
4. Download a Video Rendition
Download a specific rendition for a video:
let ten_videos = client.get_library.await.unwrap.unwrap;
for media in ten_videos.media
License
This project is licensed under the MIT License.