new FileTransferPackage(session, packageType)
Parameters:
Name | Type | Description |
---|---|---|
session |
Object | An instance of wsc.Session. |
packageType |
String | The name of package. If not provided, default value is 'file_transfer'. |
Methods
-
close()
-
Closes the package and terminates all the package managed FileTransfers.
-
createFileTransfer(target) → {wsc.FileTransfer}
-
Creates a FileTransfer.
Parameters:
Name Type Description target
String the name of the target
Returns:
an instance of FileTransfer
- Type
- wsc.FileTransfer
-
getFileTransfers() → {Array}
-
Gets all the FileTransfer objects managed by this package.
Returns:
an array of FileTransfer objects.
- Type
- Array
-
prepareFileTransfer(session, callee) → {Object}
-
For extensibility - Builds a wsc.FileTransfer and returns it.
This function may be overridden by an extended FileTransferPackage to create an extended FileTransfer object.Parameters:
Name Type Description session
wsc.Session an instance of wsc.Session object
callee
String the name of callee.
Returns:
an instance of FileTransfer.
- Type
- Object
Events
-
onFileTransfer
-
Callback function for file transfer request.
Parameters:
Name Type Description fileTransfer
Object an instance of wsc.FileTransfer object.
-
onMessage
-
For extensibility - Processes the received JSON message between the client and WebRTC Session Controller server.
This function dispatches the received messages to corresponding wsc.FileTransfer objects. The application can override this method to handle the JSON message directly.Parameters:
Name Type Description msg
Object the JSON message between the client and WebRTC Session Controller server.