Constructor
new player(client)
Instantiates a new Canopy Player object
Parameters:
| Name | Type | Description |
|---|---|---|
client |
channel | Parent client Management Object |
Members
cinemaModeIcon
Player Cinema-Mode Icon
client
Parent CLient Management Object
flipXIcon
Player Flip Video X Icon
flipYIcon
Player Filp Video Y Icon
hideVideoIcon
Player Hide Video Icon
navBar
Page Nav-Par
onUI
Whether or not the mouse cursor is floating over player UX
playerDiv
Top-Level Player Container Div
reloadIcon
Player Media Reload Icon
showVideoIcon
Player Show Video Icon
streamSyncTolerance
Tolerance in livestream delay before corrective seek to live.
Might seem weird to keep this here instead of the HLS handler, but remember we may want to support other livestream services in the future...
syncDelta
Forced time to wait between sync checks, heavily decreases chance of seek-banging without reducing syncornization accuracy
syncIcon
Player Syncronization Icon
syncLock
Whether or not player scrub is locked to sync signal from the server
syncTolerance
Tolerance between timestamp from server and actual media before corrective seek for pre-recorded media
title
Player Title Label
uiBar
Auto-Hiding Player UI
uiTimer
Player UX Stow-Away timer
videoContainer
Player Element Container Div
volume
Current Player Volume
Methods
defineListeners()
Define Network-Related Event Listeners for the player
end()
Handles End-Media Commands from the Server
flipX()
Flips the video horizontally
flipY()
Flips the video vertically
getRatio() → {Number}
Calculates ratio of current media object
Returns:
Current media aspect ratio as a single floating point number
- Type
- Number
lockSync()
Locks player seek to synced timestamp from the server
popUI(event)
Displays UI after player-related input
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Event passed through by event handler |
reload()
Reloads the media player
setOnUI(onUI)
Informs the class when the user's mouse curosr enters and leaves the UI area
Parameters:
| Name | Type | Description |
|---|---|---|
onUI |
Boolean | Whether or not onUI should be toggled true |
setupInput()
Defines Input-Related Event Listeners for the player
start(data)
Handles command from server to start media
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | Media Metadata from server |
sync(data)
Handles synchronization command from server
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | Syncrhonization Data from Server |
toggleCinemaMode(cinema)
Toggles Cinema Mode on or off
Parameters:
| Name | Type | Description |
|---|---|---|
cinema |
Boolean | Whether or not to enter Cinema Mode. Defaults to toggle if left unspecified |
toggleUI(show)
Toggles UI-Bar on or off
Parameters:
| Name | Type | Description |
|---|---|---|
show |
Boolean | Whether or not to show the UI-Bar. Defaults to toggle if left unspecified. |
toggleVideo(show)
Toggles video on or off
Parameters:
| Name | Type | Description |
|---|---|---|
show |
Boolean | Whether or not to show the video player. Defaults to toggle if left unspecified |
unlockSync()
Un-locks player seek to synced timestamp from the server
updateCurrentRawFile(data)
Handles Raw-File Metadata Updates from the Server
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | Updadated Raw-File link from Server |