Liveblog Media

How Media is Represented in the Liveblog Data

Media content in liveblog posts are described by two data structures:

  • The media array contains a list of Tik::Model::Media objects and contains information about the media itself like source, type, resolution, upload status, etc.

  • Within the contents array, a Tik::Model::Content::MultiMediaContentBlock objects defines where the media should be displayed

The following example shows a liveblog post with one photo and one video displayed:

{
  "_type": "Tik::Model::Event",
  "contents": [
    {
      "_type": "Tik::Model::Content::MultiMediaContentBlock",
      "items": [
        {
          "_type": "Tik::Model::Content::VideoMediaContent",
          "media_local_id": "mm5wk6cSAA7q6896SGZU"
        },
        {
          "_type": "Tik::Model::Content::ImageMediaContent",
          "media_local_id": "mm5wk6cSAA7q6896SGZV"
        }
      ],
      "local_id": "bm5wk6cRAA7q6896SGZT"
    }
  ],
  "media": [
    {
      "_type": "Tik::Model::Media",
      "created_at": 1678267402,
      "duration_ms": 63100,
      "height": 1920,
      "local_id": "mm5wk6cSAA7q6896SGZU",
      "local_status": 0,
      "subtype": "v",
      "updated_at": 1678267454,
      "url": "imageservice://media/organization/55684dece4b03ddac3d474c1/liveblog/gkxc21DU5DmQ2RzLYR7f/em5wk36YAA7q6896SGZQ/mm5wk6cSAA7q6896SGZU",
      "user_id": "4f72062d3ab9c86ce400003e",
      "version": 17,
      "width": 1080
    },
    {
      "_type": "Tik::Model::Media",
      "created_at": 1678267402,
      "duration_ms": 0,
      "height": 690,
      "local_id": "mm5wk6cSAA7q6896SGZV",
      "local_status": 0,
      "subtype": "i",
      "updated_at": 1678267404,
      "url": "imageservice://media/organization/55684dece4b03ddac3d474c1/liveblog/gkxc21DU5DmQ2RzLYR7f/em5wk36YAA7q6896SGZQ/mm5wk6cSAA7q6896SGZV",
      "user_id": "4f72062d3ab9c86ce400003e",
      "version": 15,
      "width": 900
    }
  ],
  "sort": "000000006408540a",
  "updated_at": 1678267454,
  "user_id": "4f72062d3ab9c86ce400003e",
  "created_at": 1678267402,
  "highlight": "",
  "local_id": "em5wk36YAA7q6896SGZQ",
  "local_status": 0,
  "version": 17
}

How Media Files can be Attached to Liveblog Posts

Media handling can be quite complicated. To make posting media files to liveblogs easier, the API provides a shortcut which allows ommitting the Tik::Model::Media object when creating or updating posts.

To take the shortcut, posted ImageMediaContent or VideoMediaContent objects must include the source_url field. The field must contain a http:// or https:// link to media file hosted by you. The Media files must be permanently hosted at the provided URL. The follwoing behaviours and restrictions apply:

  • Images and Videos will be probed by our system shortly after posting to obtain width and height
  • Images should be in PNG or JPEG format
  • When displayed Images will be proxied through our servers to create different resolutions versions on the fly. These versions will be cached in our CDN for an undiscolsed period of time after which it will be refresh from source
  • Videos should be in MP4 format. Codec support is browser dependent
  • Videos will be directly referenced by our video player. The source video must therefore be suitable for direct playback in browsers and must be accessible for possible origins of our video player https://www.tickaroo.com, https://cdn.tickaroo.com and https://pro.tickaroo.com
  • The response will always contain full expanded media data structures as described above.

Example:

POST /api/v5/write/ticker/create.json

{
  "_type": "Tik::Model::Event",
  "contents": [
    {
      "_type": "Tik::Model::Content::MultiMediaContentBlock",
      "items": [
          "_type": "Tik::Model::Content::ImageMediaContent",
          "credit": "By Mister rf - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=97847480",
          "title": "07R01 IF Amplifier/Demodulator Integrated Circuit Motorola GM350 transceiver",
          "source_url": "https://upload.wikimedia.org/wikipedia/commons/f/f7/071R01.jpg"
      ]
    }
  ],
}

Description of Objects

Tik::Model::Content::MultiMediaContentBlock

{
  "_type": "Tik::Model::Content::MultiMediaContentBlock",
  "local_id": "",
  
  // Tik::Model::Content::ImageMediaContent|Tik::Model::Content::VideoMediaContent[]  
  // List of media items to display
  "items": []
  
  // Either "slideshow" or "default", if null or empty string "default" is used
  "display_type": ""
}

Tik::Model::Content::ImageMediaContent

{
  "_type": "Tik::Model::Content::ImageMediaContent"

  // The media local id referencing the "media" array of the current liveblog post
  "media_local_id": ""
  
  // Optional: if present media is displayed with a blur and a sensitive content warning
  // if empty string, a generic warning text sill be used
  // otherwise the supplied text will be used
  "content_warning": ""
  
  // Optional: Image Credits
  "credit": ""

  // Optional: Image Title
  "title": ""

  // Optional: Shortcut for posting new media. Will not be set by the Liveblog Editor
  "source_url": ""
}

Tik::Model::Content::VideoMediaContent

{
  _type: "Tik::Model::Content::VideoMediaContent"

  // The media local id referencing the "media" array of the current liveblog post
  "media_local_id": ""

  // Optional: if present media is displayed with a blur and a sensitive content warning
  // if empty string, a generic warning text sill be used
  // otherwise the supplied text will be used
  "content_warning": ""

  // Optional: Image Credits
  "credit": ""

  // Optional: Image Title
  "title": ""

  // Optional: Shortcut for posting new media. Will not be set by the Liveblog Editor
  "source_url": ""
}

Tik::Model::Media

{
  "_type": "Tik::Model::Media",
  
  // Global Unique ID of the media object  
  "local_id": "mm5wk6cSAA7q6896SGZV",

  // either "i" for images or "v" for video  
  "subtype": "i",
    
  // The actual location of the media file  (see Media Locations below)
  "url": "imageservice://media/organization/55684dece4b03ddac3d474c1/liveblog/gkxc21DU5DmQ2RzLYR7f/em5wk36YAA7q6896SGZQ/mm5wk6cSAA7q6896SGZV",
    
  // 0 => Published
  // 60 => Unpublished
  // 100 => Deleted  
  "local_status": 0,  
  
  // If video: Duration of the video in milliseconds  
  "duration_ms": 0,
    
  // Original width of the media object (if missing 4:3 aspect ratio is assumed)
  "width": 900,

  // Original height of the media object (if missing 4:3 aspect ratio is assumed)
  "height": 690,
    
  // Date/Time this media object was created
  "created_at": 1578993674,

  // Indicates the date/time of the last user-made change to this event
  "updated_at": 1578993674,
  
  // ID of the user who created this media object
  "user_id": "",
  
  // Version of the game when this media object was last updated  
  "version": 15
}

Media Locations

Image locations are described by URIs. The following protocolls are valid:

  • http:// or https:// The image is located on a third party http server and is publicly accessible via this url
  • imageservice:// The image was uploaded via Tickaroo and is privatly stored in the Tickaroo Media database