HTML5 Player Plugin

Version-specific classes, methods, types, and signatures available directly in this documentation.

HiveHtml5

The main plugin class. Bind it to a video element, initialize authorization, and query player/session state.

Constructor & lifecycle

new HiveHtml5(videoOrQuery: HTMLVideoElement | string, options?: OptionsHtml5)

Creates a plugin instance bound to a video element or element selector.

initSession(HiveAuthorization | HiveAuthorization[], manifestUrl?: string, reset?: boolean): Promise<HiveSession>

Resolves a ticket or JWT and initializes the Hive session.

closeHiveSession(reason?: string, reset?: boolean): void

Closes the active Hive session and stops telemetry.

setHTMLVideoElement(videoElement?: HTMLVideoElement): void

Binds or refreshes the HTML video element used by the plugin.

getHTMLVideoElement(): Promise<HTMLVideoElement>

Resolves the currently bound HTML video element.

Public methods 21

registerEvent(target: any, handlerName: string): void

Registers a player event handler with the plugin.

createXMLHttpRequest(): XMLHttpRequest

Creates an XHR instance configured for Hive interception.

getPlayerSource(): string

Returns the player’s current source URL.

getCurrentTime(): number

Returns the current playback position.

setCurrentTime(currentTime: number): void

Moves playback to the supplied position.

getBufferLen(): number

Returns the player’s current buffered duration.

getDuration(): number

Returns the media duration.

getWindowSize(): { width: number; height: number }

Returns the current player viewport size.

getTextTracks(): TextTrack[]

Returns normalized text-track metadata.

getCaptionLanguage(): string

Returns the active caption language.

isFullscreen(): boolean

Reports whether playback is fullscreen.

isLive(): boolean

Reports whether the active stream is live.

isActive(): boolean

Reports whether a Hive session is active.

getManifestUrlToForce(): string

Returns the manifest override supplied at initialization.

getStreamProtocol(): StreamProtocol

Returns the active HLS or DASH protocol.

getPlayerTech(): string

Returns the selected Hive distribution technology.

getPlayerVersion(): string

Returns the configured player version.

getVideoElement(): HTMLVideoElement

Returns the bound video element.

getPlayerName(): string

Returns the configured player name.

getPlayerVolume(): number

Returns the current player volume.

disableHiveModule(): void

Disables the active player module integration.

OptionsHtml5

Configuration passed to the HiveHtml5 constructor. Extends the shared plugin options.

Properties

playerName?: string

Player name reported to Hive Insights.

playerVersion?: string

Player version reported to Hive Insights.

debugLevel?: string

Logging level; defaults to notice.

onInitSession?: (session, plugin) => void

Called after Hive resolves the session.

onError?: (message: HiveErrorMessage) => void

Receives initialization and plugin errors.

errorRetrials?: number

Maximum session re-initialization attempts.

hiveTechOrder?: TechNameType[]

Preferred order for the bundled Hive technologies.

isLowLatency?: boolean

Falls back to StatsJS for unsupported low-latency streams.

HiveSession

Information returned after Hive successfully initializes a session.

Properties

id: string

Unique session identifier.

manifest: string

Resolved manifest URL to load into the player.

tech: string

Hive technology selected for the session.

ticketUrl: string

Authorization ticket URL associated with the session.

JWTAuthToken

JWT authorization payload accepted by initSession.

Properties

jwt: string

Signed JWT containing the partner and key identifiers.

videoId: string

Video ID matching the JWT subject claim.

manifest: string | string[]

Manifest value present in the JWT man claim.

endpoint?: "dev" | "test" | "prod"

Optional Hive service endpoint.

HiveErrorMessage & HiveSessionError

Structured plugin messages and session-initialization failures.

HiveErrorMessage

severity: HiveSeverity

NORMAL, HIGH, or CRITICAL handling level.

code: number

Numeric Hive error code.

message: string

Human-readable error summary.

pluginVersion: string

Plugin version that emitted the message.

HiveSessionError

code: HiveSessionErrorCode

Typed session initialization error code.

detailedMessage: string

Detailed failure context.

getHiveSessionError(ticketUrl, code, detailedMessage?): HiveSessionError

Creates a structured session error.

getHiveSessionErrorMessage(code): string

Returns the message for an error code.

Integration guide

Read the integration guide for 13.3.0.

Updated