Layout

Vue SFC that is the main routing point. All the routing is done by this component (layout = parent, other pages = children). It has a navigation bar for the routing that also contains the connection component in a drop-down menu (simplify the connection process for the user) and set the page height (currently the viewport height minus the height the navbar). This component is the one managing all the easyRTC necessary for the application. It communicates with the children component with a bus. The layout has the following dependencies : Connection component and Bootstrap-vue for styling and HTML element.

Data

Name Type Default value Description
peerId String - Id of the connected peer.
isDataChannelAvailable Boolean - Keep track if the data channel is open.
selfEasyrtcid String - self easyrtc id.
cameraStreamElement HTMLVideoElement - HTML video element to host camera.
mapStreamElement HTMLVideoElement - HTML video element to host map.
patrolMapStreamElement HTMLVideoElement - HTML video element to host map.
cameraStream VideoTrack - VideoTrack given by easyrtc of the camera.
mapStream VideoTrack - VideoTrack given by easyrtc of the camera.
teleopBus Vue - General communication bus between component. Change name.
routeBus Vue - Communication bus for the routing event.
peerTable Array.<String> - List of the robot in the room.
joystickState String - Indicates if the joystick should be activable or not.

Events

Name Payload Type Description
connection-changed String Use to communicate the state of connection has changed to the other components.
on-joystick-state-changed String Use to communicate the joystick can be used to the teleop page.

Methods

acceptCall(easyrtcid, acceptor)

Callback for the setAcceptChecker function.
Source:
Parameters:
Name Type Description
easyrtcid String Id of the occupant calling.
acceptor Callback Callback to accept the call.

acceptPeerVideo(easyrtcid, stream, streamName)

Callback for the setStreamAcceptor function.
Source:
Parameters:
Name Type Description
easyrtcid String Id of the occupant giving the video stream.
stream VideoTrack Track of the stream coming from the server.
streamName String Name of the stream coming from the server.

callAccepted(accepted, easyrtcid)

Callback for call accepted.
Source:
Parameters:
Name Type Description
accepted Boolean If the call was accepted.
easyrtcid String Id of the occupant that accepted the call.

callFailure(errCode, errMessage)

Callback for call failure.
Source:
Parameters:
Name Type Description
errCode Number Error Code.
errMessage String Error Message.

callSuccessful(occupantId, mediaType)

Callback for a successful call.
Source:
Parameters:
Name Type Description
occupantId String Id of the occupant that was called.
mediaType String Type of media received (ex: AudioVideo)

clearHTMLVideoStream()

Clears all feeds in html and reset the feed variables.
Source:

closePeerVideo(easyrtcid)

Callback for the setOnStreamClosed function.
Source:
Parameters:
Name Type Description
easyrtcid String Id of the occupant that disabled or lost its stream.

connect()

Function managing initialisation and connection to the easyrtc server
Source:

connectTo(easyrtcid)

Callback of the "peer-connection"event.
Source:
Parameters:
Name Type Description
easyrtcid String Id of the occupant to connect to.

dataCloseListenerCB(easyrtc)

Callback for the setDataChannelCloseListener function.
Source:
Parameters:
Name Type Description
easyrtc String Id of the occupant that a channel was closed with.

dataOpenListenerCB(easyrtc)

Callback for the setDataChannelOpenListener function.
Source:
Parameters:
Name Type Description
easyrtc String Id of the occupant that a channel was opened with.

getHTMLElements()

Get HTML element(s) of VideoBox component in the current page.
Source:

handleData(easyrtcid, type, data)

Callback of the setPeerListener function. Not currently used.
Source:
Parameters:
Name Type Description
easyrtcid String Peer id the datas are are coming from.
type String Channel to data was received on.
data String Data received.

handleRoomOccupantChange(roomName, occupants, isPrimary)

Callback for the handle of occupant in room.
Source:
Parameters:
Name Type Description
roomName String Name of the room.
occupants Array List of occupant in the room.
isPrimary Boolean

loginFailure(errorCode, message)

Callback for failure to connect to the room.
Source:
Parameters:
Name Type Description
errorCode Number Error code.
message String Error message.

loginSuccess(easyrtcid)

Callback for successfully connecting to the room.
Source:
Parameters:
Name Type Description
easyrtcid String Self id give by the server.

onJoystickPositionChange(data)

Callback of the "joystick-position-change" event.
Source:
Parameters:
Name Type Description
data Object Teleop data.

performCall(occupantId)

Use to call someone in the room with its id.
Source:
Parameters:
Name Type Description
occupantId String Id to call.

requestFeedFromPeer(feed)

Use to request a stream from the peer.
Source:
Parameters:
Name Type Description
feed String Feed Name to request.

sendData(goalJsonString, type, data)

Sends data to the robot using the data channel.
Source:
Parameters:
Name Type Description
goalJsonString String Stringigify JSON of the patrol.
type String Channel to send the data on.
data String Stringify data to send.

sendPatrol(goalJsonString)

Callback of the "send-patrol" event.
Source:
Parameters:
Name Type Description
goalJsonString String Stringigify JSON of the patrol.

setHTMLVideoStream()

Sets the available video feed(s) to available html element(s).
Source:

verifyJoystickState()

Verify if the joystick should be enable.
Source: