Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/meet/app.js
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | function joinRoom(data) { | ||||
sessionData = data | sessionData = data | ||||
// Init a session | // Init a session | ||||
session = OV.initSession() | session = OV.initSession() | ||||
// Handle connection creation events | // Handle connection creation events | ||||
session.on('connectionCreated', event => { | session.on('connectionCreated', event => { | ||||
// Ignore the current user connection | // Ignore the current user connection | ||||
if (!event.connection.options) { | if (event.connection.role) { | ||||
return | return | ||||
} | } | ||||
// This is the first event executed when a user joins in. | // This is the first event executed when a user joins in. | ||||
// We'll create the video wrapper here, which will be re-used | // We'll create the video wrapper here, which will be re-used | ||||
// in 'streamCreated' event handler. | // in 'streamCreated' event handler. | ||||
// Note: For a user with no cam/mic enabled streamCreated event | // Note: For a user with no cam/mic enabled streamCreated event | ||||
// is not being dispatched at all | // is not being dispatched at all | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | */ | ||||
session.connect(data.token, data.params) | session.connect(data.token, data.params) | ||||
.then(() => { | .then(() => { | ||||
let params = { publisher: true, audioActive, videoActive } | let params = { publisher: true, audioActive, videoActive } | ||||
let wrapper = videoWrapperCreate(container, Object.assign({}, data.params, params)) | let wrapper = videoWrapperCreate(container, Object.assign({}, data.params, params)) | ||||
publisher.on('videoElementCreated', event => { | publisher.on('videoElementCreated', event => { | ||||
$(event.element).prop({ | $(event.element).prop({ | ||||
muted: true, // Mute local video to avoid feedback | muted: true, // Mute local video to avoid feedback | ||||
disablePictureInPicture: true, // this does not work in Firefox | |||||
tabindex: -1 | tabindex: -1 | ||||
}) | }) | ||||
updateLayout() | updateLayout() | ||||
}) | }) | ||||
publisher.createVideoElement(wrapper, 'PREPEND') | publisher.createVideoElement(wrapper, 'PREPEND') | ||||
sessionData.wrapper = wrapper | sessionData.wrapper = wrapper | ||||
▲ Show 20 Lines • Show All 772 Lines • Show Last 20 Lines |