/// <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;
		}
		/// <summary>
		/// Searches videos according to the criteria provided by the user. The criteria are constructed using field/value pairs specified in the command. Consider using the search_videos method for video searches rather than using the other find_video read methods. The search_videos method offers more flexible search and sorting options than the find_video methods, and is especially more flexible than the find_videos_by_text and find_videos_by_tags methods. For specifications of the search_videos method
		/// </summary>
		/// <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 displayName, shortDescription, and longDescription.
		/// </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 displayName, shortDescription, and longDescription.
		/// </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 displayName, shortDescription, and longDescription.
		/// </param>
		/// <param name="field_sort_by">
		/// 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. You can sort by the following fields: DISPLAY_NAME, REFERENCE_ID, PUBLISH_DATE, CREATION_DATE, MODIFIED_DATE, START_DATE, PLAYS_TRAILING_WEEK, PLAYS_TOTAL. Example: sort_by=PUBLISH_DATE:DESC
		/// </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="page_size">
		/// 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="page_number">
		/// The zero-indexed number of the page to return.
		/// </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">
		/// This is a MediaDeliveryTypeEnum with a value of http, http_ios or default. It is meaningful only if used together with the video_fields=FLVURL, videoFullLength, or renditions parameters. If universal delivery service is enabled for your account, set this optional parameter to http to return video by HTTP, rather than streaming. For Apple HTTP Live Streaming videos, set this optional parameter to http_ios to return the HTTP URL of the master index file as the videoFullLength parameter. For more information, see Delivering Videos with Apple HTTP Live Streaming.
		/// </param>
		/// <returns></returns>
		public BCQueryResult SearchVideos(Dictionary<VideoFields, string> required_matches, Dictionary<VideoFields, string> at_least_one_match, Dictionary<VideoFields, string> must_not_match, Dictionary<string, string> field_sort_by, bool exact, int page_size, int page_number, 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));
			if (field_sort_by != null) reqparams.Add("sort_by", field_sort_by.DicToString());
			if (page_size >= 0) reqparams.Add("page_size", page_size.ToString());
			if (page_number >= 0) reqparams.Add("page_number", page_number.ToString());

			return MultipleQueryHandler(reqparams, BCObjectType.videos, Account);
		}
		/// <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);
		}
		/// <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);
		}
		/// <summary>
		/// Finds videos related to the given video. Combines the name and short description of the given 
		/// video and searches for any partial matches in the name, description, and tags of all videos in 
		/// the Brightcove media library for this account. More precise ways of finding related videos include 
		/// tagging your videos by subject and using the find_videos_by_tags method to find videos that share 
		/// the same tags: or creating a playlist that includes videos that you know are related. 
		/// </summary>
		/// <param name="videoId">
		/// The id of the video we'd like related videos for.
		/// </param>
		/// <param name="howMany">
		/// Number of videos returned (-1 will return all) defaults to -1
		/// </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 FindRelatedVideos(long videoId, int howMany, 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_related_videos");
			reqparams.Add("video_id", videoId.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));
			if (howMany >= 0) reqparams.Add("page_size", howMany.ToString());

			return MultipleQueryHandler(reqparams, BCObjectType.videos, Account);
		}
		/// <summary>
		/// Finds a single video with the specified id.
		/// </summary>
		/// <param name="videoId">
		/// The id of the video you would like to retrieve.
		/// </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 BCVideo item
		/// </returns>
		public BCVideo FindVideoById(long videoId, 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_video_by_id");
			reqparams.Add("video_id", videoId.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));

			//Get the JSon reader returned from the APIRequest
			QueryResultPair qrp = BCAPIRequest.ExecuteRead(reqparams, Account);

			return JSON.Converter.Deserialize<BCVideo>(qrp.JsonResult);
		}
        /// <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);
        }
		/// <summary>
		/// Find a video based on its publisher-assigned reference ID. Unlike find_video_by_reference_id, this unfiltered version also returns videos that are unscheduled, inactive, or deleted. See Searching for Unavailable Videos with the Media API for more information about the find_video_by_reference_id_unfiltered method.
		/// </summary>
		/// <param name="referenceId">
		/// The publisher-assigned reference id for the video we're searching for.
		/// </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">
		/// This is a MediaDeliveryTypeEnum with a value of http, http_ios or default. It is meaningful only if used together with the video_fields=FLVURL, videoFullLength, or renditions parameters. If universal delivery service is enabled for your account, set this optional parameter to http to return video by HTTP, rather than streaming. For Apple HTTP Live Streaming videos, set this optional parameter to http_ios to return the HTTP URL of the master index file as the videoFullLength parameter. For more information, see Delivering Videos with Apple HTTP Live Streaming.
		/// </param>
		/// <returns>
		/// Returns a BCVideo item
		/// </returns>
		public BCVideo FindVideoByReferenceIdUnfiltered(String referenceId, 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_video_by_reference_id_unfiltered");
			reqparams.Add("reference_id", referenceId);
			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));

			//Get the JSon reader returned from the APIRequest
			string jsonStr = BCAPIRequest.ExecuteRead(reqparams, Account).JsonResult;
			return JSON.Converter.Deserialize<BCVideo>(jsonStr);
		}
		/// <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)
        {
            return FindAllPlaylists(howMany, sortBy, sortOrder, video_fields, custom_fields, playlist_fields, MediaDeliveryTypeEnum.DEFAULT, 0, false);
        }
		/// <summary>
		/// Given the id of a player, returns all the playlists assigned to that player.
		/// </summary>
		/// <param name="player_id">
		/// The player id whose playlists we want to return.
		/// </param>
		/// <param name="howMany">
		/// The number of videos to return (-1 will return all) defaults to -1
		/// </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 FindPlaylistsForPlayerId(long player_id, int howMany, List<VideoFields> video_fields, List<string> custom_fields, List<PlaylistFields> playlist_fields, MediaDeliveryTypeEnum media_delivery) {

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

			//Build the REST parameter list
			reqparams.Add("command", "find_playlists_for_player_id");
			reqparams.Add("player_id", player_id.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", playlist_fields.ToFieldString());
			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;
		}
Exemple #11
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);
        }
Exemple #12
0
        /// <summary>
        /// Given the id of a player, returns all the playlists assigned to that player.
        /// </summary>
        /// <param name="player_id">
        /// The player id whose playlists we want to return.
        /// </param>
        /// <param name="howMany">
        /// The number of videos to return (-1 will return all) defaults to -1
        /// </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 FindPlaylistsForPlayerId(long player_id, int howMany, List <VideoFields> video_fields, List <string> custom_fields, List <PlaylistFields> playlist_fields, MediaDeliveryTypeEnum media_delivery)
        {
            Dictionary <String, String> reqparams = new Dictionary <string, string>();

            //Build the REST parameter list
            reqparams.Add("command", "find_playlists_for_player_id");
            reqparams.Add("player_id", player_id.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", playlist_fields.ToFieldString());
            }
            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);
        }
Exemple #13
0
        /// <summary>
        /// Retrieve multiple playlists based on their publisher-assigned reference ids.
        /// </summary>
        /// <param name="reference_ids">
        /// The reference ids of the playlists we'd like to retrieve.
        /// </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 FindPlaylistsByReferenceIds(List <string> reference_ids, List <VideoFields> video_fields, List <string> custom_fields, List <PlaylistFields> playlist_fields, MediaDeliveryTypeEnum media_delivery)
        {
            Dictionary <String, String> reqparams = new Dictionary <string, string>();

            //Build the REST parameter list
            reqparams.Add("command", "find_playlists_by_reference_ids");
            reqparams.Add("reference_ids", Implode(reference_ids));
            reqparams.Add("media_delivery", media_delivery.ToString());
            if (playlist_fields != null)
            {
                reqparams.Add("playlist_fields", playlist_fields.ToFieldString());
            }
            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);
        }
Exemple #14
0
        /// <summary>
        /// Retrieve a playlist based on its publisher-assigned reference id.
        /// </summary>
        /// <param name="reference_id">
        /// The reference id of the playlist we'd like to retrieve.
        /// </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 BCPlaylist item
        /// </returns>
        public BCPlaylist FindPlaylistByReferenceId(string reference_id, List <VideoFields> video_fields, List <string> custom_fields, List <PlaylistFields> playlist_fields, MediaDeliveryTypeEnum media_delivery)
        {
            Dictionary <String, String> reqparams = new Dictionary <string, string>();

            //Build the REST parameter list
            reqparams.Add("command", "find_playlist_by_reference_id");
            reqparams.Add("reference_id", reference_id);
            reqparams.Add("media_delivery", media_delivery.ToString());
            if (playlist_fields != null)
            {
                reqparams.Add("playlist_fields", playlist_fields.ToFieldString());
            }
            if (video_fields != null)
            {
                reqparams.Add("video_fields", video_fields.ToFieldString());
            }
            if (custom_fields != null)
            {
                reqparams.Add("custom_fields", Implode(custom_fields));
            }

            //Get the JSon reader returned from the APIRequest
            string jsonStr = BCAPIRequest.ExecuteRead(reqparams, Account).JsonResult;

            return(JSON.Converter.Deserialize <BCPlaylist>(jsonStr));
        }
        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);
		}
		/// <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);
		}
		/// <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)
        {
            return FindVideosByText(text, howMany, sortBy, sortOrder, video_fields, custom_fields, media_delivery, 0, false);
        }
		/// <summary>
		/// Find multiple videos based on their publisher-assigned reference IDs. Unlike find_videos_by_reference_ids, this unfiltered version also returns videos that are unscheduled, inactive, or deleted. See Searching for Unavailable Videos with the Media API for more information about the find_videos_by_reference_ids_unfiltered method.
		/// </summary>
		/// <param name="referenceIds">
		/// The list of reference IDs for the videos we'd like to retrieve. This value is limited to 150 characters. The value cannot contain commas; to work around this issue, avoid using commas in reference_id values.
		/// </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">
		/// This is a MediaDeliveryTypeEnum with a value of http, http_ios or default. It is meaningful only if used together with the video_fields=FLVURL, videoFullLength, or renditions parameters. If universal delivery service is enabled for your account, set this optional parameter to http to return video by HTTP, rather than streaming. For Apple HTTP Live Streaming videos, set this optional parameter to http_ios to return the HTTP URL of the master index file as the videoFullLength parameter. For more information, see Delivering Videos with Apple HTTP Live Streaming.
		/// </param>
		/// <returns>
		/// Returns a BCQueryResult item
		/// </returns>
		public BCQueryResult FindVideosByReferenceIdsUnfiltered(List<String> referenceIds, 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_reference_ids_unfiltered");
			reqparams.Add("reference_ids", Implode(referenceIds));
			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));

			return MultipleQueryHandler(reqparams, BCObjectType.videos, Account);
		}
Exemple #19
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)
 {
     return(FindAllPlaylists(howMany, sortBy, sortOrder, video_fields, custom_fields, playlist_fields, MediaDeliveryTypeEnum.DEFAULT, 0, false));
 }