Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
15fd048
refactored, simplified, more odoo
DanielPhillip-Solvti Jan 20, 2026
02a47ca
updated readme
DanielPhillip-Solvti Jan 20, 2026
ae00272
imporved muting
DanielPhillip-Solvti Jan 20, 2026
56b9c22
null check
DanielPhillip-Solvti Jan 20, 2026
5b77aa0
add UI check
DanielPhillip-Solvti Jan 20, 2026
13e9163
add audio element to DOM
DanielPhillip-Solvti Jan 20, 2026
7a01676
null check
DanielPhillip-Solvti Jan 20, 2026
75b2fa4
updated manifest
DanielPhillip-Solvti Jan 20, 2026
fd9f010
added additional mute handling
DanielPhillip-Solvti Jan 20, 2026
e67797e
added additional mute handling
DanielPhillip-Solvti Jan 20, 2026
6191fa2
added additional mute handling
DanielPhillip-Solvti Jan 20, 2026
603551a
improved clean up
DanielPhillip-Solvti Jan 20, 2026
ec67a70
nullcheck
DanielPhillip-Solvti Jan 20, 2026
76fd25e
address various possible errors
DanielPhillip-Solvti Jan 20, 2026
28872b1
address various possible errors
DanielPhillip-Solvti Jan 20, 2026
3341aba
address various possible errors
DanielPhillip-Solvti Jan 20, 2026
2b42989
address various possible errors
DanielPhillip-Solvti Jan 20, 2026
316a2af
address various possible errors
DanielPhillip-Solvti Jan 20, 2026
6e287d2
extended clean up
DanielPhillip-Solvti Jan 20, 2026
39ad781
committed to livekit managing audio streams
DanielPhillip-Solvti Jan 21, 2026
81ce778
tied voulme control to audio elements
DanielPhillip-Solvti Jan 21, 2026
6012762
trigger rebind on connect
DanielPhillip-Solvti Jan 21, 2026
56b3e3c
changed rebind logic
DanielPhillip-Solvti Jan 21, 2026
03c526f
move rebind to livekit service
DanielPhillip-Solvti Jan 21, 2026
8254fd5
Delete odoo.conf
DanielPhillip-Solvti Jan 21, 2026
3a0f3b4
Delete mail_livekit/streamIssue.md
DanielPhillip-Solvti Jan 21, 2026
621cd62
Rename JS file to avoid liner errors
KDRdev Jan 30, 2026
8463ac8
Rename JS file to avoid linter errors
KDRdev Jan 30, 2026
4e6a49e
Update author information in manifest
jans23 Jan 30, 2026
397dd52
additional cleanup on disconnect
DanielPhillip-Solvti Feb 19, 2026
4ede470
fix bad return on create, throw loud error for missing credentials
DanielPhillip-Solvti Mar 12, 2026
26f70b4
remove disconnect on page leave behaviour
DanielPhillip-Solvti Mar 12, 2026
1480cd8
Merge branch '18.0' into livekit_integration_v18
DanielPhillip-Solvti Mar 12, 2026
2b102b5
Refactor track publishing logic into a separate method
DanielPhillip-Solvti Mar 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions mail_livekit/models/mail_rtc_session.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from livekit.api import AccessToken, VideoGrants

from odoo import api, fields, models
from odoo import _, api, fields, models
from odoo.exceptions import UserError
from odoo.tools.misc import str2bool

from odoo.addons.mail.tools.discuss import Store
Expand All @@ -20,7 +21,7 @@ def create(self, vals_list):
result = super().create(vals_list)

if not livekit_params.get("valid"):
return
return result

for session in result:
session._generate_livekit_token(livekit_params)
Expand All @@ -47,6 +48,14 @@ def _get_livekit_config_params(self):
and api_secret.strip()
)

if livekit_enabled and not valid:
raise UserError(
_(
"LiveKit integration is enabled but not properly configured."
" Please check the LiveKit settings."
)
)

return {
"valid": valid,
"enabled": livekit_enabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ patch(CallParticipantVideo.prototype, {
// Subscribe to track rebind events
useExternalListener(this.env.bus, "LIVEKIT:TRACK:REBIND", (event) => {
const {sessionId, identity, type} = event.detail;
if (this.props.identity === identity && this.props.type === type) {
console.log(
if (this.props.identity == identity && this.props.type === type) {
console.debug(
`LIVEKIT:TRACK:REBIND for identity ${identity}, type ${type}`
);
if (sessionId && this.props.session.id !== sessionId) {
Expand Down Expand Up @@ -64,7 +64,7 @@ patch(CallParticipantVideo.prototype, {
const livekitTrack = rtcSession.livekitTracks?.get(type);

if (livekitTrack) {
console.log(
console.debug(
`Attaching LiveKit track for session ${rtcSession.id}, type ${type}`
);

Expand Down
8 changes: 4 additions & 4 deletions mail_livekit/static/src/discuss/livekit_adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class LiveKitAdapter {
}

handleTrackMuted(participantId, source, track, muted) {
console.log("Track muted event:", participantId, source, track, muted);
console.debug("Track muted event:", participantId, source, track, muted);
const type =
source === Source.MICROPHONE
? "audio"
Expand All @@ -82,13 +82,13 @@ export class LiveKitAdapter {

addLivekitListeners() {
livekitService.subscribeToInfoChange("adapter", (info) => {
console.log("received Info change event:", info);
console.debug("received Info change event:", info);
this._emit("info_change", info);
});
livekitService.subscribeToTrackSubscribed(
"adapter",
(participantId, source, track) => {
console.log(
console.debug(
"received Track subscribed event:",
participantId,
source,
Expand All @@ -100,7 +100,7 @@ export class LiveKitAdapter {
livekitService.subscribeToTrackMuted(
"adapter",
(participantId, source, track, muted) => {
console.log(
console.debug(
"received Track muted event:",
participantId,
source,
Expand Down
5 changes: 2 additions & 3 deletions mail_livekit/static/src/discuss/livekit_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const Source = {
SCREEN: window.LivekitClient.Track.Source.ScreenShare,
};

console.log("Livekit Source constants:", Source);

Object.freeze(Source);

let debug = false;
Expand Down Expand Up @@ -79,7 +77,7 @@ class LivekitService {

let audioElement = null;

if (track.kind === "audio") {
if (track.kind == "audio") {
const audioElementId = this._formAudioElementId(participant.identity);
audioElement = document.getElementById(audioElementId);
audioElement?.remove();
Expand Down Expand Up @@ -217,6 +215,7 @@ class LivekitService {
videoCaptureDefaults: {
resolution: VideoPresets.h720.resolution,
},
disconnectOnPageLeave: false,
});

await this.room.prepareConnection(url, token);
Expand Down
18 changes: 9 additions & 9 deletions mail_livekit/static/src/discuss/rtc_livekit_patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ patch(RtcSession.prototype, {

patch(PeerToPeer.prototype, {
async handleNotification() {
console.log("message intercepted");
console.debug("message intercepted");
},

_dataChannelupdateInBroadcast() {
console.log("message intercepted");
console.debug("message intercepted");
},
});

Expand Down Expand Up @@ -75,7 +75,7 @@ patch(Rtc.prototype, {
);
}
if (
eventdata.detail.name === "info_change" &&
eventdata.detail.name == "info_change" &&
Object.keys(eventdata.detail.payload)[0].includes(":")
) {
const fixedIdentity = this.identityToSessionId(
Expand All @@ -89,7 +89,7 @@ patch(Rtc.prototype, {
},

async _handleNetworkUpdates(eventdata) {
console.log("LIVEKIT: Network update received", eventdata);
console.debug("LIVEKIT: Network update received", eventdata);
this.fixEventIds(eventdata);
return super._handleNetworkUpdates(eventdata);
},
Expand All @@ -107,7 +107,7 @@ patch(Rtc.prototype, {
},

async handleSetAudioVolume(eventdata) {
console.log("LIVEKIT: Set audio volume event received", eventdata);
console.debug("LIVEKIT: Set audio volume event received", eventdata);
this.fixEventIds(eventdata);
return this.setAudioVolume(
eventdata.detail.payload.sessionId,
Expand All @@ -116,13 +116,13 @@ patch(Rtc.prototype, {
},

async handleTrackSubscribed(eventdata) {
console.log("LIVEKIT: Track subscribed event received", eventdata);
console.debug("LIVEKIT: Track subscribed event received", eventdata);
this.fixEventIds(eventdata);
if (eventdata.detail.name === "trackSubscribed") {
const {identity, type, track} = eventdata.detail.payload;
const sessionId = this.identityToSessionId(identity);

console.log(
console.debug(
`Track subscribed for session ${sessionId}, type ${type}. Triggering rebind.`
);

Expand Down Expand Up @@ -164,7 +164,7 @@ patch(Rtc.prototype, {
},

async updateUpload() {
console.log("Updating uploads for tracks...");
console.debug("Updating uploads for tracks...");
await this.network?.updateUpload(Source.MICROPHONE, this.state.audioTrack);
await this.network?.updateUpload(
Source.CAMERA,
Expand All @@ -189,7 +189,7 @@ patch(Rtc.prototype, {
return;
}
try {
console.log("Connecting to LiveKit server...");
console.debug("Connecting to LiveKit server...");
await this.network.connect(
this.selfSession.livekit_url,
this.selfSession.livekit_token
Expand Down
Loading