Insights with Video.js Player
Options
All
  • Public
  • Public/Protected
  • All
Menu

VideoJS 4 Player Hive Plugin

var player = videojs('video', {
    plugins: {
        hive: {
            // options listed in HiveComm.Options
            debugLevel: 'debug',
            hiveTechOder: ['HiveJava', 'StatsJS']
        }
    }
});

player.initSession(<HIVE TICKET URL>, function (manifest, session) {
    console.log("resolved manifest: " + manifest + " tech: ", session)
    player.src([
        {
            src: manifest,
            type: "application/x-mpegURL",
        }]);
}, function () {
    console.log("hive could not resolve the ticket")
})

The basic usage is illustrated above. The hive plugin is called while the player is being initialized, and currently supports three types of distributions (techs):

  • HiveJava tech: distributes the video through the Java proxy client, works on every browser but supports only one video at the time.
  • HiveJS tech: distributes the video between browsers using WebRTC, works only on WebRTC Datachannel enabled browsers, supports one video per page.
  • StatsJS tech: no video distribution, only sends telemetry data for Insights analysis but works in every browser.

We currently have three different plugin packages with the following tech order combinations:

  • [HiveJava + StatsJS]: attempts video distribution using the Hive Java client if installed and ready, falls back to only telemetries otherwise.
  • [HiveJS + StatsJS]: attempts video distribution through the browser is supported, falls back to only telemetries otherwise.
  • [StatsJS]: only telemetries

The hiveTechOder option defines the order in which the above techs within a particular plugin package should be attempted.

Other combination packages can be built on demand depending on the player support.

Index

Modules

HiveComm

HiveComm:

API of Hive Comm player integration

Options

Options:

HiveJavaOptions

HiveJavaOptions:

Configurable Options valid only for the HiveJava Tech Usage:


 options: {
     HiveJava: {
         minVersion: "2015.1.100"
     }
 }
 

minVersion

minVersion: string

minimum version of Hive Java allowed to run

type

{string}

default

{2013.1.1}

onActiveSession

onError

  • define a callback in case a specific tech could NOT initialize a session

    Parameters

    Returns boolean

    whether you want the plugin to try to initialize the session through the next techs

HiveTechOptions

HiveTechOptions:

Options specific for each tech
Usage:


 options: {
      StatsJS: {
          onError:function (error) {
              console.log(error)
              // return whether you want the plugin to try to
              // initialize the session through another tech
              return true
          },
          onActiveSession:function (session) {
              console.log("active hive session ", session)
          }
      }
 }

onActiveSession

onError

  • define a callback in case a specific tech could NOT initialize a session

    Parameters

    Returns boolean

    whether you want the plugin to try to initialize the session through the next techs

Options

Options:

General configurable options

constructor

debugLevel

debugLevel: string

configure the debug level for the Hive Player Plugin. The allowed levels are:

  • error
  • warn
  • notice
  • info
  • debug

default

notice

feedbackPeriod

feedbackPeriod: number

the feedback interval of statistic forwarding in millisecond.

type

{number}

default

2000

hiveTechOrder

hiveTechOrder: Array<string>

order in which the hive techs ({@link HiveComm.Tech.Techs}) will try to resolve a ticket Usually the default tech order depends on the plugin license:

  • [player].stats.hive.min.js default tech order is: ['StatsJS']
  • [player].hive.min.js default tech order is: ['HiveJava', 'StatsJS']
  • [player].hivejs.hive.min.js default tech order is: ['HiveJS', 'StatsJS']

it is possible to override the default tech order for example to disable HiveJava proxy and use directly only the StatsJS telemetry pack

type

{string[]}

monitorPort

monitorPort: number

Hive Java monitor port

type

{number}

default

8899 for http, 8898 for https

playerPort

playerPort: number

Hive Java player port

type

{number}

default

8999 for http, 8998 for https

silent

silent: boolean

if true activate the Hive-Tester Driver feedback to monitor the player status

type

{boolean}

default

false

useSessionCheck

useSessionCheck: boolean

enable or disable the check for other active sessions on Hive Java. Default off;

type

{boolean}

UrlConfigurableOptions

UrlConfigurableOptions:

List of parameter names that can be passed to the page URL to setup correspondent plugin options.

hiveDebugLevel

hiveDebugLevel: string

hiveDebugLevel accepts a string value to initialize the debug console level. The valid values are the same as "debugLevel"

type

{string}

hiveMonitorPort

hiveMonitorPort: string

hiveMonitorPort url parameter accepts a numeric value for the monitor port binded by Hive Java client

type

{number}

hivePlayerPort

hivePlayerPort: string

hivePlayerPort url parameter accepts a numeric value for the player port binded by Hive Java client

type

{number}

hiveSilent

hiveSilent: string

hiveSilent url parameter accepts a boolean value to initialize a session as a silent test one. If true, HiveComm will start a periodic ping back to the local Hive Tester instance

type

{boolean}

HiveSessionErrorCode

HiveSessionErrorCode:

Error codes for failure in initializing Hive Sessions

GENERIC_ERROR

GENERIC_ERROR:

Generic Undefined Error

NO_TECH_AVAILABLE

NO_TECH_AVAILABLE:

No Tech available to resolve the ticket

NO_TECH_RESOLVED

NO_TECH_RESOLVED:

No available Tech could resolved the ticket

TECH_ERROR

TECH_ERROR:

Stopped resolving session on last tech onError

TICKET_ERROR

TICKET_ERROR:

The ticket could not be resolved

HiveSessionErrorString

HiveSessionErrorString:

Error messages corresponding to the HiveSessionErrorCode

Generic Undefined Error

Generic Undefined Error:

No Tech available to resolve the ticket

No Tech available to resolve the ticket:

No available Tech could resolved the ticket

No available Tech could resolved the ticket:

Stopped resolving session on last tech onError

Stopped resolving session on last tech onError:

The ticket could not be resolved

The ticket could not be resolved:

HiveTechErrorCode

HiveTechErrorCode:

Internal code of the Hive Tech Error

NOT_READY

NOT_READY:

the tech is not ready to resolve the ticket or initialize a HiveSession

PLUGIN_ERROR

PLUGIN_ERROR:

generic unspecified plugin error

SESSION_ERROR

SESSION_ERROR:

an error happened while initializing the HiveSession

TICKET_ERROR

TICKET_ERROR:

an error happened while resolving/verifying the ticket

VERSION_ERROR

VERSION_ERROR:

the tech doesn't satisfy the minimum version requirement

Techs

Techs:

list of available Hive Techs

HiveJS

HiveJS:

use the in-browser Hive client to retrieve the video from the CDN or the P2P Network HiveJS works only on browser that support WebRTC Datachannels (Chrome +38, Firefox +31 or Opera)

HiveJava

HiveJava:

use the Java installed Hive client to retrieve the video from the CDN or the P2P Network

StatsJS

StatsJS:

use only the browser telemetry package for Hive Insights

HiveSession

HiveSession:

Object containing information about the initialized Hive Session

id

id: string

the identifier of the session

manifest

manifest: string

the resolved manifest to be loaded by the player
It can either be the actual CDN manifest (Stats Pack/Hive.js) or the manifest proxied through Hive Java client.

tech

tech: string

the Hive technology that initialize this session

ticketUrl

ticketUrl: string

the url of the ticket

HiveSessionError

HiveSessionError:

Object containing information for failure in initializing Hive Session

code

detailedMessage

detailedMessage: string

message

message: string

ticketUrl

ticketUrl: string

HiveTechError

HiveTechError:

Object containing information about the Hive Tech Error that prevented the initialization of a Hive Session

constructor

code

message

message: string

ticketUrl

ticketUrl: string

getHiveSessionErrorMessage

HiveConfig

HiveConfig:

Module for Global Hive Configurations.

This configuration can be accessed directly, e.g.

HiveConfig.ErrorMonitor.enabled = false

ErrorMonitor

ErrorMonitor:

Overriding configurations for the Error Monitoring component. The ErrorMonitoring component provides RUM (Real User Monitor) and error tracking. This configurations are global per page.

enableKeyCombination

enableKeyCombination: boolean

Upload Log Key Combination enabled. If true, pressing the combination CTRL + SHIFT + X will upload the last 10 logs

default

true

enabled

enabled: boolean

Error Monitor enabled.

type

{boolean}

default

build-dependent

enabledErrorFilter

enabledErrorFilter: boolean

enable a filter for JS errors. If true, errors will be filtered based on the errorRegexFilter value. Set to false to send all errors.

type

{boolean}

default

false

enabledRUM

enabledRUM: boolean

Real User Monitor enabled. If true the component will monitor and send performance data of page and AJAX

type

{boolean}

default

false

errorRegexFilter

errorRegexFilter: string

Regex for filtering the errors based on the script url where the error was triggered.

type

{string}

default

'hivestreaming.com'

key

key: string

ErrorMonitor user key

type

string

version

version: string

ErrorMonitor reporting version

type

string

Classes

HiveVideoJs

HiveVideoJs:

constructor

  • new HiveVideoJs(player: any, options: any): HiveVideoJs

eventsRegistered

eventsRegistered: boolean

extendedStats

extendedStats: HivePlayerExtendedStats

hlsStats

lastEvent

lastEvent: any

loggerId

loggerId: string

options_

options_: Options

player

player: any

version

version: string

filterProgressEvent

  • filterProgressEvent(event: PlayerEvents): void

getActiveSession

getBufferLen

  • getBufferLen(): number

getCurrentTime

  • getCurrentTime(): number

getExtendedStats

  • getExtendedStats(): HivePlayerExtendedStats

getPlayerId

  • getPlayerId(): string

getPlayerSource

  • getPlayerSource(): any

getPlayerTech

  • getPlayerTech(): string

getPlayerVersion

  • getPlayerVersion(): any

getPluginName

  • getPluginName(): string

getPluginVersion

  • getPluginVersion(): string

getStreamProtocol

  • getStreamProtocol(): StreamProtocol

getWindowSize

  • getWindowSize(): object

isActive

  • isActive(): boolean

isFullscreen

  • isFullscreen(): any

isLive

  • isLive(): boolean

isSessionActive

  • isSessionActive(): boolean
  • true if the current watched manifest corresponds to the active HiveSession

    Returns boolean

logger

  • logger(): any

onActivateSession

  • onActivateSession(explicitPlayerSource?: string): boolean
  • Called after the initial metadata have been received from the player in order to activate the initialized Session

    Parameters

    • Optional explicitPlayerSource: string

    Returns boolean

onEndBuffering

  • onEndBuffering(): boolean
  • Returns boolean

onError

  • onError(errorCode: any, errorString?: string, closeSession?: boolean): void
  • Parameters

    • errorCode: any
    • Optional errorString: string
    • Default value closeSession: boolean = true

    Returns void

onEventFeedback

  • onEventFeedback(event: PlayerEvents, objEvent?: any): void
  • Parameters

    • event: PlayerEvents
    • Optional objEvent: any

    Returns void

onSetupTimeout

  • onSetupTimeout(): void
  • called when the player decided that the ticket resolve took too long and there is no need for it anymore

    Returns void

onStartBuffering

  • onStartBuffering(sendEvent?: boolean): void
  • Parameters

    • Optional sendEvent: boolean

    Returns void

options

registerEvents

  • registerEvents(): void

registerVideoJsHlsTech

  • registerVideoJsHlsTech(): void

resetSession

  • resetSession(): void
  • close the current active/initialized session, reset the active and initialized session values and reset the timers and stop the periodic stats

    Returns void

resolveTicketPromise

  • resolveTicketPromise(ticketUrl: string): Promise<HiveSessionInternal>
  • Attempt to resolve a ticket through any of the available techs

    In a loop through all the tech, one at the time:

    • First checks if the tech is available
    • Then checks if the tech needs a Reporting Instance (verified ticket)
    • Then tries to initialize a session with that tech
    • If successful, resolve the promise with the initialized HiveSession

    In case no tech can resolve the Session, an the Promise will fail with a HiveTechError

    Parameters

    • ticketUrl: string

    Returns Promise<HiveSessionInternal>

startPeriodicFeedback

  • startPeriodicFeedback(): void
  • Returns void

stopPeriodicFeedback

  • stopPeriodicFeedback(): void
  • Returns void

updatePlayerInfo

  • updatePlayerInfo(ri: ReportingInstance): void
  • Parameters

    • ri: ReportingInstance

    Returns void

Videojs5HlsBufferData

Videojs5HlsBufferData:

constructor

currentBitrate

currentBitrate: number

hlsTech

hlsTech: any

lastBytesReceived

lastBytesReceived: number

accountRequest

  • accountRequest(extendedStats: HivePlayerExtendedStats): void
  • called before new segment is performed. Account the previous downloaded bytes as as a request with the current bitrate

    Parameters

    • extendedStats: HivePlayerExtendedStats

    Returns void

extractBitrate

  • extractBitrate(): any

extractBytesReceived

  • extractBytesReceived(): number
  • on 3.0.2 we must extract the bytes received directly accessing the SegmentLoader counter. On previous versions the bytesReceived on the hls object is not updated anymore, only bandwidth and playlist

    Returns number

updateBandwidth

  • updateBandwidth(extendedStats: HivePlayerExtendedStats): void
  • update the bandwidth on extended stats with the latest bw value measured by the hls tech

    Parameters

    • extendedStats: HivePlayerExtendedStats

    Returns void

updateBitrate

  • updateBitrate(extendedStats: HivePlayerExtendedStats): void
  • update stats to a new bitrate value and account the new bytesReceived on the previous bitrate

    Parameters

    • extendedStats: HivePlayerExtendedStats

    Returns void

Variables

HIVE_COMM_JAVA

HIVE_COMM_JAVA: boolean

HIVE_COMM_JS

HIVE_COMM_JS: boolean

HiveRequest

HiveRequest: any

videojs

videojs: any

Functions

genSDN

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc