Site icon HTML5chat, free html5 video chat

Messenger mode

Html5 chat has now a new mode : the “messenger” mode

What is the messenger mode chat like ?

The messenger mode like has these features:

How to set up the messenger mode on my site ?

Go to chat admin and choose “Messenger mode”

Make sure you add the script to ANY page where you want the script to be present. A good technique is to use a common page to all you site like inside footer.php

<script src='https://html5-chat.com/script/webmasterid/token'></script>

Replace webmasterid and token by your webmasterid and your token. You can find that inside your chatadmin panel

How to pass user parameters to the chat ?

If you just use the script like, you user is not identified by the chat: he will need to input his username and will be assigned a random id and random avatar.
If you want to specify an username, id and avatar, you need to pass some extra parameters to the script. Use JWT to encode these parameters and pass them to the chat as shown in this sample:

<?php
$json = json_encode(array(
        'id'        =>xxx,
        'username'  =>'yourUsername',
        'password'  =>'password of your html5-chat account',
        'avatar'    =>'https://html5-chat.com/img/malecostume.svg'
));
$encoded = file_get_contents("https://jwt.html5-chat.com/protect/".base64_encode($json));
?>
 <script src='https://html5-chat.com/script/webmasterid/$encoded '></script> 

You should test the demo, with 2 browsers.

Exit mobile version