아래 링크에서 참조
https://github.com/nkranitz/transloadit-csharp-sdk 비디오 변환에 transloadit을 사용하고 C #의 s3에 저장했습니다. 동영상과 이미지를 업로드 할 수 있고 빈 결과로 응답을받을 수 있습니다. 내 응답은 "ok": "ASSEMBLY_EXECUTING", 메시지 및 결과 태그가 비어 있습니다. 따라서 어셈블리가 ASSEMBLY_COMPLETED와 같이 실행되면 최종 응답을 얻지 못합니다. 그래서, 몇 가지 속성 assembly.setblocking = true ..가 있지만 C #에서는 해당 속성을 사용할 수 없습니다. 그래서 어떻게 최종 응답을 얻거나 c # .net에서 차단 속성을 사용할 수 있습니까?
이 문제를 해결하는 데 도움을주세요.
미리 감사드립니다.
아래는 코드 스 니펫입니다.
ITransloadit transloadit = new Transloadit.Transloadit ( "APIKEY", "비밀");
//Create assembly builder to build up the assembly
IAssemblyBuilder assembly = new AssemblyBuilder();
//Add a file to be uploaded (with autogenerated key)
assembly.AddFile(@"filepath");
//Define the step, you can define more in the same assembly
IStep step = new Step();
step.SetOption("robot", "/image/resize");
step.SetOption("width", 75);
step.SetOption("height", 75);
step.SetOption("resize_strategy", "pad");
step.SetOption("background", "#000000");
//Add the step to the assembly
assembly.AddStep("thumb", step);
//Set notification URL
assembly.SetNotifyURL("url");
//Set the expiration date time of the request for the assembly
//Assembly will be expired in 120 minutes from now
assembly.SetAuthExpires(DateTime.Now.AddMinutes(120));
//Invoke assembly, and wait for the result
TransloaditResponse response = transloadit.InvokeAssembly(assembly);
if (response.Success)
{
// LoggerFactory.GetLogger().LogInfo(Type.GetType("TestConsole.Program"), "Assembly {0} result", response.Data);
}
첫 번째 응답에서 assembly_url
. 업데이트를 받기 위해 X 초 마다 해당 URL을 폴링 할 수 있습니다 . 어셈블리에 도달이 경우 ASSEMBLY_CANCELED
ASSEMBLY_COMPLETED
REQUEST_ABORTED
, 또는이 error
설정되어, 그것은 이루어집니다. 이 폴링의 상용구가 SDK에 구현되어 있는지 잘 모르겠습니다. 확인해야합니다.
차단 어셈블리는 연결을 개방 상태로 유지해야하기 때문에 권장되지 않습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다