Exemplo n.º 1
0
        /// <summary>
        /// Find all playlists in this account.
        /// </summary>
        /// <param name="howMany">
        /// Number of videos returned (-1 will return all) defaults to -1
        /// </param>
        /// <param name="sortBy">
        /// The field by which to sort (defaults to CREATION_DATE)
        /// </param>
        /// <param name="sortOrder">
        /// The direction by which to sort (default to DESC)
        /// </param>
        /// <param name="video_fields">
        /// A comma-separated list of the fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all)
        /// </param>
        /// <param name="custom_fields">
        /// A comma-separated list of the custom fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all)
        /// </param>
        /// <param name="playlist_fields">
        /// A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields.
        /// </param>
        /// <returns>
        /// Returns a BCQueryResult item
        /// </returns>
        public BCQueryResult FindAllPlaylists(int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List <VideoFields> video_fields, List <String> custom_fields, List <string> playlist_fields, MediaDeliveryTypeEnum media_delivery)
        {
            Dictionary <String, String> reqparams = new Dictionary <string, string>();

            //Build the REST parameter list
            reqparams.Add("command", "find_all_playlists");
            reqparams.Add("sort_order", sortOrder.ToString());
            reqparams.Add("sort_by", sortBy.ToString());
            reqparams.Add("media_delivery", media_delivery.ToString());
            if (howMany >= 0)
            {
                reqparams.Add("page_size", howMany.ToString());
            }
            if (playlist_fields != null)
            {
                reqparams.Add("playlist_fields", Implode(playlist_fields));
            }
            if (video_fields != null)
            {
                reqparams.Add("video_fields", video_fields.ToFieldString());
            }
            if (custom_fields != null)
            {
                reqparams.Add("custom_fields", Implode(custom_fields));
            }

            BCQueryResult qr = MultipleQueryHandler(reqparams, BCObjectType.playlists, Account);

            return(qr);
        }
Exemplo n.º 2
0
        public override BCResult FindAllVideos(int pageSize, int pageNumber, BCSortByType sortBy, BCSortOrderType sortOrder)
        {
            return CacheHelperFactory.Get(CacheHelperType.Empty).GetFromCache<BCResult>(String.Format("FindAllVideos_{0}{1}", pageSize, pageNumber), cacheTimeoutInMinutes, () =>
            {
                BCResult result;

                try
                {
                    if (_enableBrightcoveAPI == false)
                        throw new EmptyResultException(new BCResult(0, new List<BCVideo>()), emptyCacheTimeoutInMinutes);

                    result = base.FindAllVideos(pageSize, pageNumber, sortBy, sortOrder);
                }
                catch (Exception ex)
                {
                    // Log the exception
                    _log.Error("Brightcove API call failed.", ex);
                    throw new EmptyResultException(new BCResult(0, new List<BCVideo>()), emptyCacheTimeoutInMinutes);
                }

                if (result.totalCount == 0)
                    throw new EmptyResultException(new BCResult(0, new List<BCVideo>()), emptyCacheTimeoutInMinutes);

                return result;
            });
        }
Exemplo n.º 3
0
		/// <summary>
		/// Find all playlists in this account.
		/// </summary>
		/// <param name="howMany">
		/// Number of videos returned (-1 will return all) defaults to -1
		/// </param>
		/// <param name="sortBy">
		/// The field by which to sort (defaults to CREATION_DATE)
		/// </param>
		/// <param name="sortOrder">
		/// The direction by which to sort (default to DESC)
		/// </param>
		/// <param name="video_fields">
		/// A comma-separated list of the fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all) 
		/// </param>
		/// <param name="custom_fields">
		/// A comma-separated list of the custom fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all) 
		/// </param>
		/// <param name="playlist_fields">
		/// A comma-separated list of the fields you wish to have populated in the playlists contained in the returned object. Passing null populates with all fields. 
		/// </param>
		/// <returns>
		/// Returns a BCQueryResult item
		/// </returns>
		public BCQueryResult FindAllPlaylists(int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<String> custom_fields, List<string> playlist_fields, MediaDeliveryTypeEnum media_delivery) {

			Dictionary<String, String> reqparams = new Dictionary<string, string>();

			//Build the REST parameter list
			reqparams.Add("command", "find_all_playlists");
			reqparams.Add("sort_order", sortOrder.ToString());
			reqparams.Add("sort_by", sortBy.ToString());
			reqparams.Add("media_delivery", media_delivery.ToString());
			if (howMany >= 0) reqparams.Add("page_size", howMany.ToString());
			if (playlist_fields != null) reqparams.Add("playlist_fields", Implode(playlist_fields));
			if (video_fields != null) reqparams.Add("video_fields", video_fields.ToFieldString());
			if (custom_fields != null) reqparams.Add("custom_fields", Implode(custom_fields));

			BCQueryResult qr = MultipleQueryHandler(reqparams, BCObjectType.playlists, Account);

			return qr;
		}
Exemplo n.º 4
0
		public BCQueryResult FindVideosByTags(List<String> and_tags, List<String> or_tags, int pageSize, int pageNumber, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<String> custom_fields) {
			return FindVideosByTags(and_tags, or_tags, pageSize, pageNumber, sortBy, sortOrder, video_fields, custom_fields, MediaDeliveryTypeEnum.DEFAULT);
		}
        /// <summary>
        /// Searches through all the videos in this account, and returns a collection of videos whose name, short description, or long description contain a match for the specified text. 
        /// </summary>
        /// <param name="text">
        /// The text we're searching for.
        /// </param>
        /// <param name="howMany">
        /// Number of videos returned (-1 will return all) defaults to -1
        /// </param>
        /// <param name="sortBy">
        /// The field by which to sort (defaults to CREATION_DATE)
        /// </param>
        /// <param name="sortOrder">
        /// The direction by which to sort (default to DESC)
        /// </param>
        /// <param name="video_fields">
        /// A comma-separated list of the fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all) 
        /// </param>
        /// <param name="custom_fields">
        /// A comma-separated list of the custom fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all) 
        /// </param>
        /// <returns>
        /// Returns a BCQueryResult item
        /// </returns>
        public BCQueryResult FindVideosByText(string text, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<string> custom_fields, MediaDeliveryTypeEnum media_delivery, int pageNumber, bool getItemCount)
        {
            Dictionary<String, String> reqparams = new Dictionary<string, string>();
            string encText = HttpUtility.UrlEncode(text);
            string customFieldList = string.Empty;

            //Build the REST parameter list
            reqparams.Add("command", "search_videos");

            if (custom_fields != null)
            {
                foreach (string field in custom_fields)
                {
                    customFieldList += "&any=" + field + ":" + encText;
                }
            }

            // HACK HACK - the API has changed at Brightcove - now takes multiple "any" params, but this SDK does not allow duplicate keys
            reqparams.Add("any=" + encText + customFieldList + "&any", "tag:" + text);

            reqparams.Add("media_delivery", media_delivery.ToString());
            if (video_fields != null) reqparams.Add("video_fields", video_fields.ToFieldString());
            if (custom_fields != null) reqparams.Add("custom_fields", Implode(custom_fields));
            reqparams.Add("sort_order", sortOrder.ToString());
            if (howMany >= 0) reqparams.Add("page_size", howMany.ToString());
            if (pageNumber > 0) reqparams.Add("page_number", pageNumber.ToString());
            if (getItemCount) reqparams.Add("get_item_number", "true");

            return MultipleQueryHandler(reqparams, BCObjectType.videos, Account);
        }
Exemplo n.º 6
0
		public BCQueryResult FindVideosByText(string text, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields) {
			return FindVideosByText(text, howMany, sortBy, sortOrder, video_fields, null);
		}
Exemplo n.º 7
0
		public BCQueryResult FindVideosByTags(List<String> and_tags, List<String> or_tags, BCSortByType sortBy, BCSortOrderType sortOrder) {
			return FindVideosByTags(and_tags, or_tags, -1, sortBy, sortOrder);
		}
Exemplo n.º 8
0
		public BCQueryResult FindModifiedVideos(DateTime from_date, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<string> custom_fields, List<string> filter) {
			return FindModifiedVideos(from_date, howMany, sortBy, sortOrder, video_fields, custom_fields, filter, MediaDeliveryTypeEnum.DEFAULT);
		}
Exemplo n.º 9
0
		public BCQueryResult FindVideosByText(string text, BCSortOrderType sortOrder) {
			return FindVideosByText(text, -1, BCSortByType.CREATION_DATE, sortOrder, null, null);
		}
Exemplo n.º 10
0
		/// <summary>
		/// Gets all the videos associated with the given campaign id
		/// </summary>
		/// <param name="campaignId">
		/// The id of the campaign you'd like to fetch videos for.
		/// </param>
		/// <param name="howMany">
		/// Number of videos returned (-1 will return all) defaults to -1
		/// </param>
		/// <param name="sortBy">
		/// The field by which to sort (defaults to CREATION_DATE)
		/// </param>
		/// <param name="sortOrder">
		/// The direction by which to sort (default to DESC)
		/// </param>
		/// <param name="video_fields">
		/// A comma-separated list of the fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all) 
		/// </param>
		/// <param name="custom_fields">
		/// A comma-separated list of the custom fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all) 
		/// </param>
		/// <returns>
		/// Returns a BCQueryResult item
		/// </returns>
		public BCQueryResult FindVideosByCampaignId(long campaignId, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<string> custom_fields, MediaDeliveryTypeEnum media_delivery) {

			Dictionary<String, String> reqparams = new Dictionary<string, string>();

			//Build the REST parameter list
			reqparams.Add("command", "find_videos_by_campaign_id");
			reqparams.Add("campaign_id", campaignId.ToString());
			reqparams.Add("media_delivery", media_delivery.ToString());
			if (video_fields != null) reqparams.Add("video_fields", video_fields.ToFieldString());
			if (custom_fields != null) reqparams.Add("custom_fields", Implode(custom_fields));
			reqparams.Add("sort_order", sortOrder.ToString());
			reqparams.Add("sort_by", sortBy.ToString());
			if (howMany >= 0) reqparams.Add("page_size", howMany.ToString());

			return MultipleQueryHandler(reqparams, BCObjectType.videos, Account);
		}
Exemplo n.º 11
0
		public BCQueryResult FindModifiedVideos(DateTime from_date, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder) {
			return FindModifiedVideos(from_date, howMany, sortBy, sortOrder, null);
		}
        public BCQueryResult FindAllVideos(int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<string> custom_fields, MediaDeliveryTypeEnum media_delivery, int pageNumber, bool getItemCount)
        {

			Dictionary<String, String> reqparams = new Dictionary<string, string>();

			//Build the REST parameter list
			reqparams.Add("command", "find_all_videos");
			if (video_fields != null) reqparams.Add("video_fields", video_fields.ToFieldString());
			if (custom_fields != null) reqparams.Add("custom_fields", Implode(custom_fields));
			reqparams.Add("sort_order", sortOrder.ToString());
			reqparams.Add("sort_by", sortBy.ToString());
			reqparams.Add("media_delivery", media_delivery.ToString());
			if (howMany >= 0) reqparams.Add("page_size", howMany.ToString());
            if (pageNumber > 0) reqparams.Add("page_number", pageNumber.ToString());
            if (getItemCount) reqparams.Add("get_item_count", "true");

			return MultipleQueryHandler(reqparams, BCObjectType.videos, Account);
		}
Exemplo n.º 13
0
		public BCQueryResult FindVideosByCampaignId(long campaignId, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields) {
			return FindVideosByCampaignId(campaignId, howMany, sortBy, sortOrder, video_fields, null);
		}
		/// <summary>
		/// This will return a generic search for videos
		/// </summary>
		/// <param name="howMany">
		/// The number of videos to return (-1 will return all) defaults to -1
		/// </param>
		/// <param name="sortBy">
		/// The field by which to sort (defaults to CREATION_DATE)
		/// </param>
		/// <param name="sortOrder">
		/// The direction by which to sort (default to DESC)
		/// </param>
		/// <param name="video_fields">
		/// A comma-separated list of the fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all) 
		/// </param>
		/// <param name="custom_fields">
		/// A comma-separated list of the custom fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all) 
		/// </param>
		/// <returns>
		/// Returns a BCQueryResult item
		/// </returns>
        public BCQueryResult FindAllVideos(int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<string> custom_fields, MediaDeliveryTypeEnum media_delivery)
        {
            return FindAllVideos(howMany, sortBy, sortOrder, video_fields, custom_fields, media_delivery, 0, false);
        }
		/*
        public BCQueryResult SearchVideos(int howMany, Dictionary<VideoFields, string> required_matches) {
            return SearchVideos(howMany, required_matches, null);
        }

        public BCQueryResult SearchVideos(int howMany, Dictionary<VideoFields, string> required_matches, Dictionary<VideoFields, string> at_least_one_match) {
            return SearchVideos(howMany, required_matches, at_least_one_match, null);
        }

        public BCQueryResult SearchVideos(int howMany, Dictionary<VideoFields, string> required_matches, Dictionary<VideoFields, string> at_least_one_match, Dictionary<VideoFields, string> must_not_match) {
            return SearchVideos(howMany, required_matches, at_least_one_match, must_not_match, BCSortOrderType.ASC);
        }

        public BCQueryResult SearchVideos(int howMany, Dictionary<VideoFields, string> required_matches, Dictionary<VideoFields, string> at_least_one_match, Dictionary<VideoFields, string> must_not_match, BCSortOrderType sortOrder) {
            return SearchVideos(howMany, required_matches, at_least_one_match, must_not_match, sortOrder, true);
        }

        public BCQueryResult SearchVideos(int howMany, Dictionary<VideoFields, string> required_matches, Dictionary<VideoFields, string> at_least_one_match, Dictionary<VideoFields, string> must_not_match, BCSortOrderType sortOrder, bool exact) {
            return SearchVideos(howMany, required_matches, at_least_one_match, must_not_match, sortOrder, exact, null);
        }

        public BCQueryResult SearchVideos(int howMany, Dictionary<VideoFields, string> required_matches, Dictionary<VideoFields, string> at_least_one_match, Dictionary<VideoFields, string> must_not_match, BCSortOrderType sortOrder, bool exact, List<VideoFields> video_fields) {
            return SearchVideos(howMany, required_matches, at_least_one_match, must_not_match, sortOrder, exact, video_fields, null);
        }

        public BCQueryResult SearchVideos(int howMany, Dictionary<VideoFields, string> required_matches, Dictionary<VideoFields, string> at_least_one_match, Dictionary<VideoFields, string> must_not_match, BCSortOrderType sortOrder, bool exact, List<VideoFields> video_fields, List<string> custom_fields) {
            return SearchVideos(howMany, required_matches, at_least_one_match, must_not_match, sortOrder, exact, video_fields, custom_fields, MediaDeliveryTypeEnum.DEFAULT);
        }

        public BCQueryResult SearchVideos(int howMany, BCSortOrderType sortOrder) {
            return SearchVideos(howMany, sortOrder, true);
        }

        public BCQueryResult SearchVideos(int howMany, BCSortOrderType sortOrder, bool exact) {
            return SearchVideos(howMany, null, null, null, sortOrder, exact);
        }

        public BCQueryResult SearchVideos(int howMany, BCSortOrderType sortOrder, List<VideoFields> video_fields) {
            return SearchVideos(howMany, sortOrder, true, video_fields, null);
        }

        public BCQueryResult SearchVideos(int howMany, bool exact, List<VideoFields> video_fields) {
            return SearchVideos(howMany, BCSortOrderType.ASC, exact, video_fields, null);
        }

        public BCQueryResult SearchVideos(int howMany, bool exact, List<VideoFields> video_fields) {
            return SearchVideos(howMany, BCSortOrderType.ASC, exact, video_fields, null);
        }

        public BCQueryResult SearchVideos(int howMany, BCSortOrderType sortOrder, bool exact, List<VideoFields> video_fields) {
            return SearchVideos(howMany, sortOrder, exact, video_fields, null);
        }

        public BCQueryResult SearchVideos(int howMany, BCSortOrderType sortOrder, bool exact, List<VideoFields> video_fields, List<string> custom_fields) {
            return SearchVideos(howMany, sortOrder, exact, video_fields, custom_fields, MediaDeliveryTypeEnum.DEFAULT);
        }

        public BCQueryResult SearchVideos(int howMany, BCSortOrderType sortOrder, bool exact, List<VideoFields> video_fields, List<string> custom_fields, MediaDeliveryTypeEnum media_delivery) {
            return SearchVideos(howMany, null, null, null, sortOrder, exact, video_fields, custom_fields, MediaDeliveryTypeEnum.DEFAULT);
        }
        */

		/// <summary>
		/// 
		/// </summary>
		/// <param name="howMany">
		/// Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 100; if you do not set this argument, or if you set it to an integer > 100, your results will come back as if you had set page_size=100.
		/// </param>
		/// <param name="required_matches">
		/// Specifies the field:value pairs for search criteria that MUST be present in the index in order to return a hit in the result set. The format is fieldName:value. If the field's name is not present, it is assumed to be name and shortDescription.
		/// </param>
		/// <param name="at_least_one_match">
		/// Specifies the field:value pairs for search criteria AT LEAST ONE of which must be present to return a hit in the result set. The format is fieldName:value. If the field's name is not present, it is assumed to be name and shortDescription.
		/// </param>
		/// <param name="must_not_match">
		/// Specifies the field:value pairs for search criteria that MUST NOT be present to return a hit in the result set. The format is fieldName:value. If the field's name is not present, it is assumed to be name and shortDescription.
		/// </param>
		/// <param name="sortOrder">
		/// Specifies the field to sort by, and the direction to sort in. This is specified as: sortFieldName:direction If the direction is not provided, it is assumed to be in ascending order Specify the direction as "asc" for ascending or "desc" for descending.
		/// </param>
		/// <param name="exact">
		/// If true, disables fuzzy search and requires an exact match of search terms. A fuzzy search does not require an exact match of the indexed terms, but will return a hit for terms that are closely related based on language-specific criteria. The fuzzy search is available only if your account is based in the United States.
		/// </param>
		/// <param name="video_fields">
		/// A comma-separated list of the fields you wish to have populated in the Videos  contained in the returned object. If you omit this parameter, the method returns the following fields of the video: id, name, shortDescription, longDescription, creationDate, publisheddate, lastModifiedDate, linkURL, linkText, tags, videoStillURL, thumbnailURL, referenceId, length, economics, playsTotal, playsTrailingWeek. If you use a token with URL access, this method also returns FLVURL, renditions, FLVFullLength, videoFullLength.
		/// </param>
		/// <param name="custom_fields">
		/// A comma-separated list of the custom fields  you wish to have populated in the videos contained in the returned object. If you omit this parameter, no custom fields are returned, unless you include the value 'customFields' in the video_fields parameter.
		/// </param>
		/// <param name="media_delivery">
		/// If universal delivery service  is enabled for your account, set this optional parameter to http to return video by HTTP, rather than streaming. Meaningful only if used together with the video_fields=FLVURL, videoFullLength, or renditions parameters. This is a MediaDeliveryTypeEnum with a value of http or default.
		/// </param>
		/// <returns></returns>
		public BCQueryResult SearchVideos(int howMany, Dictionary<VideoFields, string> required_matches, Dictionary<VideoFields, string> at_least_one_match, Dictionary<VideoFields, string> must_not_match, BCSortOrderType sortOrder, bool exact, List<VideoFields> video_fields, List<string> custom_fields, MediaDeliveryTypeEnum media_delivery) {

			Dictionary<String, String> reqparams = new Dictionary<string, string>();

			//Build the REST parameter list
			reqparams.Add("command", "search_videos");
			if (required_matches != null) reqparams.Add("all", required_matches.DicToString());
			if (at_least_one_match != null) reqparams.Add("any", at_least_one_match.DicToString());
			if (must_not_match != null) reqparams.Add("none", must_not_match.DicToString());
			reqparams.Add("exact", exact.ToString());
			reqparams.Add("media_delivery", media_delivery.ToString());
			if (video_fields != null) reqparams.Add("video_fields", video_fields.ToFieldString());
			if (custom_fields != null) reqparams.Add("custom_fields", Implode(custom_fields));
			reqparams.Add("sort_order", sortOrder.ToString());
			if (howMany >= 0) reqparams.Add("page_size", howMany.ToString());

			return MultipleQueryHandler(reqparams, BCObjectType.videos, Account);
		}
Exemplo n.º 16
0
 public BCQueryResult FindAllPlaylists(int howMany, BCSortByType sortBy, BCSortOrderType sortOrder)
 {
     return(FindAllPlaylists(howMany, sortBy, sortOrder, null));
 }
Exemplo n.º 17
0
 public BCQueryResult FindAllPlaylists(int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List <VideoFields> video_fields, List <String> custom_fields, List <string> playlist_fields)
 {
     return(FindAllPlaylists(howMany, sortBy, sortOrder, video_fields, custom_fields, playlist_fields, MediaDeliveryTypeEnum.DEFAULT));
 }
Exemplo n.º 18
0
 public BCQueryResult FindAllPlaylists(int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List <VideoFields> video_fields, List <String> custom_fields)
 {
     return(FindAllPlaylists(howMany, sortBy, sortOrder, video_fields, custom_fields, null));
 }
Exemplo n.º 19
0
		public BCQueryResult FindVideosByCampaignId(long campaignId, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<string> custom_fields) {
			return FindVideosByCampaignId(campaignId, howMany, sortBy, sortOrder, video_fields, custom_fields, MediaDeliveryTypeEnum.DEFAULT);
		}
Exemplo n.º 20
0
		public BCQueryResult FindAllVideos(BCSortOrderType sortOrder) {
			return FindAllVideos(-1, BCSortByType.CREATION_DATE, sortOrder);
		}
Exemplo n.º 21
0
		public BCQueryResult FindModifiedVideos(DateTime from_date, int howMany, BCSortOrderType sortOrder) {
			return FindModifiedVideos(from_date, howMany, BCSortByType.CREATION_DATE, sortOrder);
		}
Exemplo n.º 22
0
		public BCQueryResult FindAllVideos(BCSortByType sortBy, BCSortOrderType sortOrder) {
			return FindAllVideos(-1, sortBy, sortOrder);
		}
Exemplo n.º 23
0
		public BCQueryResult FindModifiedVideos(DateTime from_date, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<string> custom_fields) {
			return FindModifiedVideos(from_date, howMany, sortBy, sortOrder, video_fields, custom_fields, null);
		}
Exemplo n.º 24
0
		public BCQueryResult FindAllVideos(int howMany, BCSortByType sortBy, BCSortOrderType sortOrder) {
			return FindAllVideos(howMany, sortBy, sortOrder, null);
		}
Exemplo n.º 25
0
		/// <summary>
		/// This will find all modified videos
		/// </summary>
		/// <param name="from_date">The date, specified in minutes since January 1st, 1970 00:00:00 GMT, of the oldest Video which you would like returned.</param>
		/// <param name="howMany">Number of items returned per page. A page is a subset of all of the items that satisfy the request. The maximum page size is 25; if you do not set this argument, or if you set it to an integer > 25, your results will come back as if you had set page_size=25.</param>
		/// <param name="sortBy">The field by which to sort the results. A SortByType: One of PUBLISH_DATE, CREATION_DATE, MODIFIED_DATE, PLAYS_TOTAL, PLAYS_TRAILING_WEEK.</param>
		/// <param name="sortOrder">How to order the results: ascending (ASC) or descending (DESC).</param>
		/// <param name="video_fields">A comma-separated list of the fields you wish to have populated in the videos contained in the returned object. If you omit this parameter, the method returns the following fields of the video: id, name, shortDescription, longDescription, creationDate, publisheddate, lastModifiedDate, linkURL, linkText, tags, videoStillURL, thumbnailURL, referenceId, length, economics, playsTotal, playsTrailingWeek. If you use a token with URL access, this method also returns FLVURL, renditions, FLVFullLength, videoFullLength.</param>
		/// <param name="custom_fields">A comma-separated list of the custom fields you wish to have populated in the videos contained in the returned object. If you omit this parameter, no custom fields are returned, unless you include the value 'customFields' in the video_fields parameter.</param>
		/// <param name="filter">A comma-separated list of filters, specifying which categories of videos you would like returned. Valid filter values are PLAYABLE, UNSCHEDULED, INACTIVE, and DELETED.</param>
		/// <param name="media_delivery">If universal delivery service is enabled for your account, set this optional parameter to http to return video by HTTP, rather than streaming. Meaningful only if used together with the video_fields=FLVURL, videoFullLength, or renditions parameters. This is a MediaDeliveryTypeEnum with a value of http or default.</param>
		/// <returns>Returns a BCQueryResult Item</returns>
		public BCQueryResult FindModifiedVideos(DateTime from_date, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<string> custom_fields, List<string> filter, MediaDeliveryTypeEnum media_delivery) {

			Dictionary<String, String> reqparams = new Dictionary<string, string>();

			//Build the REST parameter list
			reqparams.Add("command", "find_modified_videos");
			if (from_date != null) reqparams.Add("from_date", from_date.ToUnixTime());
			if (video_fields != null) reqparams.Add("video_fields", video_fields.ToFieldString());
			if (custom_fields != null) reqparams.Add("custom_fields", Implode(custom_fields));
			if (filter != null) reqparams.Add("filter", Implode(filter));
			reqparams.Add("sort_order", sortOrder.ToString());
			reqparams.Add("sort_by", sortBy.ToString());
			reqparams.Add("media_delivery", media_delivery.ToString());
			if (howMany >= 0) reqparams.Add("page_size", howMany.ToString());

			return MultipleQueryHandler(reqparams, BCObjectType.videos, Account);
		}
Exemplo n.º 26
0
		public BCQueryResult FindAllVideos(int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields) {
			return FindAllVideos(howMany, sortBy, sortOrder, video_fields, null);
		}
Exemplo n.º 27
0
		public BCQueryResult FindVideosByText(string text, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder) {
			return FindVideosByText(text, howMany, sortBy, sortOrder, null, null);
		}
Exemplo n.º 28
0
		public BCQueryResult FindVideosByUserId(long userId, BCSortOrderType sortOrder) {
			return FindVideosByUserId(userId, -1, BCSortByType.CREATION_DATE, sortOrder, null, null);
		}
Exemplo n.º 29
0
		public BCQueryResult FindVideosByText(string text, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<string> custom_fields) {
			return FindVideosByText(text, howMany, sortBy, sortOrder, video_fields, custom_fields, MediaDeliveryTypeEnum.DEFAULT);
		}
Exemplo n.º 30
0
		public BCQueryResult FindVideosByUserId(long userId, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder) {
			return FindVideosByUserId(userId, howMany, sortBy, sortOrder, null, null);
		}
Exemplo n.º 31
0
		public BCQueryResult FindVideosByTags(List<String> and_tags, List<String> or_tags, int pageSize, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields) {
			return FindVideosByTags(and_tags, or_tags, pageSize, sortBy, sortOrder, video_fields, null);
		}
Exemplo n.º 32
0
		public BCQueryResult FindVideosByCampaignId(long campaignId, BCSortOrderType sortOrder) {
			return FindVideosByCampaignId(campaignId, -1, BCSortByType.CREATION_DATE, sortOrder, null, null);
		}
Exemplo n.º 33
0
		/// <summary>
		/// Performs a search on all the tags of the videos in this account, and returns a collection of videos that contain the specified tags. Note that tags are not case-sensitive. 
		/// </summary>
		/// <param name="and_tags">
		/// Limit the results to those that contain all of these tags.
		/// </param>
		/// <param name="or_tags">
		/// Limit the results to those that contain at least one of these tags.
		/// </param>
		/// <param name="pageSize">
		/// Number of videos returned (-1 will return all) defaults to -1 max is 100
		/// </param>
		/// <param name="pageNumber">
		/// The number of page to return. Default is 0 (First page)
		/// </param>
		/// <param name="sortBy">
		/// The field by which to sort (defaults to CREATION_DATE)
		/// </param>
		/// <param name="sortOrder">
		/// The direction by which to sort (default to DESC)
		/// </param>
		/// <param name="video_fields">
		/// A comma-separated list of the fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all) 
		/// </param>
		/// <param name="custom_fields">
		/// A comma-separated list of the custom fields you wish to have populated in the videos contained in the returned object. Passing null populates with all fields. (defaults to all) 
		/// </param>
		/// <returns>
		/// Returns a BCQueryResult item
		/// </returns>
		public BCQueryResult FindVideosByTags(List<String> and_tags, List<String> or_tags, int pageSize, int pageNumber, BCSortByType sortBy, BCSortOrderType sortOrder, List<VideoFields> video_fields, List<String> custom_fields, MediaDeliveryTypeEnum media_delivery) {

			Dictionary<String, String> reqparams = new Dictionary<string, string>();

			//Build the REST parameter list
			reqparams.Add("command", "find_videos_by_tags");
			if (and_tags != null) reqparams.Add("and_tags", Implode(and_tags));
			if (or_tags != null) reqparams.Add("or_tags", Implode(or_tags));
			if (video_fields != null) reqparams.Add("video_fields", video_fields.ToFieldString());
			if (custom_fields != null) reqparams.Add("custom_fields", Implode(custom_fields));
			reqparams.Add("sort_order", sortOrder.ToString());
			reqparams.Add("sort_by", sortBy.ToString());
			reqparams.Add("media_delivery", media_delivery.ToString());
			if (pageSize >= 0) reqparams.Add("page_size", pageSize.ToString());
			if (pageNumber >= 0) reqparams.Add("page_number", pageNumber.ToString());

			return MultipleQueryHandler(reqparams, BCObjectType.videos, Account);
		}
Exemplo n.º 34
0
		public BCQueryResult FindVideosByCampaignId(long campaignId, int howMany, BCSortByType sortBy, BCSortOrderType sortOrder) {
			return FindVideosByCampaignId(campaignId, howMany, sortBy, sortOrder, null, null);
		}