Giter VIP home page Giter VIP logo

mux-csharp's People

Contributors

akemner avatar baynezy avatar dependabot[bot] avatar eropple avatar jaredsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mux-csharp's Issues

CreateAssetAsync() - how to upload video from a local file

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.