Beispiel #1
0
        public async Task <Uri> SaveClip(StormPlayer stormPlayer, StormReplay stormReplay)
        {
            // Limited api functionality
            // Cannot modify the title of the clip
            // Cannot modify the time of the clip from 30 to 60 seconds
            // When twitch allow it, modify the title to a format like: [Hero] [Map] - [Quintuple, Quad, Tripple] kill
            CreatedClipResponse response = await twitchAPI.Helix.Clips.CreateClipAsync(settings.TwitchBroadcasterId);

            GetClipResponse clip = await twitchAPI.Helix.Clips.GetClipAsync(response.CreatedClips[0].Id);

            return(new Uri(clip.Clips[0].Url));
        }
Beispiel #2
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            GetClipResponse response = new GetClipResponse();

            response.Payload = context.Stream;
            if (context.ResponseData.IsHeaderPresent("Content-Type"))
            {
                response.ContentType = context.ResponseData.GetHeaderValue("Content-Type");
            }

            return(response);
        }
        /// <summary> Construct the class from json data. </summary>
        public GetClipResponse(string jsonFormat)
        {
            GetClipResponse r = UnityEngine.JsonUtility.FromJson <GetClipResponse>(jsonFormat);

            id         = r.id;
            title      = r.title;
            body       = r.body;
            published  = r.published;
            author     = r.author;
            finished   = r.finished;
            link       = r.link;
            voice      = r.voice;
            project_id = r.project_id;
        }