/// <summary>
        /// Find all playlists in this account.
        /// </summary>
        /// <param name="pageSize">Number of playlists returned per page. A page is a subset of all of the playlists that 
        /// satisfy the request. The maximum page size is 50.</param>
        /// <param name="pageNumber">The zero-indexed number of the page to return.</param>
        /// <param name="sortBy">The property that you'd like to sort the results by.</param>
        /// <param name="sortOrder">The order that you'd like the results sorted - ascending or descending.</param>
        /// <param name="videoFields">A list of the fields you wish to have populated in the Videos 
        /// contained in the playlists. 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 the Videos' FLVURL, renditions, FLVFullLength, 
        /// videoFullLength.</param>
        /// <param name="playlistFields">A list of the fields you wish to have populated in the Playlists 
        /// contained in the returned object. If you omit this parameter, all playlist fields are returned.</param>
        /// <param name="customFields">A 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="getItemCount">If true, also return how many total results there are.</param>
        /// <returns>A collection of Playlists that is the specified subset of all the playlists in this account.</returns>
        public BrightcoveItemCollection<BrightcovePlaylist> FindAllPlaylists(int pageSize, int pageNumber, SortBy sortBy, SortOrder sortOrder, IEnumerable<string> videoFields, 
            IEnumerable<string> playlistFields, IEnumerable<string> customFields, bool getItemCount)
        {
            NameValueCollection parms = BuildBasicReadParams("find_all_playlists");

            parms.Add("page_size", pageSize.ToString());
            parms.Add("page_number", pageNumber.ToString());
            parms.Add("sort_by", sortBy.ToBrightcoveName());
            parms.Add("sort_order", sortOrder.ToBrightcoveName());
            parms.Add("get_item_count", getItemCount.ToString().ToLower());

            if (videoFields != null)
            {
                parms.AddRange("video_fields", videoFields);
            }

            if (playlistFields != null)
            {
                parms.AddRange("playlist_fields", playlistFields);
            }

            if (customFields != null)
            {
                parms.AddRange("custom_fields", customFields);
            }

            return RunQuery<BrightcoveItemCollection<BrightcovePlaylist>>(parms);
        }
        /// <summary>
        /// Find all playlists in this account.
        /// </summary>
        /// <param name="pageSize">Number of playlists returned per page. A page is a subset of all of the playlists that
        /// satisfy the request. The maximum page size is 50.</param>
        /// <param name="pageNumber">The zero-indexed number of the page to return.</param>
        /// <param name="sortBy">The property that you'd like to sort the results by.</param>
        /// <param name="sortOrder">The order that you'd like the results sorted - ascending or descending.</param>
        /// <param name="videoFields">A list of the fields you wish to have populated in the Videos
        /// contained in the playlists. 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 the Videos' FLVURL, renditions, FLVFullLength,
        /// videoFullLength.</param>
        /// <param name="playlistFields">A list of the fields you wish to have populated in the Playlists
        /// contained in the returned object. If you omit this parameter, all playlist fields are returned.</param>
        /// <param name="customFields">A 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="getItemCount">If true, also return how many total results there are.</param>
        /// <returns>A collection of Playlists that is the specified subset of all the playlists in this account.</returns>
        public BrightcoveItemCollection <BrightcovePlaylist> FindAllPlaylists(int pageSize, int pageNumber, SortBy sortBy, SortOrder sortOrder, IEnumerable <string> videoFields,
                                                                              IEnumerable <string> playlistFields, IEnumerable <string> customFields, bool getItemCount)
        {
            NameValueCollection parms = BuildBasicReadParams("find_all_playlists");

            parms.Add("page_size", pageSize.ToString());
            parms.Add("page_number", pageNumber.ToString());
            parms.Add("sort_by", sortBy.ToBrightcoveName());
            parms.Add("sort_order", sortOrder.ToBrightcoveName());
            parms.Add("get_item_count", getItemCount.ToString().ToLower());

            if (videoFields != null)
            {
                parms.AddRange("video_fields", videoFields);
            }

            if (playlistFields != null)
            {
                parms.AddRange("playlist_fields", playlistFields);
            }

            if (customFields != null)
            {
                parms.AddRange("custom_fields", customFields);
            }

            return(RunQuery <BrightcoveItemCollection <BrightcovePlaylist> >(parms));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets all the audio tracks that have been modified since the given time.
        /// </summary>
        /// <param name="fromDate">The date of the oldest Audio Track which you would like returned, specified in UTC.</param>
        /// <param name="filters">A comma-separated list of filters, specifying which categories of audio tracks you would
        /// like returned. Valid filter values are PLAYABLE, UNSCHEDULED, INACTIVE, and DELETED.</param>
        /// <param name="pageSize">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.</param>
        /// <param name="pageNumber">The zero-indexed number of the page to return.</param>
        /// <param name="sortBy">The field by which to sort the results.</param>
        /// <param name="sortOrder">How to order the results: ascending or descending.</param>
        /// <param name="audioTrackFields">A list of the fields you wish to have populated in the audio tracks
        /// contained in the returned object.</param>
        /// <param name="getItemCount">If true, also return how many total results there are in this campaign.</param>
        /// <returns>All audio tracks that have been modified since the given time.</returns>
        public BrightcoveItemCollection <BrightcoveAudioTrack> FindModifiedAudioTracks(DateTime fromDate, IEnumerable <ModifiedVideoFilter> filters, int pageSize, int pageNumber,
                                                                                       SortBy sortBy, SortOrder sortOrder, IEnumerable <string> audioTrackFields, bool getItemCount)
        {
            NameValueCollection parms = BuildBasicReadParams("find_modified_audiotracks");

            parms.Add("from_date", fromDate.ToUnixMinutesUtc().ToString());

            if (filters != null)
            {
                parms.AddRange("filter", filters.Select(o => o.ToBrightcoveName()));
            }

            parms.Add("page_size", pageSize.ToString());
            parms.Add("page_number", pageNumber.ToString());
            parms.Add("get_item_count", getItemCount.ToString().ToLower());
            parms.Add("sort_by", sortBy.ToBrightcoveName());

            // work around an apparent bug in the API by not specifying sort order when it's "Ascending"
            if (sortOrder != SortOrder.Ascending)
            {
                parms.Add("sort_order", sortOrder.ToBrightcoveName());
            }

            if (audioTrackFields != null)
            {
                parms.AddRange("audiotrack_fields", audioTrackFields);
            }

            return(RunQuery <BrightcoveItemCollection <BrightcoveAudioTrack> >(parms));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Performs a search on all the tags of the audio tracks in this account, and returns a collection of audio tracks that
        /// contain the specified tags. Note that tags are case-sensitive.
        /// </summary>
        /// <param name="andTags">Limit the results to those that contain all of these tags.</param>
        /// <param name="orTags">Limit the results to those that contain at least one of these tags.</param>
        /// <param name="pageSize">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.</param>
        /// <param name="pageNumber">The zero-indexed number of the page to return.</param>
        /// <param name="sortBy">The field by which to sort the results. In this method, results can be sorted only by MODIFIED_DATE
        /// and PLAYS_TRAILING_WEEK.</param>
        /// <param name="sortOrder">How to order the results: ascending or descending.</param>
        /// <param name="audioTrackFields">A list of the fields you wish to have populated in the audio tracks contained
        /// in the returned object.</param>
        /// <param name="getItemCount">If true, also return how many total results there are.</param>
        /// <returns></returns>
        public BrightcoveItemCollection <BrightcoveAudioTrack> FindAudioTracksByTags(IEnumerable <string> andTags, IEnumerable <string> orTags, int pageSize, int pageNumber,
                                                                                     SortBy sortBy, SortOrder sortOrder, IEnumerable <string> audioTrackFields, bool getItemCount)
        {
            NameValueCollection parms = BuildBasicReadParams("find_audiotracks_by_tags");

            if (andTags != null)
            {
                parms.AddRange("and_tags", andTags);
            }

            if (orTags != null)
            {
                parms.AddRange("or_tags", orTags);
            }

            parms.Add("page_size", pageSize.ToString());
            parms.Add("page_number", pageNumber.ToString());
            parms.Add("get_item_count", getItemCount.ToString().ToLower());
            parms.Add("sort_by", sortBy.ToBrightcoveName());
            parms.Add("sort_order", sortOrder.ToBrightcoveName());

            if (audioTrackFields != null)
            {
                parms.AddRange("audiotrack_fields", audioTrackFields);
            }

            return(RunQuery <BrightcoveItemCollection <BrightcoveAudioTrack> >(parms));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Find all audio tracks in the Brightcove media library for this account.
        /// </summary>
        /// <param name="pageSize">Number of items returned per page. Maximum page size is 100.</param>
        /// <param name="pageNumber">The zero-indexed number of the page to return.</param>
        /// <param name="sortBy">The field by which to sort the results.</param>
        /// <param name="sortOrder">How to order the results: ascending or descending.</param>
        /// <param name="audioTrackFields">A list of the fields you wish to have populated in the audiotracks 
        /// contained in the returned object.</param>
        /// <param name="getItemCount">If true, also return how many total results there are.</param>
        /// <returns>A collection of audio tracks matching the specified search criteria.</returns>
        public BrightcoveItemCollection<BrightcoveAudioTrack> FindAllAudioTracks(int pageSize, int pageNumber, SortBy sortBy, SortOrder sortOrder, IEnumerable<string> audioTrackFields, bool getItemCount)
        {
            NameValueCollection parms = BuildBasicReadParams("find_all_audiotracks");

            parms.Add("get_item_count", getItemCount.ToString().ToLower());
            parms.Add("page_size", pageSize.ToString());
            parms.Add("page_number", pageNumber.ToString());
            parms.Add("sort_by", sortBy.ToBrightcoveName());
            parms.Add("sort_order", sortOrder.ToBrightcoveName());

            if (audioTrackFields != null)
            {
                parms.AddRange("audiotrack_fields", audioTrackFields);
            }

            return RunQuery<BrightcoveItemCollection<BrightcoveAudioTrack>>(parms);
        }
		/// <summary>
		/// Retrieves the videos uploaded by the specified user id. This method can be used to find videos submitted using
		/// the consumer-generated media (CGM) module.
		/// </summary>
		/// <param name="userId">The id of the user whose videos we'd like to retrieve.</param>
		/// <param name="pageSize">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.</param>
		/// <param name="pageNumber">The zero-indexed number of the page to return.</param>
		/// <param name="sortBy">The field by which to sort the results.</param>
		/// <param name="sortOrder">How to order the results: ascending or descending.</param>
		/// <param name="videoFields">A 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="customFields">A 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="getItemCount">If true, also return how many total results there are.</param>
		/// <returns>An ItemCollection representing the requested page of Videos uploaded by the specified user, 
		/// in the order specified.</returns>
		public BrightcoveItemCollection<BrightcoveVideo> FindVideosByUserId(string userId, int pageSize, int pageNumber, SortBy sortBy, SortOrder sortOrder,
																			IEnumerable<string> videoFields, IEnumerable<string> customFields, bool getItemCount)
		{
			NameValueCollection parms = BuildBasicReadParams("find_videos_by_user_id");

			parms.Add("user_id", userId);
			parms.Add("page_size", pageSize.ToString());
			parms.Add("page_number", pageNumber.ToString());
			parms.Add("sort_by", sortBy.ToBrightcoveName());
			parms.Add("sort_order", sortOrder.ToBrightcoveName());
			parms.Add("get_item_count", getItemCount.ToString().ToLower());

			if (videoFields != null)
			{
				parms.AddRange("video_fields", videoFields);
			}

			if (customFields != null)
			{
				parms.AddRange("custom_fields", customFields);
			}

			return RunQuery<BrightcoveItemCollection<BrightcoveVideo>>(parms);
		}
		/// <summary>
		/// Searches videos according to the criteria provided by the user.
		/// </summary>
		/// <param name="all">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. If the field's name is not present, it is 
		/// assumed to be name and shortDescription.</param>
		/// <param name="any">Specifies the field:value pairs for search criteria AT LEAST ONE of which 
		/// must be present to return a hit in the result set. If the field's name is not present, it is 
		/// assumed to be name and shortDescription.</param>
		/// <param name="none">Specifies the field:value pairs for search criteria that MUST NOT be present 
		/// to return a hit in the result set. If the field's name is not present, it is assumed to be 
		/// name and shortDescription.</param>
		/// <param name="pageSize">Number of items returned per page. (max 100)</param>
		/// <param name="pageNumber">The zero-indexed number of the page to return.</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="sortBy">Specifies the field by which to sort results.</param>
		/// <param name="sortOrder">Specifies the direction in which to sort results</param>
		/// <param name="videoFields">A 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="customFields">A 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="getItemCount">If true, also return how many total results there are.</param>
		/// <returns>A collection of videos matching the specified criteria.</returns>
		public BrightcoveItemCollection<BrightcoveVideo> SearchVideos(IEnumerable<FieldValuePair> all, IEnumerable<FieldValuePair> any, IEnumerable<FieldValuePair> none,
																	  int pageSize, int pageNumber, bool exact, SortBy sortBy, SortOrder sortOrder,
																	  IEnumerable<string> videoFields, IEnumerable<string> customFields, bool getItemCount)
		{
			NameValueCollection parms = BuildBasicReadParams("search_videos");

			parms.Add("get_item_count", getItemCount.ToString().ToLower());
			parms.Add("exact", exact.ToString().ToLower());
			parms.Add("page_size", pageSize.ToString());
			parms.Add("page_number", pageNumber.ToString());
			parms.Add("sort_by", sortBy.ToBrightcoveName());
			parms.Add("sort_order", sortOrder.ToBrightcoveName());

			if (videoFields != null)
			{
				parms.AddRange("video_fields", videoFields);
			}

			if (customFields != null)
			{
				parms.AddRange("custom_fields", customFields);
			}

			if (all != null)
			{
				parms.AddRange("all", all.Select(o => o.ToBrightcoveString()));
			}

			if (any != null)
			{
				parms.AddRange("any", any.Select(o => o.ToBrightcoveString()));
			}

			if (none != null)
			{
				parms.AddRange("none", none.Select(o => o.ToBrightcoveString()));
			}

			return RunQuery<BrightcoveItemCollection<BrightcoveVideo>>(parms);
		}
		/// <summary>
		/// Gets all the videos that have been modified since the given time.
		/// </summary>
		/// <param name="fromDate">The date of the oldest Video which you would like returned, specified in UTC time.</param>
		/// <param name="filters">A list of filters, specifying which categories of videos you would like returned. 
		/// Valid filter values are PLAYABLE, UNSCHEDULED, INACTIVE, and DELETED.</param>
		/// <param name="pageSize">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.</param>
		/// <param name="pageNumber">The zero-indexed number of the page to return.</param>
		/// <param name="sortBy">The field by which to sort the results.</param>
		/// <param name="sortOrder">How to order the results: ascending or descending.</param>
		/// <param name="videoFields">A 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="customFields">A 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="getItemCount">If true, also return how many total results there are.</param>
		/// <returns>All videos that have been modified since the given time.</returns>
		public BrightcoveItemCollection<BrightcoveVideo> FindModifiedVideos(DateTime fromDate, IEnumerable<ModifiedVideoFilter> filters, int pageSize, int pageNumber, SortBy sortBy, 
																			SortOrder sortOrder, IEnumerable<string> videoFields, IEnumerable<string> customFields, bool getItemCount)
		{
			NameValueCollection parms = BuildBasicReadParams("find_modified_videos");

			parms.Add("from_date", fromDate.ToUnixMinutesUtc().ToString());

			if (filters != null)
			{
				parms.AddRange("filter", filters.Select(o => o.ToBrightcoveName()));	
			}

			parms.Add("page_size", pageSize.ToString());
			parms.Add("page_number", pageNumber.ToString());
			parms.Add("sort_by", sortBy.ToBrightcoveName());
			parms.Add("sort_order", sortOrder.ToBrightcoveName());
			parms.Add("get_item_count", getItemCount.ToString().ToLower());

			if (videoFields != null)
			{
				parms.AddRange("video_fields", videoFields);
			}

			if (customFields != null)
			{
				parms.AddRange("custom_fields", customFields);
			}

			return RunQuery<BrightcoveItemCollection<BrightcoveVideo>>(parms);
		}
Ejemplo n.º 9
0
        /// <summary>
        /// Gets all the audio tracks that have been modified since the given time.
        /// </summary>
        /// <param name="fromDate">The date of the oldest Audio Track which you would like returned, specified in UTC.</param>
        /// <param name="filters">A comma-separated list of filters, specifying which categories of audio tracks you would 
        /// like returned. Valid filter values are PLAYABLE, UNSCHEDULED, INACTIVE, and DELETED.</param>
        /// <param name="pageSize">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.</param>
        /// <param name="pageNumber">The zero-indexed number of the page to return.</param>
        /// <param name="sortBy">The field by which to sort the results.</param>
        /// <param name="sortOrder">How to order the results: ascending or descending.</param>
        /// <param name="audioTrackFields">A list of the fields you wish to have populated in the audio tracks 
        /// contained in the returned object.</param>
        /// <param name="getItemCount">If true, also return how many total results there are in this campaign.</param>
        /// <returns>All audio tracks that have been modified since the given time.</returns>
        public BrightcoveItemCollection<BrightcoveAudioTrack> FindModifiedAudioTracks(DateTime fromDate, IEnumerable<ModifiedVideoFilter> filters, int pageSize, int pageNumber,
																					  SortBy sortBy, SortOrder sortOrder, IEnumerable<string> audioTrackFields, bool getItemCount)
        {
            NameValueCollection parms = BuildBasicReadParams("find_modified_audiotracks");

            parms.Add("from_date", fromDate.ToUnixMinutesUtc().ToString());

            if (filters != null)
            {
                parms.AddRange("filter", filters.Select(o => o.ToBrightcoveName()));
            }

            parms.Add("page_size", pageSize.ToString());
            parms.Add("page_number", pageNumber.ToString());
            parms.Add("get_item_count", getItemCount.ToString().ToLower());
            parms.Add("sort_by", sortBy.ToBrightcoveName());

            // work around an apparent bug in the API by not specifying sort order when it's "Ascending"
            if (sortOrder != SortOrder.Ascending)
            {
                parms.Add("sort_order", sortOrder.ToBrightcoveName());
            }

            if (audioTrackFields != null)
            {
                parms.AddRange("audiotrack_fields", audioTrackFields);
            }

            return RunQuery<BrightcoveItemCollection<BrightcoveAudioTrack>>(parms);
        }