/// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Composition parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Composition </returns>
        public static CompositionResource Create(CreateCompositionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Beispiel #2
0
 private static Request BuildCreateRequest(CreateCompositionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Video,
                "/v1/Compositions",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="audioSources"> The audio_sources </param>
        /// <param name="videoSources"> The video_sources </param>
        /// <param name="videoLayout"> The video_layout </param>
        /// <param name="resolution"> The resolution </param>
        /// <param name="format"> The format </param>
        /// <param name="desiredBitrate"> The desired_bitrate </param>
        /// <param name="desiredMaxDuration"> The desired_max_duration </param>
        /// <param name="statusCallback"> The status_callback </param>
        /// <param name="statusCallbackMethod"> The status_callback_method </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Composition </returns>
        public static async System.Threading.Tasks.Task <CompositionResource> CreateAsync(List <string> audioSources = null,
                                                                                          List <string> videoSources = null,
                                                                                          CompositionResource.VideoLayoutEnum videoLayout = null,
                                                                                          string resolution = null,
                                                                                          CompositionResource.FormatEnum format = null,
                                                                                          int?desiredBitrate     = null,
                                                                                          int?desiredMaxDuration = null,
                                                                                          Uri statusCallback     = null,
                                                                                          Twilio.Http.HttpMethod statusCallbackMethod = null,
                                                                                          ITwilioRestClient client = null)
        {
            var options = new CreateCompositionOptions()
            {
                AudioSources = audioSources, VideoSources = videoSources, VideoLayout = videoLayout, Resolution = resolution, Format = format, DesiredBitrate = desiredBitrate, DesiredMaxDuration = desiredMaxDuration, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod
            };

            return(await CreateAsync(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="roomSid"> The SID of the Group Room with the media tracks to be used as composition sources </param>
        /// <param name="videoLayout"> An object that describes the video layout of the composition </param>
        /// <param name="audioSources"> An array of track names from the same group room to merge </param>
        /// <param name="audioSourcesExcluded"> An array of track names to exclude </param>
        /// <param name="resolution"> A string that describes the columns (width) and rows (height) of the generated composed
        ///                  video in pixels </param>
        /// <param name="format"> The container format of the composition's media files </param>
        /// <param name="statusCallback"> The URL we should call to send status information to your application </param>
        /// <param name="statusCallbackMethod"> The HTTP method we should use to call status_callback </param>
        /// <param name="trim"> Whether to clip the intervals where there is no active media in the composition </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Composition </returns>
        public static async System.Threading.Tasks.Task <CompositionResource> CreateAsync(string roomSid,
                                                                                          object videoLayout                 = null,
                                                                                          List <string> audioSources         = null,
                                                                                          List <string> audioSourcesExcluded = null,
                                                                                          string resolution = null,
                                                                                          CompositionResource.FormatEnum format = null,
                                                                                          Uri statusCallback = null,
                                                                                          Twilio.Http.HttpMethod statusCallbackMethod = null,
                                                                                          bool?trim = null,
                                                                                          ITwilioRestClient client = null)
        {
            var options = new CreateCompositionOptions(roomSid)
            {
                VideoLayout = videoLayout, AudioSources = audioSources, AudioSourcesExcluded = audioSourcesExcluded, Resolution = resolution, Format = format, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Trim = trim
            };

            return(await CreateAsync(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="roomSid"> Twilio Room SID. </param>
        /// <param name="videoLayout"> The JSON video layout description. </param>
        /// <param name="audioSources"> A list of audio sources related to this Composition. </param>
        /// <param name="audioSourcesExcluded"> A list of audio sources excluded related to this Composition. </param>
        /// <param name="resolution"> Pixel resolution of the composed video. </param>
        /// <param name="format"> Container format of the Composition media file. Any of the following: `mp4`, `webm`. </param>
        /// <param name="statusCallback"> A URL that Twilio sends asynchronous webhook requests to on every composition event.
        ///                      </param>
        /// <param name="statusCallbackMethod"> HTTP method Twilio should use when requesting the above URL. </param>
        /// <param name="trim"> Boolean flag for clipping intervals that have no media. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Composition </returns>
        public static CompositionResource Create(string roomSid                              = null,
                                                 object videoLayout                          = null,
                                                 List <string> audioSources                  = null,
                                                 List <string> audioSourcesExcluded          = null,
                                                 string resolution                           = null,
                                                 CompositionResource.FormatEnum format       = null,
                                                 Uri statusCallback                          = null,
                                                 Twilio.Http.HttpMethod statusCallbackMethod = null,
                                                 bool?trim = null,
                                                 ITwilioRestClient client = null)
        {
            var options = new CreateCompositionOptions()
            {
                RoomSid = roomSid, VideoLayout = videoLayout, AudioSources = audioSources, AudioSourcesExcluded = audioSourcesExcluded, Resolution = resolution, Format = format, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Trim = trim
            };

            return(Create(options, client));
        }
Beispiel #6
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="audioSources"> The audio_sources </param>
        /// <param name="videoSources"> The video_sources </param>
        /// <param name="videoLayout"> The video_layout </param>
        /// <param name="resolution"> The resolution </param>
        /// <param name="format"> The format </param>
        /// <param name="desiredBitrate"> The desired_bitrate </param>
        /// <param name="desiredMaxDuration"> The desired_max_duration </param>
        /// <param name="statusCallback"> The status_callback </param>
        /// <param name="statusCallbackMethod"> The status_callback_method </param>
        /// <param name="trim"> The trim </param>
        /// <param name="reuse"> The reuse </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Composition </returns>
        public static CompositionResource Create(List <string> audioSources = null,
                                                 List <string> videoSources = null,
                                                 CompositionResource.VideoLayoutEnum videoLayout = null,
                                                 string resolution = null,
                                                 CompositionResource.FormatEnum format = null,
                                                 int?desiredBitrate     = null,
                                                 int?desiredMaxDuration = null,
                                                 Uri statusCallback     = null,
                                                 Twilio.Http.HttpMethod statusCallbackMethod = null,
                                                 bool?trim  = null,
                                                 bool?reuse = null,
                                                 ITwilioRestClient client = null)
        {
            var options = new CreateCompositionOptions()
            {
                AudioSources = audioSources, VideoSources = videoSources, VideoLayout = videoLayout, Resolution = resolution, Format = format, DesiredBitrate = desiredBitrate, DesiredMaxDuration = desiredMaxDuration, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, Trim = trim, Reuse = reuse
            };

            return(Create(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Composition parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Composition </returns>
        public static async System.Threading.Tasks.Task <CompositionResource> CreateAsync(CreateCompositionOptions options,
                                                                                          ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }