abjerner / Skybrud.Social

Skybrud.Social is a framework in .NET for integration with various social services like Twitter, Facebook and Instagram. The framework will handle all the technical parts and API communication so you don't have to.
http://social.skybrud.dk/
MIT License
96 stars 32 forks source link

Add support for video information of an extended media entity #44

Closed abjerner closed 9 years ago

abjerner commented 9 years ago

For an extended media that is a Twitter video, information about that video is provided in the JSON.

Here is an example of such an entity (see tweet):

{
  "id": 655135486290190336,
  "id_str": "655135486290190336",
  "indices": [
    79,
    101
  ],
  "media_url": "http://pbs.twimg.com/ext_tw_video_thumb/655135486290190336/pu/img/hHLh66w9FaS68YFW.jpg",
  "media_url_https": "https://pbs.twimg.com/ext_tw_video_thumb/655135486290190336/pu/img/hHLh66w9FaS68YFW.jpg",
  "url": "http://t.co/ehuTMgaBc6",
  "display_url": "pic.twitter.com/ehuTMgaBc6",
  "expanded_url": "http://twitter.com/EA/status/655135503906304000/video/1",
  "type": "video",
  "sizes": {
    "thumb": {
      "w": 150,
      "h": 150,
      "resize": "crop"
    },
    "medium": {
      "w": 600,
      "h": 338,
      "resize": "fit"
    },
    "small": {
      "w": 340,
      "h": 191,
      "resize": "fit"
    },
    "large": {
      "w": 1024,
      "h": 576,
      "resize": "fit"
    }
  },
  "video_info": {
    "aspect_ratio": [
      16,
      9
    ],
    "duration_millis": 6000,
    "variants": [
      {
        "content_type": "application/dash+xml",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/pl/vRPv3nIY-f7OkpbI.mpd"
      },
      {
        "bitrate": 832000,
        "content_type": "video/webm",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/vid/640x360/6iC_TY0KtZp34u6g.webm"
      },
      {
        "content_type": "application/x-mpegURL",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/pl/vRPv3nIY-f7OkpbI.m3u8"
      },
      {
        "bitrate": 320000,
        "content_type": "video/mp4",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/vid/320x180/MI3d_0UidfGUYcLa.mp4"
      },
      {
        "bitrate": 832000,
        "content_type": "video/mp4",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/vid/640x360/6iC_TY0KtZp34u6g.mp4"
      },
      {
        "bitrate": 2176000,
        "content_type": "video/mp4",
        "url": "https://video.twimg.com/ext_tw_video/655135486290190336/pu/vid/1280x720/UZAAUpdK56pYP7J7.mp4"
      }
    ]
  }
}
abjerner commented 9 years ago

Implemented and will be part of the next release ;)