how can I add a button chatbox header section in conversejs?

301 Views Asked by At

I want to stream video to my users while they are chatting. I am wondering what should I do to add a button in the Header Section of the chat panel so that the user can see a video in a modal dialog box when he clicks on the button? I changed the template to add the button- that was not a problem. How can I configure the objects so that I can show the video from my server? I also saw that there is a template called video.html. Can I use this to launch and show my video content? All help will be appreciated.

1

There are 1 best solutions below

3
On BEST ANSWER

You'll have to write your own Converse plugin and then create a new modal instance that extends _converse.BootstrapModal.

Take a look at the RoomDetailsModal as an example of how to do this.

To show the modal, you'll need to add an event handler to the ChatRoomView (or ChatBoxView). For example, here's the handler for the RoomDetailsModal.

If you're doing all of this in your own plugin (as you should), then you should add do all of that in the overrides section of the plugin.