Methods
Some methods are only available if the website is authenticated 🔐. See "advanced usage" for more information.
Methods for event listeners are documented in the events section.
static EyesonIframe.version
Version number of current built. Relevant for available methods, events and error handling etc.
Features
There's a list of available features, like present, chat, and snapshot. To become available, you need to authenticate 🔐 and there are conditions where each feature might still be unavailable. For example, the mobile version of Eyeson UI does not support any of these.
The feature's status becomes available with the authenticated
event.
const meeting = new EyesonIframe(...);
meeting.on('authenticated', () => {
console.log(meeting.features);
/*
{
present: true,
chat: true,
snapshot: true,
}
*/
});
present(files) 🔐
Start Eyeson UI presentation with given file(s).
The files
parameter can be a blob or an array of blobs or a FileList.
Current supported file types are:
- application/pdf
- image/* (depending on browser support)
- video/* (depending on browser support)
Maximum 1 PDF, or 1 video, or 25 images are allowed.
Rejected promise can contain the following error
NotAllowedError
'Authentication error'InvalidStateError
'Invalid state'TypeError
'Invalid files argument'NotAllowedError
'Not available'TimeoutError
'Message timeout' (after 2s)UnknownError
'The operation failed'
if (meeting.features.present) {
meeting.present([image1, image2, image3]).catch(error => {
console.error(error);
});
}
presentDocument(file) 🔐
Start Eyeson UI presentation with given PDF file.
File must be of type application/pdf
.
Rejected promise can contain the following error
NotAllowedError
'Authentication error'InvalidStateError
'Invalid state'TypeError
'Invalid file argument'NotAllowedError
'Not available'TimeoutError
'Message timeout' (after 2s)UnknownError
'The operation failed'
if (meeting.features.present) {
meeting.presentDocument(pdfFile).catch(error => {
console.error(error);
});
}
chat(message) 🔐
Send chat message in Eyeson UI. Works only if chat is available.
Rejected promise can contain the following error
NotAllowedError
'Authentication error'InvalidStateError
'Invalid state'TypeError
'Invalid message type'NotAllowedError
'Not available'TimeoutError
'Message timeout' (after 2s)UnknownError
'The operation failed'
if (meeting.features.chat) {
const message = getTextMessage();
meeting.chat(message).catch(error => {
console.error(error);
});
}
snapshot() 🔐
Trigger a snapshot in Eyeson UI. Works only if snapshot is available.
Rejected promise can contain the following error
NotAllowedError
'Authentication error'InvalidStateError
'Invalid state'NotAllowedError
'Not available'TimeoutError
'Message timeout' (after 2s)UnknownError
'The operation failed'
if (meeting.features.snapshot) {
meeting.snapshot().catch(error => {
console.error(error);
});
}
reload()
Reload Eyeson UI web page in iframe.
Returns a promise.
getIFrame()
Returns the injected iframe element.
isAuthenticated()
Returns true
if authenticated 🔐, so that restricted methods can be used.
Otherwise it returns false
.
isInMeeting() 🔐
Returns true
if current user has joined the meeting. Otherwise false
.
Attention! This returns null
if not authenticated 🔐.
close()
Destroy EyesonIframe instance, cleanup and remove injected iframe element.
Returns a promise.