proud-lawyer-39815
03/24/2026, 3:10 PMtall-airline-16756
03/24/2026, 3:10 PMtall-airline-16756
03/24/2026, 3:11 PMMediaElementAudioSourceNode and route it to a MediaStreamAudioDestinationNode.
c. Take the MediaStream from the destination node and publish it to LiveKit as an audio track.
◦ This is the common method for streaming music files (including MP4) into a WebRTC session.
• Use server-side/local playback (agents or background player):
◦ The BackgroundAudioPlayer can decode MP4 (FFmpeg-backed) and play it for publishing/processing.
◦ For recording/egress, LiveKit supports MP4 as an output container (e.g., startRoomCompositeEgress, startTrackCompositeEgress, startWebEgress) — if you need to export sessions or tracks as MP4.
If you want, tell me:
• Are you trying to play an MP4 from a public URL in the browser, or from a file on the server/device?
• Is your goal to stream live into a room, or to record/export the session as MP4?
Tell me which case applies and I’ll give step-by-step guidance or code snippets for that path.
Sources: server-sdk-js | livekit/livekit_composite | DeepWiki | Universal Egress | LiveKit | Stream music over WebRTC using React and WebAudio | LiveKit | Agent speech and audio | LiveKit Documentation, with interactive elements