Skip to content

Commit 7d74ee7

Browse files
authored
Merge pull request #90943 from avnerms/patch-17
Update 2 places in the sample code
2 parents 0c86e9d + 2b63f45 commit 7d74ee7

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

articles/azure-video-analyzer/video-analyzer-for-media-docs/upload-index-videos.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,19 @@ public async Task Sample()
175175
client.DefaultRequestHeaders.Remove("Ocp-Apim-Subscription-Key");
176176

177177
// Upload a video
178-
var content = new MultipartFormDataContent();
178+
MultipartFormDataContent content = null;
179179
Console.WriteLine("Uploading...");
180+
180181
// Get the video from URL
181182
var videoUrl = "VIDEO_URL"; // Replace with the video URL
182183
183184
// As an alternative to specifying video URL, you can upload a file.
184185
// Remove the videoUrl parameter from the query parameters below and add the following lines:
185-
//FileStream video =File.OpenRead(Globals.VIDEOFILE_PATH);
186-
//byte[] buffer =new byte[video.Length];
186+
//content = new MultipartFormDataContent();
187+
//FileStream video = File.OpenRead(@"c:\videos\democratic3.mp4");
188+
//byte[] buffer = new byte[video.Length];
187189
//video.Read(buffer, 0, buffer.Length);
188-
//content.Add(new ByteArrayContent(buffer));
190+
//content.Add(new ByteArrayContent(buffer), "MyVideo", "MyVideo");
189191
190192
queryParams = CreateQueryString(
191193
new Dictionary<string, string>()
@@ -398,16 +400,16 @@ namespace VideoIndexerArm
398400
var client = new HttpClient(handler);
399401

400402
// Upload a video
401-
var content = new MultipartFormDataContent();
403+
MultipartFormDataContent content = null;
402404
Console.WriteLine("Uploading...");
403-
// Get the video from URL
404405

405406
// As an alternative to specifying video URL, you can upload a file.
406407
// Remove the videoUrl parameter from the query parameters below and add the following lines:
407-
// FileStream video =File.OpenRead(Globals.VIDEOFILE_PATH);
408-
// byte[] buffer =new byte[video.Length];
409-
// video.Read(buffer, 0, buffer.Length);
410-
// content.Add(new ByteArrayContent(buffer));
408+
//content = new MultipartFormDataContent();
409+
//FileStream video = File.OpenRead(@"c:\videos\democratic3.mp4");
410+
//byte[] buffer = new byte[video.Length];
411+
//video.Read(buffer, 0, buffer.Length);
412+
//content.Add(new ByteArrayContent(buffer), "MyVideo", "MyVideo");
411413
412414
var queryParams = CreateQueryString(
413415
new Dictionary<string, string>()

0 commit comments

Comments
 (0)