Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Client      client     = CodeExample.createKalturaClient();
            bool        done       = false;
            string      secret     = "********************";
            string      userId     = "*****@*****.**";
            SessionType type       = SessionType.USER;
            int         partnerId  = 123456;
            int         expiry     = 86400;
            string      privileges = "";

            OnCompletedHandler <string> handler = new OnCompletedHandler <string>(
                (string result, Exception e) =>
            {
                CodeExample.PrintObject(result);
                done = true;
            });

            SessionService.Start(secret, userId, type, partnerId, expiry, privileges)
            .SetCompletion(handler)
            .Execute(client);

            while (!done)
            {
                Thread.Sleep(100);
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Client  client        = CodeExample.createKalturaClient();
            bool    done          = false;
            string  uploadTokenId = "abcde";
            file    fileData      = new FileStream("/path/to/file", FileMode.Open, FileAccess.Read);
            boolean resume        = false;
            boolean finalChunk    = true;
            number  resumeAt      = -1;

            OnCompletedHandler <UploadToken> handler = new OnCompletedHandler <UploadToken>(
                (UploadToken result, Exception e) =>
            {
                CodeExample.PrintObject(result);
                done = true;
            });

            UploadTokenService.Upload(uploadTokenId, fileData, resume, finalChunk, resumeAt)
            .SetCompletion(handler)
            .Execute(client);

            while (!done)
            {
                Thread.Sleep(100);
            }
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Client client     = CodeExample.createKalturaClient();
            bool   done       = false;
            string loginId    = "foobar";
            string password   = "******";
            int    partnerId  = 0;
            int    expiry     = 86400;
            string privileges = "*";
            string otp        = "";

            OnCompletedHandler <string> handler = new OnCompletedHandler <string>(
                (string result, Exception e) =>
            {
                CodeExample.PrintObject(result);
                done = true;
            });

            UserService.LoginByLoginId(loginId, password, partnerId, expiry, privileges, otp)
            .SetCompletion(handler)
            .Execute(client);

            while (!done)
            {
                Thread.Sleep(100);
            }
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            Client      client            = CodeExample.createKalturaClient();
            bool        done              = false;
            string      id                = "";
            string      tokenHash         = "";
            string      userId            = "YOUR_USER_ID";
            SessionType type              = SessionType.USER;
            int         expiry            = 0;
            string      sessionPrivileges = "";

            OnCompletedHandler <SessionInfo> handler = new OnCompletedHandler <SessionInfo>(
                (SessionInfo result, Exception e) =>
            {
                CodeExample.PrintObject(result);
                done = true;
            });

            AppTokenService.StartSession(id, tokenHash, userId, type, expiry, sessionPrivileges)
            .SetCompletion(handler)
            .Execute(client);

            while (!done)
            {
                Thread.Sleep(100);
            }
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            Client client = CodeExample.createKalturaClient();
            bool   done   = false;
            AccessControlProfile accessControlProfile = new AccessControlProfile();

            accessControlProfile.Name  = "foo";
            accessControlProfile.Rules = new List <Rule>();
            accessControlProfile.Rules.Add(new Rule());
            accessControlProfile.Rules[0].Code     = "thiscode";
            accessControlProfile.Rules[0].Contexts = new List <ContextTypeHolder>();
            accessControlProfile.Rules[0].Contexts.Add(new ContextTypeHolder());
            accessControlProfile.Rules[0].Contexts[0].Type = 1;
            accessControlProfile.Rules[0].Contexts.Add(new ContextTypeHolder());
            accessControlProfile.Rules[0].Conditions = new List <Condition>();
            accessControlProfile.Rules[0].Conditions.Add(new Condition());
            accessControlProfile.Rules[0].Conditions[0].Description = "cond 1";
            accessControlProfile.Rules[0].Conditions.Add(new Condition());
            accessControlProfile.Rules[0].Conditions[1].Description = "cond 2";
            accessControlProfile.Rules.Add(new Rule());
            accessControlProfile.Rules[1].Code = "second code";

            OnCompletedHandler <AccessControlProfile> handler = new OnCompletedHandler <AccessControlProfile>(
                (AccessControlProfile result, Exception e) =>
            {
                CodeExample.PrintObject(result);
                done = true;
            });

            AccessControlProfileService.Add(accessControlProfile)
            .SetCompletion(handler)
            .Execute(client);

            while (!done)
            {
                Thread.Sleep(100);
            }
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            Client           client = CodeExample.createKalturaClient();
            bool             done   = false;
            MediaEntryFilter filter = new MediaEntryFilter();
            FilterPager      pager  = new FilterPager();

            OnCompletedHandler <ListResponse <MediaEntry> > handler = new OnCompletedHandler <ListResponse <MediaEntry> >(
                (ListResponse <MediaEntry> result, Exception e) =>
            {
                CodeExample.PrintObject(result);
                done = true;
            });

            MediaService.List(filter, pager)
            .SetCompletion(handler)
            .Execute(client);

            while (!done)
            {
                Thread.Sleep(100);
            }
        }
Ejemplo n.º 7
0
 static void Main(string[] args)
 {
     Client client = CodeExample.createKalturaClient();