Constructor
new BitmapSubtitle(player, optionsopt)
Bitmap Subtitle Plugin constructor
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
player |
Player | A Video.js Player instance. | ||
options |
Object |
<optional> |
{} | object of option names and values |
option.pathPrefix |
string |
<optional> |
'/bitmapsub' | pathPrefix: where to find image subtitles tiled |
option.labelPrefix |
string |
<optional> |
'' | labelPrefix: menu item label prefix |
option.labelSuffix |
string |
<optional> |
' ⋅BMP' | labelPrefix: menu item label suffix |
option.name |
string |
<optional> |
'bitmapsub' | component name |
Methods
appendComponent()
Append bitmap subtitle extra plugin components to video.js UI
buildTrackMenuItems() → {Array.<textTrackMenuItem>}
Compute bitmap track menu items and its corresponding
click handler for bitmap subtitle menu
Returns:
- list of textTrackMenuItem filtered
- Type
- Array.<textTrackMenuItem>
changeToTrack(id)
Change bitmap subtitle to track with id ${id}
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | track id |
getBitmapTracks() → {Array.<textTracks>}
Returns a list of textTrack from all tracks filtered by kind
'metadata' type and label starting with 'pgssub' or 'vobsub'
prefix.
Returns:
- list of filtered textTracks
- Type
- Array.<textTracks>
listenCueChange(stateopt)
Append or remove 'cuechange' event listener on current track
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
state |
boolean |
<optional> |
true | true: append, false: remove if this.currentSubtitle.listener |
menuControlItems() → {Array.<MenuItem>}
Extra controls items for bitmap subtitle menu:
- settings panel
- off bitmap subtitle
Returns:
- settings and off menu items
- Type
- Array.<MenuItem>
scaleSubtitle()
Scale subtitle container against current displayed video witdh
updateBitmapMenu()
Populate bitmap subtitle menu with track items if any
updateSubtitle()
From a large image of tiled bitmap subtitle, pick up one
of them by creating a mask window around it.
Subtitle container visibility is related to current track.activeCue.
Metadata track current cue define window size and position as
following format: bitmap_image.png:width:height:driftX:driftY