-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hello,
I am trying to create a new video asset from a local video file. The CreateAssetAsync()
method's CreatesAssetRequest
has the Url
field, but I am not able to figure out how to upload a local file.
Example code:
using mux = Mux.Csharp.Sdk.Client;
mux.Configuration config = new();
config.BasePath = "https://api.mux.com";
config.Username = "9074...";
config.Password = "XtR....";
var api = new AssetsApi(config);
var request = new CreateAssetRequest
{
Test = true,
PlaybackPolicy = new List<PlaybackPolicy> { PlaybackPolicy.Signed },
Input = new List<InputSettings> { new InputSettings {
Type = InputSettings.TypeEnum.Video,
//Url = @"c:\Users\Radek\Desktop\test AT media\sample-mp4-file-small.mp4"
//Url = "file:///c:/Users/Radek/Desktop/test AT media/sample-mp4-file-small.mp4"
----> how should I specify a local file here????
} }
};
AssetResponse response = await api.CreateAssetAsync(request);
return response ?? throw new Exception("MUX API CreateAssetAsync did not return any data");
I can see that the Post<T>
method in ApiClient.cs
supports posting files via the RequestOptions
parameter, however the CreateAssetAsync()
method does not contain any code to pass the filestream to the RequestOptions.Data
property.
Can you suggest what am I doing wrong?
Thanks.
R.
Metadata
Metadata
Assignees
Labels
No labels