ERROR
3016: VIDEO_ERROR
  • ManageAlerts feature is designed to notify users about new events triggered from the server side.

  • It uses a Server Sent Events (SSE) technology enabling a client to receive automatic updates from a server via an HTTP connection (They are commonly used to send message updates or continuous data streams to a browser client and designed to enhance native, cross-browser streaming through a JavaScript API called EventSource.)

  • We manage to subscribe to those events in our player and notify the user about events.

  • The best example of this use case can be found here.

How to configure and enable this feature

Configure your server (Hub) URL with the topics (The canonical URL for the topic to which subscribers are expected to use for subscriptions) and onScreenTime to keep the notification on hold.

  {
    "advanced_features": [
      {
        "name": "manage_alerts",
        "visible": true,
        "data": {
            "serverUrl": "https://yourserver/url/paste/here",
            "topics": [
              "http://example.com/books/{id}",
              "http://example.com/books/{id}",
              "http://example.com/books/{id}"
            ],
            "onScreenTime": 5
        }
      }]
  }

Data property

Table 1. Manage alerts data property
Property Value Description

onScreenTime

number

declare number in seconds to hold the notification on screen.

serverUrl

string

a hub url of server.

topics

string[]

the topic urls to which subscribers are expected to use for subscriptions

Example

// How to implement the player
const video = document.querySelector('#video');
const videoContainer = document.querySelector('#video-container')
const hexaPlayer = new HexaglobePlayer(video,videoContainer, {
  basic: {
    source: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
  },
  advanced_features: [
      {
        name: "manage_alerts",
        visible: true,
        data: {
            serverUrl: "https://yourserver/url/paste/here",
            topics: [
              "http://example.com/books/{id}",
              "http://example.com/books/{id}",
              "http://example.com/books/{id}"
            ],
            onScreenTime: 5
        }
      }]
})
hexaPlayer.init_();