Ejemplo n.º 1
0
        public ITweet PublishTweetWithVideo(string text, byte[] video)
        {
            var media = _uploadQueryExecutor.UploadVideo(video);

            if (media == null || media.MediaId == null || !media.HasBeenUploaded)
            {
                throw new OperationCanceledException("The tweet cannot be published as some of the medias could not be published!");
            }

            var parameters = new PublishTweetOptionalParameters();

            parameters.MediaIds.Add((long)media.MediaId);

            return(PublishTweet(text, parameters));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Upload a video to twitter
 /// </summary>
 public static IMedia UploadVideo(byte[] binary, string mediaType = "video/mp4")
 {
     return(_uploadQueryExecutor.UploadVideo(binary, mediaType));
 }