.NET wrapper for the Dolby Millicast and Media APIs.
If you want to use NuGet, use the following command:
dotnet add package DolbyIO.Rest
using System;
using DolbyIO.Rest;
using DolbyIO.Rest.Streaming.Models;
using Newtonsoft.Json;
const string API_SECRET = "api_secret";
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);
using System;
using DolbyIO.Rest;
using DolbyIO.Rest.Streaming.Models;
using Newtonsoft.Json;
const string API_SECRET = "api_secret";
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);
To start an enhance job, use the following code:
using System;
using DolbyIO.Rest;
using DolbyIO.Rest.Media.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.Media.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}");