Video Notification

A video notification is pushologies main feature where you can send videos to subscribers. These videos can include buttons which can be placed anywhere on the video at any specific time for any duration.

Lets approach this with an example:

POST /v1/notification/push
{
  "type": "VIDEO",
  "title": "2021 All Star Game",
  "message": "Choose your best star!",
  "contents": [
    {
      "options": {
        "orientation": "portrait",
        "zoomMode": "zoom",
        "useEmbeddedPlayer": true,
        "allowPreview": true,
        "fullScreen": true,
        "buttons": [
          {
            "text": "Lebron James",
            "textColor": "#F9AF05",
            "fontSize": "41",
            "backgroundColor": "#A71680",
            "position": {
              "top": 2,
              "left": 2,
              "bottom": 3,
              "right": 7
            },
            "buttonAppear": 1000,
            "buttonDisappear": 5000,
            "url": "https://example.com/1",
            "linkHandling": "defaultBrowser",
            "fullScreen": false
          },
          {
            "contentItemId": "4a148a5c-9fe7-4edc-96d6-18007e58a676",
            "position": {
              "top": 6,
              "left": 5,
              "bottom": 8,
              "right": 15
            },
            "buttonAppear": 7000,
            "buttonDisappear": 12000,
            "url": "https://example.com/2"
          },
        ],
        "allowSharing": false,
        "allowScrubbing": false
      },
      "contentItem": {
        "id": "a47acd1c-5c14-4b25-b016-d8423f2fb1b9"
      },
      "presentation": "DEFAULT"
    },
    {
      "contentItem": {
        "id": "f4ae6e72-3076-4a8c-a4af-f848cda79e7a"
      },
      "presentation": "BANNER"
    }
  ],
  "segment": {
    "id": "4beafba6-b851-4bf0-8ca4-695b38b7efff"
  },
}

This should look similar to the Standard Notification payload except for the contents field. This must be an array with at least one object of presentation type "DEFAULT" which will be your video content item (see our uploading content help guide for more). In the content object refer to the content item by its id:

"contentItem": {
  "id": "a47acd1c-5c14-4b25-b016-d8423f2fb1b9"
}

The next field to include is options. These are various options you can set for the video once it reaches the device. These include zoomMode which deal with the render aspect mode. So you can set this to zoom if you want the video to fill the devices entire screen, or fit so the video is scaled to fit in the devices screen. To see a complete list of options available refer to the POST /v1/notification/push endpoint and expand on the contents field.

One option here we will delve into more detail is the buttons option. This deals with the different buttons that will appear on your video.

"buttons": [
  {
    "text": "Lebron James",
    "textColor": "#F9AF05",
    "fontSize": "41",
    "backgroundColor": "#A71680",
    "position": {
      "top": 2,
      "left": 2,
      "bottom": 3,
      "right": 7
    },
    "buttonAppear": 1000,
    "buttonDisappear": 5000,
    "url": "https://example.com/1",
    "linkHandling": "defaultBrowser",
    "fullScreen": false
  },
  {
    "contentItemId": "4a148a5c-9fe7-4edc-96d6-18007e58a676",
    "position": {
      "top": 6,
      "left": 5,
      "bottom": 8,
      "right": 15
    },
    "buttonAppear": 7000,
    "buttonDisappear": 12000,
    "url": "https://example.com/2"
  },
]

Our video has a resolution of 20 x 10. So we can visual this button layout as

alt layout

Our coordinate system works according to the video resolution, 0, 0 being the top left of the video. Each button must have a position field which has

  • top - top tip position of button in y axis from top of video
  • bottom - bottom position of button in y axis from top of video
  • right - far right position of button in x axis from left of video
  • left - left position of button in x axis from left of video

buttonAppear and buttonDisappear state the timestamp (in milliseconds) when the button should appear into the video. So for the first button, it will appear 1 second into the video and disappear 5 seconds into the video.

url signifies the url to redirect to when user clicks on the button. This field is optional

The first button is one we have assigned text and colours. Colours can be in hex or rgba form, so transparent buttons are also possible

For the second button, we've made it into an image by referencing the contentItemId. This content item must have a presentation type of "BUTTON" in its presentation array

🚧

Note!

You cannot have a button option which has both contentItemId and text fields

Lastly in the contents array we've also included a BANNER content item to display for android devices. Android devices accept sending banner images instead of a text based alert