You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
usingmux=Mux.Csharp.Sdk.Client;mux.Configurationconfig=new();config.BasePath="https://api.mux.com";config.Username="9074...";config.Password="XtR....";varapi=newAssetsApi(config);varrequest=newCreateAssetRequest{Test=true,PlaybackPolicy=newList<PlaybackPolicy>{PlaybackPolicy.Signed},Input=newList<InputSettings>{newInputSettings{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????}}};AssetResponseresponse=awaitapi.CreateAssetAsync(request);returnresponse??thrownewException("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.
The text was updated successfully, but these errors were encountered:
Hello,
I am trying to create a new video asset from a local video file. The
CreateAssetAsync()
method'sCreatesAssetRequest
has theUrl
field, but I am not able to figure out how to upload a local file.Example code:
I can see that the
Post<T>
method inApiClient.cs
supports posting files via theRequestOptions
parameter, however theCreateAssetAsync()
method does not contain any code to pass the filestream to theRequestOptions.Data
property.Can you suggest what am I doing wrong?
Thanks.
R.
The text was updated successfully, but these errors were encountered: