NCTV fork of the livechat plugin.
Go to file
2021-02-20 23:12:12 +01:00
assets The chat is displayed on the right of the video. 2021-02-20 16:31:16 +01:00
client Builtin ConverseJS: 2021-02-20 20:42:41 +01:00
conversejs Rewriting the way ConverseJS is builtin. 2021-02-20 23:12:12 +01:00
documentation/examples Documentation 2021-02-19 19:38:39 +01:00
languages Alpha version. 2021-02-19 18:21:40 +01:00
public/images First commit 2019-07-16 16:39:36 +02:00
.eslintrc.json Adding eslint. 2021-02-20 11:55:00 +01:00
.gitignore Adding eslint. 2021-02-20 11:55:00 +01:00
.npmignore (webpack) adding webpack for dependencies bundling, .gitignore and .npmignore 2019-11-19 17:08:04 +01:00
CHANGELOG.md The chat is displayed on the right of the video. 2021-02-20 16:31:16 +01:00
LICENSE Add license 2019-07-16 17:00:46 +02:00
main.js Rewriting the way ConverseJS is builtin. 2021-02-20 23:12:12 +01:00
package-lock.json Builtin ConverseJS: 2021-02-20 20:42:41 +01:00
package.json Rewriting the way ConverseJS is builtin. 2021-02-20 23:12:12 +01:00
README.md Documentation 2021-02-19 19:57:18 +01:00
webpack.config.js Rewriting the way ConverseJS is builtin. 2021-02-20 23:12:12 +01:00

PeerTube plugin livechat ALPHA VERSION

Work In Progress

Plugin that allows to integrated an iframe with an external webchat application.

This is under development. It is not functional yet.

The webchat has to be setup by your own. For example with a XMPP Server and the ConverseJS Javascript. You will find in this repository example config files to setup this with Prosody, converseJS and nginx. This documentation is Work In Progress.

Settings

There are several options in the plugin settings page.

Automatically open the chat

If checked, the chat will be loaded as soon as you are on the video page.

Activate chat for all lives

The chat will be available for all Peertube Live on your instance.

Activate chat for all non-lives

The chat will be available for all Peertube video that are not live.

Activate chat for specific videos

You can choose some UUIDs for which the chat will be available.

NB: this feature will probably soon disappear. I planned to add a checkbox in each video settings.

Webchat url

You have to speficy here the url for you chat application.

You can add the string {{VIDEO_UUID}} in the url, it will be replaced by the video UUID.

It is possible to use a single chat for all your videos if you omit this parameter.

Example: https://peertube.im.your_domain?room={{VIDEO_UUID}}

Webchat iframe style attribute

You can add some custom styles that will be added to the iframe. For example a custom height:

height:400px;

XMPP backend with ConverseJS

ConverseJS

Once you have a XMPP server that allow anonymous authentication, with bosh (or websocket) enabled, you can - for example - setup a html page that looks like this one. You have of course to replace the path /conversejs/7.0.3 with your converseJS path, and replace your_domain by your actual domain.

NB : there is a bug in the converseJS 7.0.4 release. The dist files don't work. So if you are not building converseJS yourself, use version 7.0.3 instead.

NB: for converseJS to find your server configuration (bosh, websocket, ...), you have to add a file /.well-known/host-meta. Please refer to the converseJS documentation.

XMPP Server: Prosody

You can use Prosody for the XMPP backend.

You can find an example configuration file here.

You have to place this file in /etc/prosody/conf.avail/your_domain.cfg.lua.

Replace peertube.im.your_domain with the domain you want.

Replace admin@im.your_domain with Jabber ids of users that you want to be admin for your server and public chatrooms.

There must be a DNS record for that domain.

NB : no need to have a DNS record for room.peertube.im.your_domain.

To create the certificate, you can use certbot with letsencrypt:

certbot certonly --nginx --emailyour_email -d peertube.im.your_domain

Then:

prosodyctl --root cert import /etc/letsencrypt/live/

Please refer to the Prosody documentation.

NB : if you have not nginx on your server, please replace by the correct parameter.

XMPP over HTTP: nginx

You can use the reverse proxy nginx to server the Prosody Bosh server. So your requests will be on the 443 port, and it will minimise cross domains constraints.

There is an example file here.

NB: this example files also serve the static html files with converseJS.

NB: it is recommanded to change Access-Control-Allow-Origin to something else that "*".