O'Reilly logo

Learning Microsoft Cognitive Services - Second Edition by Leif Larsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Video operations as common code

Before we dive into the different features of the API, we will write some code that can be used by all four of them. Using the NuGet client package, we are able to use the same function to execute all video operations. The difference lies in which operation type we specify.

Open the VideoOperations.cs file and add the following class beneath the VideoOperations class:

    public class VideoOperationStatusEventArgs : EventArgs { 
        public string Status { get; private set; } 
        public string Message { get; private set; } 
 
        public VideoOperationStatusEventArgs(string status, string message) { 
            Status = status; 
            Message = message; 
        } 
    } 

In case any operation throws an exception or fails, we want to be able to raise an event. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required