Class: player

player(client)

Class which represents Canopy Player UX

Constructor

new player(client)

Instantiates a new Canopy Player object
Parameters:
Name Type Description
client channel Parent client Management Object
Source:

Members

cinemaModeIcon

Player Cinema-Mode Icon
Source:

client

Parent CLient Management Object
Source:

flipXIcon

Player Flip Video X Icon
Source:

flipYIcon

Player Filp Video Y Icon
Source:

hideVideoIcon

Player Hide Video Icon
Source:
Page Nav-Par
Source:

onUI

Whether or not the mouse cursor is floating over player UX
Source:

playerDiv

Top-Level Player Container Div
Source:

reloadIcon

Player Media Reload Icon
Source:

showVideoIcon

Player Show Video Icon
Source:

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...
Source:

syncDelta

Forced time to wait between sync checks, heavily decreases chance of seek-banging without reducing syncornization accuracy
Source:

syncIcon

Player Syncronization Icon
Source:

syncLock

Whether or not player scrub is locked to sync signal from the server
Source:

syncTolerance

Tolerance between timestamp from server and actual media before corrective seek for pre-recorded media
Source:

title

Player Title Label
Source:

uiBar

Auto-Hiding Player UI
Source:

uiTimer

Player UX Stow-Away timer
Source:

videoContainer

Player Element Container Div
Source:

volume

Current Player Volume
Source:

Methods

defineListeners()

Define Network-Related Event Listeners for the player
Source:

end()

Handles End-Media Commands from the Server
Source:

flipX()

Flips the video horizontally
Source:

flipY()

Flips the video vertically
Source:

getRatio() → {Number}

Calculates ratio of current media object
Source:
Returns:
Current media aspect ratio as a single floating point number
Type
Number

lockSync()

Locks player seek to synced timestamp from the server
Source:

popUI(event)

Displays UI after player-related input
Parameters:
Name Type Description
event Event Event passed through by event handler
Source:

reload()

Reloads the media player
Source:

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
Source:

setupInput()

Defines Input-Related Event Listeners for the player
Source:

start(data)

Handles command from server to start media
Parameters:
Name Type Description
data Object Media Metadata from server
Source:

sync(data)

Handles synchronization command from server
Parameters:
Name Type Description
data Object Syncrhonization Data from Server
Source:

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
Source:

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.
Source:

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
Source:

unlockSync()

Un-locks player seek to synced timestamp from the server
Source:

updateCurrentRawFile(data)

Handles Raw-File Metadata Updates from the Server
Parameters:
Name Type Description
data Object Updadated Raw-File link from Server
Source: