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):
We currently have three different plugin packages with the following tech order combinations:
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.
Configurable Options valid only for the HiveJava Tech Usage:
options: {
HiveJava: {
minVersion: "2015.1.100"
}
}
minimum version of Hive Java allowed to run
define a callback in case a specific tech could initialize a session
define a callback in case a specific tech could NOT initialize a session
whether you want the plugin to try to initialize the session through the next techs
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)
}
}
}
define a callback in case a specific tech could initialize a session
define a callback in case a specific tech could NOT initialize a session
whether you want the plugin to try to initialize the session through the next techs
General configurable options
configure the debug level for the Hive Player Plugin.
The allowed levels are:
the feedback interval of statistic forwarding in millisecond.
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:
it is possible to override the default tech order for example to disable HiveJava proxy and use directly only the StatsJS telemetry pack
Hive Java monitor port
Hive Java player port
if true activate the Hive-Tester Driver feedback to monitor the player status
enable or disable the check for other active sessions on Hive Java. Default off;
List of parameter names that can be passed to the page URL to setup correspondent plugin options.
hiveDebugLevel accepts a string value to initialize the debug console level. The valid values are the same as "debugLevel"
hiveMonitorPort url parameter accepts a numeric value for the monitor port binded by Hive Java client
hivePlayerPort url parameter accepts a numeric value for the player port binded by Hive Java client
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
Error codes for failure in initializing Hive Sessions
Generic Undefined Error
No Tech available to resolve the ticket
No available Tech could resolved the ticket
Stopped resolving session on last tech onError
The ticket could not be resolved
Error messages corresponding to the HiveSessionErrorCode
Internal code of the Hive Tech Error
the tech is not ready to resolve the ticket or initialize a HiveSession
generic unspecified plugin error
an error happened while initializing the HiveSession
an error happened while resolving/verifying the ticket
the tech doesn't satisfy the minimum version requirement
list of available Hive Techs
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)
use the Java installed Hive client to retrieve the video from the CDN or the P2P Network
use only the browser telemetry package for Hive Insights
Object containing information about the initialized Hive Session
the identifier of the session
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.
the Hive technology that initialize this session
the url of the ticket
Object containing information for failure in initializing Hive Session
Object containing information about the Hive Tech Error that prevented the initialization of a Hive Session
get the Hive Session Error Message corresponding to a certain error code
Module for Global Hive Configurations.
This configuration can be accessed directly, e.g.
HiveConfig.ErrorMonitor.enabled = false
Overriding configurations for the Error Monitoring component. The ErrorMonitoring component provides RUM (Real User Monitor) and error tracking. This configurations are global per page.
Upload Log Key Combination enabled. If true, pressing the combination CTRL + SHIFT + X will upload the last 10 logs
Error Monitor enabled.
enable a filter for JS errors. If true, errors will be filtered based on the errorRegexFilter value. Set to false to send all errors.
Real User Monitor enabled. If true the component will monitor and send performance data of page and AJAX
Regex for filtering the errors based on the script url where the error was triggered.
ErrorMonitor user key
ErrorMonitor reporting version
special logic to filter progress events and detect playing:
true if the current watched manifest corresponds to the active HiveSession
Called after the initial metadata have been received from the player in order to activate the initialized Session
called when the player decided that the ticket resolve took too long and there is no need for it anymore
close the current active/initialized session, reset the active and initialized session values and reset the timers and stop the periodic stats
Attempt to resolve a ticket through any of the available techs
In a loop through all the tech, one at the time:
In case no tech can resolve the Session, an the Promise will fail with a HiveTechError
called before new segment is performed. Account the previous downloaded bytes as as a request with the current bitrate
extract bitrate from the playlist current media object
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
update the bandwidth on extended stats with the latest bw value measured by the hls tech
update stats to a new bitrate value and account the new bytesReceived on the previous bitrate
Generated using TypeDoc
API of Hive Comm player integration