---slug: /guides/video/extending-rooms-with-custom-codesidebar_position: 3---# Extending Rooms with Custom CodeIf you are using [video rooms with UIincluded](../creating-a-video-room/index.mdx), you dont need to write code: youget a basic video conference out-of-the-box. However, this doesnt stop you incase you need additional control via code. Lets see how.## Obtaining a reference to the RoomSessionThe code snippet that you copy from your SignalWire Space looks like this:htmlNotice how the final part of the snippet is a call which takes a set ofparameters that you can use to initialize the room session. Find the full listof parameters in the[documentation](sdks/reference/video-conference-appkit/index.mdx).Here we are interested in the setupRoomSession parameter: this is a callbackwhich will be invoked when a [RoomSession][roomsession] object is ready. Thisnormally happens right before the room is joined.html## Using the RoomSession objectOnce you obtained the reference to the [RoomSession][roomsession] object, youcan start subscribing to events and performing actions.Say we want to mute the user as soon as they join the room. First, we wouldsubscribe to the[room.joined](sdks/reference/browser-sdk/video/video-roomsession.mdx#roomjoined)event, which will trigger right after the room has been joined. Then, we wouldinvoke the[videoMute](sdks/reference/browser-sdk/video/video-roomsession.mdx#videomute)method to mute the local user. For example:html## Wrap upIn video rooms with prebuilt UI, you can use the setupRoomSession parameter toaccess the underlying API which gives you full control on the room. Use it tosubscribe to events or to perform actions in the room.If, instead of a widget, you require a more advanced control on the room (such as a custom UI,or a custom authentication mechanism), take a look at [First steps withVideo](../video-first-steps.mdx). It will show you how to write a custom videoapplication from scratch using our lower level APIs.[roomsession]: sdks/reference/browser-sdk/video/video-roomsession.mdx