FORGE. VideoHTML5

new VideoHTML5(viewer, key, configopt, nullable, qualityModeopt, nullable, ambisonicopt, nullable)

Display object that contains a html video tag.

Mobile limitations :
- Can't play a video without user touch interaction, so we can't do smooth multiquality.
Parameters:
Name Type Attributes Description
viewer FORGE.Viewer FORGE.Viewer reference.
key string The video file id reference.
config string | FORGE.VideoQuality | Array.<(string|FORGE.VideoQuality)> <optional>
<nullable>
Either a FORGE.VideoQuality or a String URL, or an array of strings or FORGE.VideoQuality if multiquality.
qualityMode string <optional>
<nullable>
The default quality mode.
ambisonic boolean <optional>
<nullable>
Is the video sound ambisonic?
Source:
To Do:
  • Define a config object for videos, maybe a class like VideoConfig to describe this porperly.
  • Make it work with several sources if the user wants to pass a mp4 + webm + ogg for example.
  • Deal with playback speeds.
  • Add subtitles management with and VTT/TTML(EBU-TT-D) files

Extends

Members

(readonly) alive :boolean

Get the alive flag value of the object.
Type:
  • boolean
Inherited From:
Source:

alpha :number

Get and set the left alpha of this display object. (between 0 and 1).
Type:
  • number
Inherited From:
Source:

ambisonic :boolean

Get the ambisonic state of the video sound.
Type:
  • boolean
Source:

background :string

Get and set the backgound CSS value of this display object.
Type:
  • string
Inherited From:
Source:

borderColor :string

Get and set the border-color CSS value of this display object.
Type:
  • string
Inherited From:
Source:

borderRadius :number

Get and set the border-radius CSS value of this display object.
Type:
  • number
Inherited From:
Source:

borderStyle :string

Get and set the border-style CSS value of this display object.
Type:
  • string
Inherited From:
Source:

borderWidth :number

Get and set the border-width CSS value of this display object.
Type:
  • number
Inherited From:
Source:

(nullable) bottom :number

Get and set the bottom anchor of this display object.
Type:
  • number
Inherited From:
Source:

(readonly, nullable) buffer :FORGE.VideoTimeRanges

Get the FORGE.VideoTimeRanges of the video for buffered ranges.
Type:
Source:

(readonly) canPlay :boolean

Get the canPlay status of the video.
Type:
  • boolean
Inherited From:
Source:

(readonly) className :string

Get the class name of the object.
Type:
  • string
Inherited From:
Source:

(readonly) currentIndex :number

Get the current quality index, returns -1 if no current is playing.
Type:
  • number
Source:

currentTime :number

Get and set the currentTime of the video.
Type:
  • number
Source:

currentTimeMS :number

Get and set the currentTime of the video in milliseconds.
Type:
  • number
Source:

data :*

Get and set any custom data you want to associate to this object.
Type:
  • *
Inherited From:
Source:

debug :boolean

Get and set the debug flag.
Type:
  • boolean
Inherited From:
Source:

(readonly) dom :Element|HTMLElement

Get the dom element that compose this display object.
Type:
  • Element | HTMLElement
Inherited From:
Source:

(readonly) drag :FORGE.Drag

Get the FORGE.Drag object that handles drag events for this display object.
Type:
Inherited From:
Source:

(readonly) duration :number

Get the duration of the video in seconds.
Type:
  • number
Source:

(readonly) durationMS :number

Get the duration of the video in milli seconds.
Type:
  • number
Source:

(readonly, nullable) element :HTMLVideoElement

Get the html element of the current video.
Type:
  • HTMLVideoElement
Source:

(readonly) endCount :boolean

Get the number of the video ends.
Type:
  • boolean
Inherited From:
Source:

fullscreen :boolean

Set the fullscreen property of this display object.
Type:
  • boolean
Inherited From:
Source:

(readonly) globalOffset :Object

Get the global offset
Type:
  • Object
Inherited From:
Source:

height :number|string

Get and set the height of this display object. The getter will always return a number, but you can pass to the setter either a number like 10 or a string like "10px" or "10%".
Type:
  • number | string
Inherited From:
Source:

horizontalCenter :boolean

Get and set the horizontal center status of this display object.
Type:
  • boolean
Inherited From:
Source:

id :string

Get and set the id of this display object.
Type:
  • string
Inherited From:
Source:

index :number

Get and set the index value of this display object. This is the z-index CSS property.
Type:
  • number
Inherited From:
Source:

(readonly) innerHeight :number

Get the inner height in pixels (understand height without borders) of this DisplayObject.
Type:
  • number
Inherited From:
Source:

(readonly) innerWidth :number

Get the inner width (understand width without borders) of this DisplayObject.
Type:
  • number
Inherited From:
Source:

keepRatio :boolean

Get and set the keepRatio status of this display object.
Type:
  • boolean
Inherited From:
Source:

(nullable) left :number

Get and set the left anchor of this display object.
Type:
  • number
Inherited From:
Source:

loop :boolean

Get and set the loop status of the video.
Type:
  • boolean
Source:

maximized :boolean

Get and set the maximized status of this display object.
Type:
  • boolean
Inherited From:
Source:

(readonly) metaDataLoaded :boolean

Get the metaDataLoaded status of the video.
Type:
  • boolean
Source:

muted :boolean

Get and set the muet status of the video.
Type:
  • boolean
Source:

(readonly) onAddedToDom :FORGE.EventDispatcher

Get the "onAddedToDom" FORGE.EventDispatcher of this display object.
Type:
Inherited From:
Source:

(readonly) onAddedToParent :FORGE.EventDispatcher

Get the "onAddedToParent" FORGE.EventDispatcher of this display object.
Type:
Inherited From:
Source:

(readonly) onBorderChange :FORGE.EventDispatcher

Get the "onBorderResize" FORGE.EventDispatcher of this display object.
Type:
Inherited From:
Source:

(readonly) onCanPlay :FORGE.EventDispatcher

Get the "onCanPlay" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onCanPlayThrough :FORGE.EventDispatcher

Get the "onCanPlayThrough" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onCurrentTimeChange :FORGE.EventDispatcher

Get the "onCurrentTimeChange" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onDestroy :FORGE.EventDispatcher

Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
Inherited From:
Source:

(readonly) onDurationChange :FORGE.EventDispatcher

Get the "onDurationChange" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onEnded :FORGE.EventDispatcher

Get the "onEnded" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onError :FORGE.EventDispatcher

Get the "onError" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onFullscreenEnter :FORGE.EventDispatcher

Get the "onFullscreenEnter" FORGE.EventDispatcher of this display object.
Type:
Inherited From:
Source:

(readonly) onFullscreenExit :FORGE.EventDispatcher

Get the "onFullscreenExit" FORGE.EventDispatcher of this display object.
Type:
Inherited From:
Source:

(readonly) onHide :FORGE.EventDispatcher

Get the "onHide" FORGE.EventDispatcher of this display object.
Type:
Inherited From:
Source:

(readonly) onLoadedData :FORGE.EventDispatcher

Get the "onLoadedData" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onLoadedMetaData :FORGE.EventDispatcher

Get the "onLoadedMetaData" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onLoadStart :FORGE.EventDispatcher

Get the "onLoadStart" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onMove :FORGE.EventDispatcher

Get the "onMove" FORGE.EventDispatcher of this display object.
This event is triggered when object's coordinate (x, y) changed.
Type:
Inherited From:
Source:

(readonly) onMute :FORGE.EventDispatcher

Get the "onMute" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onPause :FORGE.EventDispatcher

Get the "onPause" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onPlay :FORGE.EventDispatcher

Get the "onPlay" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onPlaying :FORGE.EventDispatcher

Get the "onPlaying" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onProgress :FORGE.EventDispatcher

Get the "onProgress" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onQualitiesLoaded :FORGE.EventDispatcher

Get the "onQualitiesLoaded" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onQualityAbort :FORGE.EventDispatcher

Get the "onQualityAbort" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onQualityChange :FORGE.EventDispatcher

Get the "onQualityChange" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onQualityModeChange :FORGE.EventDispatcher

Get the "onQualityModeChange" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onQualityRequest :FORGE.EventDispatcher

Get the "onQualityRequest" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onReady :FORGE.EventDispatcher

Get the "onReady" FORGE.EventDispatcher of this display object.
Type:
Inherited From:
Source:

(readonly) onResize :FORGE.EventDispatcher

Get the "onResize" FORGE.EventDispatcher of this display object.
Type:
Inherited From:
Source:

(readonly) onSeeked :FORGE.EventDispatcher

Get the "onSeeked" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onSeeking :FORGE.EventDispatcher

Get the "onSeeking" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onShow :FORGE.EventDispatcher

Get the "onShow" FORGE.EventDispatcher of this display object.
Type:
Inherited From:
Source:

(readonly) onStalled :FORGE.EventDispatcher

Get the "onStalled" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onTimeUpdate :FORGE.EventDispatcher

Get the "onTimeUpdate" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onUnmute :FORGE.EventDispatcher

Get the "onUnmute" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onVolumeChange :FORGE.EventDispatcher

Get the "onVolumeChange" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) onWaiting :FORGE.EventDispatcher

Get the "onWaiting" event FORGE.EventDispatcher of the video.
Type:
Source:

(readonly) originalHeight :number

Get the original height of the video source.
Type:
  • number
Source:

(readonly) originalWidth :number

Get the original width of the video source.
Type:
  • number
Source:

parent :FORGE.DisplayObjectContainer

Get and set the parent of this display object.
Type:
Inherited From:
Source:
To Do:
  • Find a clean way to identify DisplayObjectContainer and other class that inherits from.

(readonly) paused :boolean

Get the paused status of the video.
Type:
  • boolean
Inherited From:
Source:

percentHeight :number

Get and set the height of this display object in percent only.
Type:
  • number
Inherited From:
Source:

percentWidth :number

Get and set the width of this display object in percent only.
Type:
  • number
Inherited From:
Source:

pixelHeight :number

Get and set the height of this display object in pixel only.
Type:
  • number
Inherited From:
Source:

pixelWidth :number

Get and set the width of this display object in pixel only.
Type:
  • number
Inherited From:
Source:

(readonly) playCount :boolean

Get the number of play action of the video.
Type:
  • boolean
Inherited From:
Source:

(readonly, nullable) played :FORGE.VideoTimeRanges

Get the FORGE.VideoTimeRanges of the video for played ranges.
Type:
Source:

(readonly) playing :boolean

Get the playing status of the video.
Type:
  • boolean
Inherited From:
Source:

(readonly) pointer :FORGE.Pointer

Get the FORGE.Pointer object that handles mouse and touch events for this display object.
Type:
Inherited From:
Source:

(readonly) qualities :Array.<FORGE.VideoQuality>

Get the quality array.
Type:
Source:

quality :number|FORGE.VideoQuality

Get and set the quality index of the video.
Type:
Source:

qualityMode :string

Get and set the quality mode.
Available quality mode are listed in FORGE.VideoQualityMode const.
Type:
  • string
Source:

(readonly) ready :boolean

Get the ready status of this display object.
Type:
  • boolean
Inherited From:
Source:

remainingTime :number

Get the remainingTime of the video.
Type:
  • number
Source:

(readonly) requestIndex :number

Get the requested quality index, returns -1 if no request is being processed.
Type:
  • number
Source:
Get and set the right anchor of this display object.
Type:
  • number
Inherited From:
Source:

rotation :number

Get and set the rotation of this display object. (in degree).
Type:
  • number
Inherited From:
Source:

(readonly) tags :Array

Get the tags associated to this object.
Type:
  • Array
Inherited From:
Source:

tooltip :string

Get and set the tooltip value of this display object. This is the title dom property.
Type:
  • string
Inherited From:
Source:

(nullable) top :number

Get and set the top anchor of this display object.
Type:
  • number
Inherited From:
Source:

(readonly) uid :string

Get the uid of the object.
Type:
  • string
Inherited From:
Source:

unitHeight :string

Get and set the height unit of this display object.
Type:
  • string
Inherited From:
Source:

unitWidth :string

Get and set the width unit of this display object.
Type:
  • string
Inherited From:
Source:

verticalCenter :boolean

Get and set the vertical center status of this display object.
Type:
  • boolean
Inherited From:
Source:

(readonly) videos :Array.<Object>

Get the video object array.
Type:
  • Array.<Object>
Source:

(readonly) viewer :FORGE.Viewer

Get the viewer reference object.
Type:
Inherited From:
Source:

visible :boolean

Get and set the visibility of this display object.
Type:
  • boolean
Inherited From:
Source:

volume :number

Get and set the volume of the video. Set a volume unmute the video
Type:
  • number
Source:

warning :boolean

Get and set the warning flag.
Type:
  • boolean
Inherited From:
Source:

width :number|string

Get and set the width of this display object. The getter will always return a number, but you can pass to the setter either a number like 10 or a string like "10px" or "10%".
Type:
  • number | string
Inherited From:
Source:

x :number

Get and set the x position of this display object.
Type:
  • number
Inherited From:
Source:

y :number

Get and set the y position of this display object.
Type:
  • number
Inherited From:
Source:

Methods

destroy()

Destroy method.
Overrides:
Source:

fullscreenEnter()

Request a fullscreen enter on this display object.
Inherited From:
Source:

fullscreenExit()

Request a fullscreen exit on this display object.
Inherited From:
Source:

hide()

Hide this display object.
Inherited From:
Source:

isFullscreen() → {boolean}

Know if this display object is in fullscreen
Inherited From:
Source:
Returns:
Type
boolean

isInDom() → {boolean}

Method to know if a display object is in dom.
Inherited From:
Source:
Returns:
Returns true if the display Object is in DOM, false if not.
Type
boolean

load(confignullable)

Load a config or a video url to the source.
Parameters:
Name Type Attributes Description
config string | FORGE.VideoQuality | Array.<(string|FORGE.VideoQuality)> <nullable>
An url to load, or an array of urls or an array ok FORGE.VideoQuality.
Source:

log(value)

Basic log method, log a string in the console if debug is enabled.
Parameters:
Name Type Description
value * The value you want to log in the console.
Inherited From:
Source:

maximize(keepMaximized)

Maximize the size of this display object to the size of its parent.
Parameters:
Name Type Description
keepMaximized boolean Set this param to true if you want that this display object auto resize to max when its parent is resized.
Inherited From:
Source:

mute()

Mute the video sound.
Source:

pause()

Pauses the video.
Overrides:
Source:

play(timeopt, loopopt)

Plays the video.
Parameters:
Name Type Attributes Description
time number <optional>
Time you want to start the playback.
loop boolean <optional>
Does the video have to loop at the end of the duration?
Overrides:
Source:

resize(width, height)

Resize this display object to a given width / height.
Parameters:
Name Type Description
width number | string The width you want to set, it can be for example 10, "10px" or "10%".
height number | string The height you want to set, it can be for example 10, "10px" or "10%".
Inherited From:
Source:

show()

Show this display object.
Inherited From:
Source:

stop()

Stop the video the video (pause it and set time to 0).
Source:

togglePlayback()

Toggles the playback status, if play toggle to pause and vice versa.
Source:

toggleVisibility()

Toggles th visibility of this display object.
Inherited From:
Source:

unmute(volumeopt)

Unute the video sound.
Parameters:
Name Type Attributes Description
volume number <optional>
The volume to be restored on unmute.
Source:

update()

Update method called by the viewer main loop.
Source:

warn(valuenullable)

Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name Type Attributes Description
value string | Object <nullable>
The value you want to warn in the console.
Inherited From:
Source:

FORGE. VideoHTML5

Members
Methods