The BrightcoveVideo object is an aggregate of metadata and asset information associated with a video.
Inheritance: BrightcoveItem, IJavaScriptConvertable
		/// <summary>
		/// Creates a new video by uploading a file.
		/// </summary>
		/// <param name="video">The metadata for the video you want to create.</param>
		/// <param name="fileToUpload">The full path to the file to be uploaded.</param>
		/// <param name="encodeTo">If the file requires transcoding, use this parameter to specify the target encoding. 
		/// Valid values are MP4 or FLV, representing the H264 and VP6 codecs respectively. Note that transcoding of 
		/// FLV files to another codec is not currently supported. This parameter is optional and defaults to FLV.</param>
		/// <param name="createMultipleRenditions">If the file is a supported transcodeable type, this optional flag can be 
		/// used to control the number of transcoded renditions. If true (default), multiple renditions at varying encoding 
		/// rates and dimensions are created. Setting this to false will cause a single transcoded VP6 rendition to be created 
		/// at the standard encoding rate and dimensions.</param>
		/// <param name="preserveSourceRendition">If the video file is H.264 encoded and if createMultipleRenditions is true, 
		/// then multiple VP6 renditions are created and in addition the H.264 source is retained as an additional rendition.</param>
		/// <param name="h264NoProcessing">Use this option to prevent H.264 source files from being transcoded. This parameter cannot
		/// be used in combination with create_multiple_renditions. It is optional and defaults to false.</param>
		/// <returns>The numeric ID of the newly created video.</returns>
		public long CreateVideo(BrightcoveVideo video, string fileToUpload, EncodeTo encodeTo, bool createMultipleRenditions, bool preserveSourceRendition, bool h264NoProcessing)
		{
			string fileName;
			byte[] fileBytes;
			GetFileUploadInfo(fileToUpload, out fileName, out fileBytes);

			return CreateVideo(video, fileName, fileBytes, encodeTo, createMultipleRenditions, preserveSourceRendition,
			                   h264NoProcessing);
		}
		/// <summary>
		/// Creates a new video by uploading a file.
		/// </summary>
		/// <param name="video">The metadata for the video you want to create.</param>
		/// <param name="fileToUpload">The full path to the file to be uploaded.</param>
		/// <param name="encodeTo">If the file requires transcoding, use this parameter to specify the target encoding. 
		/// Valid values are MP4 or FLV, representing the H264 and VP6 codecs respectively. Note that transcoding of 
		/// FLV files to another codec is not currently supported. This parameter is optional and defaults to FLV.</param>
		/// <param name="createMultipleRenditions">If the file is a supported transcodeable type, this optional flag can be 
		/// used to control the number of transcoded renditions. If true (default), multiple renditions at varying encoding 
		/// rates and dimensions are created. Setting this to false will cause a single transcoded VP6 rendition to be created 
		/// at the standard encoding rate and dimensions.</param>
		/// <param name="preserveSourceRendition">If the video file is H.264 encoded and if createMultipleRenditions is true, 
		/// then multiple VP6 renditions are created and in addition the H.264 source is retained as an additional rendition.</param>
		/// <param name="h264NoProcessing">Use this option to prevent H.264 source files from being transcoded. This parameter cannot
		/// be used in combination with create_multiple_renditions. It is optional and defaults to false.</param>
		/// <returns>The numeric ID of the newly created video.</returns>
		public long CreateVideo(BrightcoveVideo video, string fileToUpload, EncodeTo encodeTo, bool createMultipleRenditions, bool preserveSourceRendition, bool h264NoProcessing)
		{
			using (FileStream fs = File.OpenRead(fileToUpload))
			{
				string fileName = new FileInfo(fileToUpload).Name;
				return CreateVideo(video, new FileUploadInfo(fs, fileName), encodeTo, createMultipleRenditions, preserveSourceRendition,
			                   h264NoProcessing);
			}
		}
		public void CreateVideo_Test_Basic()
		{
			BrightcoveVideo video = new BrightcoveVideo();
			video.Name = "Test Video Creation";
			video.ReferenceId = "test-reference-id";
			video.ShortDescription = "Test video, created via the API. Video is from the Creative Commons: http://creativecommons.org/videos/building-on-the-past";

			long newId = _api.CreateVideo(video, FileToUpload, EncodeTo.Mp4, false);
			Assert.That(newId, Is.GreaterThan(0));
		}
		public void CreateVideo_Test_Basic()
		{
			BrightcoveVideo video = new BrightcoveVideo();
			video.Name = "Test Video Creation: Uploaded File";
			video.ReferenceId = "test-reference-id";
			video.ShortDescription = "Test video, created via the API. Video is from the Creative Commons: http://creativecommons.org/videos/building-on-the-past";

			// Remove any previous videos using our test reference ID, or the CreateVideo call may fail due to a dupe ID
			DeleteExisting(video.ReferenceId);

			long newId = _api.CreateVideo(video, FileToUpload, EncodeTo.Mp4, false);
			Assert.That(newId, Is.GreaterThan(0));
		}
        public void CreateVideo_VideoFullLength()
        {
            BrightcoveVideo video = new BrightcoveVideo();
            video.Name = "Test Video Creation";
            video.ReferenceId = "test-reference-id";
            video.ShortDescription = "Test video, created via the API. Video is from the Creative Commons: http://creativecommons.org/videos/building-on-the-past";
            video.VideoFullLength = new BrightcoveRendition
                {
                    RemoteUrl = "http://blip.tv/file/get/Commonscreative-BuildingOnThePast896.mov",
                    ControllerType = ControllerType.Default,
                    VideoCodec = VideoCodec.H264
                };

            long newId = _api.CreateVideo(video);
            Assert.That(newId, Is.GreaterThan(0));
        }
		/// <summary>
		/// Creates a new video by uploading a file.
		/// </summary>
		/// <param name="video">The metadata for the video you want to create.</param>
		/// <param name="fileName">The full path to the file to be uploaded.</param>
		/// <param name="fileBytes">The contents of the file</param>
		/// <param name="encodeTo">If the file requires transcoding, use this parameter to specify the target encoding. 
		/// Valid values are MP4 or FLV, representing the H264 and VP6 codecs respectively. Note that transcoding of 
		/// FLV files to another codec is not currently supported. This parameter is optional and defaults to FLV.</param>
		/// <param name="createMultipleRenditions">If the file is a supported transcodeable type, this optional flag can be 
		/// used to control the number of transcoded renditions. If true (default), multiple renditions at varying encoding 
		/// rates and dimensions are created. Setting this to false will cause a single transcoded VP6 rendition to be created 
		/// at the standard encoding rate and dimensions.</param>
		/// <param name="preserveSourceRendition">If the video file is H.264 encoded and if createMultipleRenditions is true, 
		/// then multiple VP6 renditions are created and in addition the H.264 source is retained as an additional rendition.</param>
		/// <param name="h264NoProcessing">Use this option to prevent H.264 source files from being transcoded. This parameter cannot
		/// be used in combination with create_multiple_renditions. It is optional and defaults to false.</param>
		/// <returns>The numeric ID of the newly created video.</returns>
		public long CreateVideo(BrightcoveVideo video, string fileName, byte[] fileBytes, EncodeTo encodeTo, bool createMultipleRenditions, bool preserveSourceRendition, bool h264NoProcessing)
		{
			BrightcoveParamCollection parms = CreateWriteParamCollection("create_video",
																		 methodParams =>
																		 {
																			 methodParams.Add("video", video);
																			 if (encodeTo != EncodeTo.None)
																			 {
																				 methodParams.Add("encode_to", encodeTo.ToString().ToUpper());
																			 }
																			 methodParams.Add("create_multiple_renditions", createMultipleRenditions.ToString().ToLower());
																			 methodParams.Add("preserve_source_rendition", preserveSourceRendition.ToString().ToLower());
																			 methodParams.Add("H264NoProcessing ", h264NoProcessing.ToString().ToLower());
																		 });
			return RunFilePost<BrightcoveResultContainer<long>>(parms, fileName, fileBytes).Result;
		}
		/// <summary>
		/// Creates a new video using a remote URL rendition.  The remote URL should be set
		/// in the video renditions.
		/// </summary>
		/// <param name="video">The metadata for the video you want to create.</param>
		public long CreateVideo(BrightcoveVideo video)
		{
			return CreateVideo(video, (FileUploadInfo)null, EncodeTo.None, false, false, false);
		}
		/// <summary>
		/// Updates the specified video.
		/// </summary>
		/// <param name="video"></param>
		/// <returns></returns>
		public BrightcoveVideo UpdateVideo(BrightcoveVideo video)
		{
			BrightcoveParamCollection parms = CreateWriteParamCollection("update_video",
																		 methodParams => methodParams.Add("video", video));
			return RunPost<BrightcoveResultContainer<BrightcoveVideo>>(parms).Result;
		}
		/// <summary>
		/// Creates a new video by uploading a file.
		/// </summary>
		/// <param name="video">The metadata for the video you want to create.</param>
		/// <param name="fileToUpload">The full path to the file to be uploaded.</param>
		/// <returns>The numeric ID of the newly created video.</returns>
		public long CreateVideo(BrightcoveVideo video, string fileToUpload)
		{
			return CreateVideo(video, fileToUpload, EncodeTo.None);
		}
		/// <summary>
		/// Creates a new video by uploading a file.
		/// </summary>
		/// <param name="video">The metadata for the video you want to create.</param>
		/// <param name="fileToUpload">The full path to the file to be uploaded.</param>
		/// <param name="encodeTo">If the file requires transcoding, use this parameter to specify the target encoding. 
		/// Valid values are MP4 or FLV, representing the H264 and VP6 codecs respectively. Note that transcoding of 
		/// FLV files to another codec is not currently supported. This parameter is optional and defaults to FLV.</param>
		/// <returns>The numeric ID of the newly created video.</returns>
		public long CreateVideo(BrightcoveVideo video, string fileToUpload, EncodeTo encodeTo)
		{
			return CreateVideo(video, fileToUpload, encodeTo, true);
		}
		/// <summary>
		/// Creates a new video by uploading a file.
		/// </summary>
		/// <param name="video">The metadata for the video you want to create.</param>
		/// <param name="fileToUpload">The full path to the file to be uploaded.</param>
		/// <param name="encodeTo">If the file requires transcoding, use this parameter to specify the target encoding. 
		/// Valid values are MP4 or FLV, representing the H264 and VP6 codecs respectively. Note that transcoding of 
		/// FLV files to another codec is not currently supported. This parameter is optional and defaults to FLV.</param>
		/// <param name="createMultipleRenditions">If the file is a supported transcodeable type, this optional flag can be 
		/// used to control the number of transcoded renditions. If true (default), multiple renditions at varying encoding 
		/// rates and dimensions are created. Setting this to false will cause a single transcoded VP6 rendition to be created 
		/// at the standard encoding rate and dimensions.</param>
		/// <returns>The numeric ID of the newly created video.</returns>
		public long CreateVideo(BrightcoveVideo video, string fileToUpload, EncodeTo encodeTo, bool createMultipleRenditions)
		{
			return CreateVideo(video, fileToUpload, encodeTo, createMultipleRenditions, false);
		}
Example #12
0
 public static void AddVideo(BrightcoveVideo vid)
 {
 }