Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/meet/app.js
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | function Meet(container) | ||||
this.switchScreen = switchScreen | this.switchScreen = switchScreen | ||||
this.switchVideo = switchVideo | this.switchVideo = switchVideo | ||||
this.updateSession = updateSession | this.updateSession = updateSession | ||||
/** | /** | ||||
* Join the room session | * Join the room session | ||||
* | * | ||||
* @param data Session metadata and event handlers (session, token, shareToken, nickname, | * @param data Session metadata and event handlers (session, token, shareToken, nickname, role, | ||||
* chatElement, menuElement, onDestroy, onJoinRequest) | * chatElement, menuElement, onDestroy, onJoinRequest) | ||||
*/ | */ | ||||
function joinRoom(data) { | function joinRoom(data) { | ||||
resize(); | resize(); | ||||
volumeMeterStop() | volumeMeterStop() | ||||
data.params = { | data.params = { | ||||
nickname: data.nickname, // user nickname | nickname: data.nickname, // user nickname | ||||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | */ | ||||
muted: true, // Mute local video to avoid feedback | muted: true, // Mute local video to avoid feedback | ||||
disablePictureInPicture: true, // this does not work in Firefox | 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 | ||||
// Publish the stream | // Publish the stream | ||||
if (sessionData.role != 'SUBSCRIBER') { | |||||
session.publish(publisher) | session.publish(publisher) | ||||
} | |||||
}) | }) | ||||
.catch(error => { | .catch(error => { | ||||
console.error('There was an error connecting to the session: ', error.message); | console.error('There was an error connecting to the session: ', error.message); | ||||
}) | }) | ||||
// Prepare the chat | // Prepare the chat | ||||
setupChat() | setupChat() | ||||
} | } | ||||
▲ Show 20 Lines • Show All 277 Lines • ▼ Show 20 Lines | function pushChatMessage(data) { | ||||
} | } | ||||
// TODO: anchorme is extensible, we could support | // TODO: anchorme is extensible, we could support | ||||
// github/phabricator's markup e.g. backticks for code samples | // github/phabricator's markup e.g. backticks for code samples | ||||
}) | }) | ||||
message = message.replace(/\r?\n/, '<br>') | message = message.replace(/\r?\n/, '<br>') | ||||
// Display the message | // Display the message | ||||
let isSelf = data.id == publisher.stream.connection.connectionId | let isSelf = data.id == session.connectionId | ||||
let chat = $(sessionData.chatElement).find('.chat') | let chat = $(sessionData.chatElement).find('.chat') | ||||
let box = chat.find('.message').last() | let box = chat.find('.message').last() | ||||
message = $('<div>').html(message) | message = $('<div>').html(message) | ||||
message.find('a').attr('rel', 'noreferrer') | message.find('a').attr('rel', 'noreferrer') | ||||
if (box.length && box.data('id') == data.id) { | if (box.length && box.data('id') == data.id) { | ||||
▲ Show 20 Lines • Show All 489 Lines • Show Last 20 Lines |