Beispiel #1
0
        //this function checks if a given flavor system name exist in the account.
        static int?CheckIfFlavorExist(String name)
        {
            KalturaClient client = new KalturaClient(GetConfig());
            string        ks     = client.GenerateSession(ADMIN_SECRET, USER_ID, KalturaSessionType.ADMIN, PARTNER_ID, 86400, "");

            client.KS = ks;

            //verify that the account we're testing has the new iPad flavor enabled on the default conversion profile
            KalturaConversionProfile defaultProfile = client.ConversionProfileService.GetDefault();
            KalturaConversionProfileAssetParamsFilter flavorsListFilter = new KalturaConversionProfileAssetParamsFilter();

            flavorsListFilter.SystemNameEqual          = name;
            flavorsListFilter.ConversionProfileIdEqual = defaultProfile.Id;

            KalturaConversionProfileAssetParamsListResponse list = client.ConversionProfileAssetParamsService.List(flavorsListFilter);

            if (list.TotalCount > 0)
            {
                return(list.Objects[0].AssetParamsId);
            }
            else
            {
                return(null);
            }
        }
        public KalturaConversionProfile Add(KalturaConversionProfile conversionProfile)
        {
            KalturaParams kparams = new KalturaParams();

            if (conversionProfile != null)
            {
                kparams.Add("conversionProfile", conversionProfile.ToParams());
            }
            _Client.QueueServiceCall("conversionprofile", "add", kparams);
            if (this._Client.IsMultiRequest)
            {
                return(null);
            }
            XmlElement result = _Client.DoQueue();

            return((KalturaConversionProfile)KalturaObjectFactory.Create(result));
        }