- Source:
Collaboration is a static class that provides the required methods to create, join and connect to sessions.
Methods
(static) disconnect()
- Source:
Disconnect the live connection
(static) getAnnotationManagers()
- Source:
Gets the annotation managers
Returns:
A list of annotation managers
(static) getApiUrl()
- Source:
Gets the API url to use
Returns:
the API url
(static) getApplicationData()
- Source:
Gets application specific data shared beetween participants of a session
(static) getCurrentSession() → {Collaboration~Session}
- Source:
Gets the current session
Returns:
The current session object
(static) getHub()
- Source:
Gets the hub connection
Returns:
The signalr Hub connection
(static) getLoaders()
- Source:
Gets the slide loaders instances
Returns:
A list of slide loaders
(static) getSessionActive() → {boolean}
- Source:
Gets the current session's state
Returns:
Gets the session state
- Type
- boolean
(static) getSessions() → {Array.<Collaboration~Session>}
- Source:
Gets the list of available sessions
Returns:
A list of sessions
- Type
- Array.<Collaboration~Session>
(static) initialize(options, components)
- Source:
Initiates a live connection between clients and viewers
Parameters:
Name | Type | Description |
---|---|---|
options |
Collaboration~InitializeOptions | The options to initialize the live with |
components |
Array.<Object> | A List of components to initialize i.e. Chat, Board |
Returns:
A promise to listen to when the connection is ready.
(static) joinSession(name, active, owner, everyoneInControl)
- Source:
Joins or creates a new session with the following parameters
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the session |
active |
boolean | Whether or not the session is active |
owner |
string | The owner of the session |
everyoneInControl |
boolean | Whether every participant can control the viewers |
Returns:
A promise which resolves to the joined session
(static) resetImages()
- Source:
Clears loaded images
(static) setApplicationData(data)
- Source:
Sets application specific data to be shared beetween participants of a session
Parameters:
Name | Type | Description |
---|---|---|
data |
Object |
(static) setEveryoneInControl(everyoneInControl)
- Source:
Sets whether or not every participant can control the viewports, or the master only
Parameters:
Name | Type | Description |
---|---|---|
everyoneInControl |
boolean | The value to set |
(static) setNumberOfImages(numImages)
- Source:
Sets the maximun number of allowed slides
Parameters:
Name | Type | Description |
---|---|---|
numImages |
number |
(static) setSessionActive(active)
- Source:
Sets the current session's state to active or inactive
Parameters:
Name | Type | Description |
---|---|---|
active |
boolean | Set the session state to active or not |
Type Definitions
getSlideLoader() → {SlideLoader}
- Source:
A function called every time a new slide needs to be loaded
Returns:
An instance of a PMA.UI.SlideLoader
- Type
- SlideLoader
ImageAnnotation
- Source:
Properties:
Name | Type | Description |
---|---|---|
id |
number | The annotation's unique id |
sessionId |
number | The session id this annotation belongs to |
imageId |
number | The image id this annotation belongs to |
geometry |
string | The WKT geometry for this annotation |
lineThickness |
number | The thickness to draw this annotation |
color |
string | The html color to draw this annotation with |
fillColor |
string | The html color to fill this annotation with |
dimensions |
number | The number of dimensions for this annotation. 0 for point, 1 for linem 2 for closed shapes(polygons, closed polylines) |
notes |
string | The notes for this annotation if any |
Classification |
string | The classification for this annotation |
owner |
string | The owner for this annotation |
Type:
- Object
InitializeOptions
- Source:
Properties:
Name | Type | Description |
---|---|---|
master |
boolean | Whether you should be the master of this session |
pmaCoreUrl |
string | The PMA.core url to use |
apiUrl |
string | The PMA.live server api url to use |
hubUrl |
string | The PMA.live signalr hub url to use |
dataChanged |
function | A callback function called every time the application specific data is changed |
pointerImageSrc |
string | A relative url to an image to use as pointer |
masterPointerImageSrc |
string | A relative url to an image to use as a pointer for the master participant |
getSlideLoader |
Collaboration~getSlideLoader | A callback function which should return a slide loader for each slide |
Initialize a new session options
Type:
- Object
Session
- Source:
Properties:
Name | Type | Description |
---|---|---|
id |
number | The session id |
active |
boolean | Whether the session is active |
name |
string | The name of the session |
applicationData |
Object | Any application specific data |
owner |
string | The owner of the session |
token |
string | The last token of the sesion |
numberOfImages |
number | The maximum allowed number of slide for this session |
everyoneInControl |
boolean | Whether every participant is in control of the viewports |
LastUpdated |
date | The date this session was last updated/used |
Images |
Array.<SessionImage> | The list of slides used in this session |
Session entity
Type:
- Object
SessionImage
- Source:
Properties:
Name | Type | Description |
---|---|---|
id |
number | The slide unique id |
sessionId |
number | The session id this slide belongs to |
path |
string | The PMA.core path of this slide |
index |
number | The index of this slide in the list |
centerX |
number | The center pixel x of this slide in the viewport |
centerY |
number | The center pixel y of this slide in the viewport |
rotation |
number | The rotation of this slide |
flipX |
boolean | Whether this slide is flipped in the x-axis |
flipY |
boolean | Whether this slide is flipped in the y-axis |
resolution |
number | The current resolution of this slide in the viewport |
token |
number | The token for this slide |
channels |
string | The channels active for this slide in the viewport |
timeframe |
number | The active timeframe for this slide in the viewport |
layer |
number | The active layer for this slide in the viewport |
annotations |
Array.<ImageAnnotation> | The list of drawed annotations on this slide |
Type:
- Object