Unable to connect, retrying...
Online collaborative whiteboard. Powerful, engaging with timer, emoji's, commenting and voting.
Search for RSS feeds

Twitter Video support in REST and Streaming API

We’re excited to announce that we are releasing native consumer videos to public. We knew this announcement would raise questions about what would happen with the API. Ultimately, this means we’ll soon be able to render video via Tweets to developers via REST & Streaming API. More details to follow but below is a look at what the new data payload will look like. Starting in early February, we will begin to roll out support for video rendering across REST and Streaming APIs. More specifically, a new media type of “video” will appear in the “extended_entities” section, and the “video_info” section will contain the following video-related properties: **1. aspect_ratio**: The aspect ratio of the video, as a simplified fraction of width and height in a 2-element array. Typical values are [4, 3] or [16, 9] **2. duration_millis**: The length of the video, in milliseconds. **3. variants**: Different encodings/streams of the video. At least one variant is returned for each video entry. Video formats returned via the API are subject to change. As a best practice, developers should scan all returned values and use the most appropriate format for their given platform. Additionally, each “variant” object contains the following properties: **1. content_type**: The simplified type of the video format, such as video/mp4 or video/webm. We currently support H.264 and WebM for progressive download, and HLS for adaptive streaming. **2. url**: The URL to the video file or playlist, depending on the content type. **3. bitrate** For displaying a video preview or thumbnail, developers should use the “media_url” or “media_url_https” values that point to an image. (We have also included photos in the old “entities/media” object for backward compatibility.) Below is a more complete example of a video entity being returned in “extended_entities” section of a response. "extended_entities":{ "media": [ { "display_url": "pic.twitter.com/31JoMS50ha", "expanded_url": "http://twitter.com/twitter/status/560070183650213889/video/1", "features": { }, "id": 5.6007013197639e+17, "id_str": "560070131976392705", "indices": [ 110, 132 ], "media_url": "http://pbs.twimg.com/ext_tw_video_thumb/560070131976392705/pu/img/TcG_ep5t-iqdLV5R.jpg", "media_url_https": "https://pbs.twimg.com/ext_tw_video_thumb/560070131976392705/pu/img/TcG_ep5t-iqdLV5R.jpg", "sizes": { "large": { "h": 576, "resize": "fit", "w": 1024 }, "medium": { "h": 337, "resize": "fit", "w": 600 }, "small": { "h": 191, "resize": "fit", "w": 340 }, "thumb": { "h": 150, "resize": "crop", "w": 150 } }, "type": "video", "url": "http://t.co/31JoMS50ha", "video_info": { "aspect_ratio": [ 16, 9 ], "duration_millis": 30033, "variants": [ { "bitrate": 2176000, "content_type": "video/mp4", "url": "https://video.twimg.com/ext_tw_video/560070131976392705/pu/vid/1280x720/c4E56sl91ZB7cpYi.mp4" }, { "bitrate": 320000, "content_type": "video/mp4", "url": "https://video.twimg.com/ext_tw_video/560070131976392705/pu/vid/320x180/nXXsvs7vOhcMivwl.mp4" }, { "bitrate": 832000, "content_type": "video/webm", "url": "https://video.twimg.com/ext_tw_video/560070131976392705/pu/vid/640x360/vmLr5JlVs2kBLrXS.webm" }, { "bitrate": 832000, "content_type": "video/mp4", "url": "https://video.twimg.com/ext_tw_video/560070131976392705/pu/vid/640x360/vmLr5JlVs2kBLrXS.mp4" }, { "content_type": "application/x-mpegURL", "url": "https://video.twimg.com/ext_tw_video/560070131976392705/pu/pl/r1kgzh5PmLgium3-.m3u8" } ] } } ] }

Feed: Related: