DolbyIO.Rest
1.3.1
Prefix Reserved
dotnet add package DolbyIO.Rest --version 1.3.1
NuGet\Install-Package DolbyIO.Rest -Version 1.3.1
<PackageReference Include="DolbyIO.Rest" Version="1.3.1" />
paket add DolbyIO.Rest --version 1.3.1
#r "nuget: DolbyIO.Rest, 1.3.1"
// Install DolbyIO.Rest as a Cake Addin
#addin nuget:?package=DolbyIO.Rest&version=1.3.1
// Install DolbyIO.Rest as a Cake Tool
#tool nuget:?package=DolbyIO.Rest&version=1.3.1
Dolby.io REST APIs Client for .NET
.NET wrapper for the dolby.io REST Communications, Streaming and Media APIs.
Install this SDK
If you want to use NuGet, use the following command:
dotnet add package DolbyIO.Rest
Authentication
To get an access token that will be used by your server to perform backend operations like creating a conference, use the following code. This is only for the Communications and Media APIs.
using DolbyIO.Rest;
const string APP_KEY = "app_key";
const string APP_SECRET = "app_secret";
using DolbyIOClient client = new DolbyIOClient();
JwtToken jwt = await client.Authentication.GetApiAccessTokenAsync(APP_KEY, APP_SECRET);
To request a particular scope for this access token:
using DolbyIO.Rest;
const string APP_KEY = "app_key";
const string APP_SECRET = "app_secret";
using DolbyIOClient client = new DolbyIOClient();
JwtToken jwt = await client.Authentication.GetApiAccessTokenAsync(
APP_KEY,
APP_SECRET,
3600,
new string[] { "comms:client_access_token:create" }
);
Communications Examples
Get a Client Access Token
To get an access token that will be used by the client SDK for an end user to open a session against dolby.io, use the following code:
using DolbyIO.Rest;
using DolbyIO.Rest.Models;
const string APP_KEY = "app_key";
const string APP_SECRET = "app_secret";
using DolbyIOClient client = new DolbyIOClient();
JwtToken apiToken = await client.Authentication.GetApiAccessTokenAsync(
APP_KEY,
APP_SECRET,
3600,
new string[] { "comms:client_access_token:create" }
);
JwtToken cat = await client.Communications.Authentication
.GetClientAccessTokenV2Async(apiToken, new string[] {"*"});
Create a conference
To create a Dolby Voice conference, you first must retrieve an API Access Token, then use the following code to create the conference.
using DolbyIO.Rest;
using DolbyIO.Rest.Communications.Models;
using DolbyIO.Rest.Models;
const string APP_KEY = "app_key";
const string APP_SECRET = "app_secret";
using DolbyIOClient client = new DolbyIOClient();
JwtToken jwt = await client.Authentication.GetApiAccessTokenAsync(
APP_KEY,
APP_SECRET,
3600,
new string[] { "comms:conf:create" }
);
CreateConferenceOptions options = new CreateConferenceOptions
{
Alias = "Conference Name",
OwnerExternalId = "Fabien"
};
Conference conference = await client.Conferences.CreateAsync(jwt, options);
Real-time Streaming Examples
Create a publish token
using System;
using DolbyIO.Rest;
using DolbyIO.Rest.Streaming.Models;
using Newtonsoft.Json;
using DolbyIOClient client = new DolbyIOClient();
CreatePublishToken create = new CreatePublishToken
{
Label = "My token",
Streams = new List<PublishTokenStream>
{
new PublishTokenStream
{
StreamName = "feedA"
}
}
};
PublishToken token = await client.Streaming.PublishToken.CreateAsync("api_secret", create);
Create a subscribe token
using System;
using DolbyIO.Rest;
using DolbyIO.Rest.Streaming.Models;
using Newtonsoft.Json;
using DolbyIOClient client = new DolbyIOClient();
CreateSubscribeToken create = new CreateSubscribeToken
{
Label = "My token",
Streams = new List<SubscribeTokenStream>
{
new SubscribeTokenStream
{
StreamName = "feedA"
}
}
};
SubscribeToken token = await client.Streaming.SubscribeToken.CreateAsync("api_secret", create);
Media Examples
Start an enhance job
To start an enhance job, use the following code:
using System;
using DolbyIO.Rest;
using DolbyIO.Rest.Models;
using Newtonsoft.Json;
const string APP_KEY = "app_key";
const string APP_SECRET = "app_secret";
using DolbyIOClient client = new DolbyIOClient();
JwtToken jwt = await client.Authentication.GetApiAccessTokenAsync(APP_KEY, APP_SECRET);
string jobDescription = JsonConvert.SerializeObject(new {
content = new { type = "podcast" },
input = "dlb://in/file.mp4",
output = "dlb://out/file.mp4"
});
string jobId = await client.Media.Enhance.StartAsync(jwt, jobDescription);
Console.WriteLine($"Job ID: {jobId}");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.