/// <summary>
 /// Add a thumbnail asset to the specified audio track.
 /// </summary>
 /// <param name="image">A BrightcoveImage containing the metadata for the image you'd like to create (or update).</param>
 /// <param name="fileToUpload">The full path of the file to be uploaded.</param>
 /// <param name="audioTrackId">The ID of the audio track to which you'd like to assign the image.</param>
 /// <param name="resize">Set this to false if you don't want your image to be automatically resized to the default size for its type.
 /// By default images will be resized.</param>
 /// <returns>The image that was added or updated.</returns>
 public BrightcoveImage AddAudioImage(BrightcoveImage image, string fileToUpload, long audioTrackId, bool resize)
 {
     using (FileStream fs = File.OpenRead(fileToUpload))
     {
         string fileName = new FileInfo(fileToUpload).Name;
         return(AddAudioImage(image, new FileUploadInfo(fs, fileName), audioTrackId, resize));
     }
 }
Пример #2
0
 /// <summary>
 /// Add a new thumbnail or video still image to a video, or assign an existing image to another video.
 /// </summary>
 /// <param name="image">The metadata for the image you'd like to create (or update).</param>
 /// <param name="fileToUpload">The full path of the file to be uploaded.</param>
 /// <param name="videoReferenceId">The reference ID of the video to which you'd like to assign the image.</param>
 /// <param name="resize">Set this to false if you don't want your image to be automatically resized to the default size for its type.
 /// By default images will be resized.</param>
 /// <returns>The image that was added or updated</returns>
 public BrightcoveImage AddImage(BrightcoveImage image, string fileToUpload, string videoReferenceId, bool resize)
 {
     using (FileStream fs = File.OpenRead(fileToUpload))
     {
         string fileName = new FileInfo(fileToUpload).Name;
         return(AddImage(image, new FileUploadInfo(fs, fileName), videoReferenceId, resize));
     }
 }
Пример #3
0
        public void AddImage_Test_VideoRefId()
        {
            BrightcoveImage image = new BrightcoveImage();

            image.Type = ImageType.Thumbnail;

            _api.AddImage(image, FileToUpload, "1942305739001");

            // TODO: not sure how to verify this worked other than the lack of error
        }
Пример #4
0
        public void AddImage_Test_VideoRefId()
        {
            BrightcoveImage image = new BrightcoveImage
            {
                Type = ImageType.Thumbnail
            };

            Api.AddAudioImage(image, TestImage, AudioTrack.ReferenceId);

            // TODO: not sure how to verify this worked other than the lack of error
        }
        public void AddLogoOverlay_Test_Basic()
        {
            BrightcoveImage image = new BrightcoveImage();

            image.Type = ImageType.LogoOverlay;

            BrightcoveLogoOverlay logoOverlay = new BrightcoveLogoOverlay();

            logoOverlay.Image = image;

            _api.AddLogoOverlay(logoOverlay, FileToUpload, 1942305739001);

            // TODO: not sure how to verify this worked other than the lack of error
        }
        /// <summary>
        /// Add a thumbnail asset to the specified audio track.
        /// </summary>
        /// <param name="image">A BrightcoveImage containing the metadata for the image you'd like to create (or update).</param>
        /// <param name="fileUploadInfo">Information for the file to be uploaded.</param>
        /// <param name="audioTrackId">The ID of the audio track to which you'd like to assign the image.</param>
        /// <param name="audioTrackReferenceId">The reference ID of the audio track to which you'd like to assign the image.</param>
        /// <param name="resize">Set this to false if you don't want your image to be automatically resized to the default size for its type.
        /// By default images will be resized.</param>
        /// <returns>The image that was added or updated.</returns>
        private BrightcoveImage DoAddAudioImage(BrightcoveImage image, FileUploadInfo fileUploadInfo, long audioTrackId, string audioTrackReferenceId, bool resize)
        {
            string propName;
            object propValue;

            GetIdValuesForUpload(audioTrackId, audioTrackReferenceId, "audiotrack_id", "audiotrack_reference_id", out propName, out propValue);

            BrightcoveParamCollection parms = CreateWriteParamCollection("add_audio_image",
                                                                         methodParams =>
            {
                methodParams.Add("image", image);
                methodParams.Add("resize", resize.ToString().ToLower());
                methodParams.Add(propName, propValue);
            });

            return(RunFilePost <BrightcoveResultContainer <BrightcoveImage> >(parms, fileUploadInfo).Result);
        }
 /// <summary>
 /// Add a thumbnail asset to the specified audio track.
 /// </summary>
 /// <param name="image">A BrightcoveImage containing the metadata for the image you'd like to create (or update).</param>
 /// <param name="fileUploadInfo">Information for the file to be uploaded.</param>
 /// <param name="audioTrackReferenceId">The reference ID of the audio track to which you'd like to assign the image.</param>
 /// <param name="resize">Set this to false if you don't want your image to be automatically resized to the default size for its type.
 /// By default images will be resized.</param>
 /// <returns>The image that was added or updated.</returns>
 public BrightcoveImage AddAudioImage(BrightcoveImage image, FileUploadInfo fileUploadInfo, string audioTrackReferenceId, bool resize)
 {
     return(DoAddAudioImage(image, fileUploadInfo, -1, audioTrackReferenceId, resize));
 }
 /// <summary>
 /// Add a thumbnail asset to the specified audio track.
 /// </summary>
 /// <param name="image">A BrightcoveImage containing the metadata for the image you'd like to create (or update).</param>
 /// <param name="fileUploadInfo">Information for the file to be uploaded.</param>
 /// <param name="audioTrackId">The ID of the audio track to which you'd like to assign the image.</param>
 /// <param name="resize">Set this to false if you don't want your image to be automatically resized to the default size for its type.
 /// By default images will be resized.</param>
 /// <returns>The image that was added or updated.</returns>
 public BrightcoveImage AddAudioImage(BrightcoveImage image, FileUploadInfo fileUploadInfo, long audioTrackId, bool resize)
 {
     return(DoAddAudioImage(image, fileUploadInfo, audioTrackId, null, resize));
 }
 /// <summary>
 /// Add a thumbnail asset to the specified audio track.
 /// </summary>
 /// <param name="image">A BrightcoveImage containing the metadata for the image you'd like to create (or update).</param>
 /// <param name="fileToUpload">The full path of the file to be uploaded.</param>
 /// <param name="audioTrackReferenceId">The reference ID of the audio track to which you'd like to assign the image.</param>
 /// <returns>The image that was added or updated.</returns>
 public BrightcoveImage AddAudioImage(BrightcoveImage image, string fileToUpload, string audioTrackReferenceId)
 {
     return(AddAudioImage(image, fileToUpload, audioTrackReferenceId, true));
 }
Пример #10
0
 /// <summary>
 /// Add a new thumbnail or video still image to a video, or assign an existing image to another video.
 /// </summary>
 /// <param name="image">The metadata for the image you'd like to create (or update).</param>
 /// <param name="fileToUpload">The full path of the file to be uploaded.</param>
 /// <param name="videoReferenceId">The reference ID of the video to which you'd like to assign the image.</param>
 /// <returns>The image that was added or updated</returns>
 public BrightcoveImage AddImage(BrightcoveImage image, string fileToUpload, string videoReferenceId)
 {
     return(AddImage(image, fileToUpload, videoReferenceId, true));
 }
Пример #11
0
 /// <summary>
 /// Add a new thumbnail or video still image to a video, or assign an existing image to another video.
 /// </summary>
 /// <param name="image">The metadata for the image you'd like to create (or update).</param>
 /// <param name="fileUploadInfo">Information for the file to be uploaded.</param>
 /// <param name="videoReferenceId">The reference ID of the video to which you'd like to assign the image.</param>
 /// <param name="resize">Set this to false if you don't want your image to be automatically resized to the default size for its type.
 /// By default images will be resized.</param>
 /// <returns>The image that was added or updated</returns>
 public BrightcoveImage AddImage(BrightcoveImage image, FileUploadInfo fileUploadInfo, string videoReferenceId, bool resize)
 {
     return(DoAddImage(image, fileUploadInfo, -1, videoReferenceId, resize));
 }
Пример #12
0
 /// <summary>
 /// Add a new thumbnail or video still image to a video, or assign an existing image to another video.
 /// </summary>
 /// <param name="image">The metadata for the image you'd like to create (or update).</param>
 /// <param name="fileUploadInfo">Information for the file to be uploaded.</param>
 /// <param name="videoId">The ID of the video to which you'd like to assign the image.</param>
 /// <param name="resize">Set this to false if you don't want your image to be automatically resized to the default size for its type.
 /// By default images will be resized.</param>
 /// <returns>The image that was added or updated</returns>
 public BrightcoveImage AddImage(BrightcoveImage image, FileUploadInfo fileUploadInfo, long videoId, bool resize)
 {
     return(DoAddImage(image, fileUploadInfo, videoId, null, resize));
 }