```
Later, we will put click handlers on the start and stop buttons to call [`startStream`](/docs/browser-sdk/v3/js/reference/video/room-session/start-stream) and [`stopStream`](/docs/browser-sdk/v3/js/reference/video/room-session-stream#stop) respectively. The [`startStream`](/docs/browser-sdk/v3/js/reference/video/room-session/start-stream) function is available on the Room Session object, so first we need to use the [`setupRoomSession`](/docs/platform/video) callback function on the PVC to get that object. So, the `VideoConference` constructor at the end of the embed script should look like this:
```js
SignalWire.AppKit.VideoConference({
token: "vpt_40b...458",
setupRoomSession: setRoomSession,
});
```
We can then access `setRoomSession` in the external JavaScript file and use the Room Session object returned to set event listeners and click handlers. The JavaScript file will look something like this:
```js
let roomSession;
let stream;
const stopStream = () => {
if (stream) {
stream.stop();
}
};
const setRoomSession = (session) => {
roomSession = session;
roomSession.on("room.left", () => {
stopStream();
});
};
document.addEventListener("DOMContentLoaded", () => {
document.getElementById("rtmp-form").onsubmit = async (e) => {
e.preventDefault();
const url = document.getElementById("stream-url").value;
try {
stream = await roomSession.startStream({ url });
} catch (error) {
console.log(error);
alert(
"There was an error starting the stream. Please check your URL and try again."
);
}
};
document.getElementById("stop").onclick = (e) => {
e.preventDefault();
try {
stopStream();
} catch (e) {
console.log(e);
}
};
});
```
The full demo application has some cosmetic additions, but these two files are all you need to get an RTMP outbound stream set up from any application with an embedded PVC. You should be able to see your stream in the streaming service within a few seconds of pressing "Start Stream".
While this demo used a PVC, you can use the same methods on a video room without the prebuilt UI. For a complete guide on building video rooms without a prebuilt UI, see the [build a video application](/docs/browser-sdk/v3/js/guides/build-a-video-app) guide. From there, you can add start and stop stream buttons and hook them up in the same way as above.
# Wrap up
We showed the options to configure an RTMP stream that allows you to stream the content of your video room to any compatible streaming service: the Dashboard UI, a POST request, or an SDK application is all you need.
# Resources
* [API Streams Reference](/docs/apis/video/streams/list-room-streams)
* [SDK Streaming Demo](https://github.com/signalwire/guides/tree/main/Video/RTMP-Streaming)
* [SDK Streaming Reference](/docs/browser-sdk/v3/js/reference/video/room-session-stream)
* [PVC Reference](/docs/platform/video)