Jump to content

JWT: a quicker and simpler version using the HTML5 service


chat5html

6,143 views

 Share

The example below is written in PHP, but it can be easily adapted for use in JavaScript or ASP, if necessary.

Let's assume your TOKEN is 12134234, and your account ID is 1.

Step 1: Create an array representing your user as follows:

 

$json = json_encode(array(
 'password'=> $token,
 'id_account'=> $id_accoun,
 'username'=> $name,
 'gender'=> $gender,
 'role'=> $role,
 'birthyear'=> $age,
 'profile_link'=> "$get_profile",
 'immage_user'=> $fotoDef,
 'room_id'=> ''
));

Fill in all the variables with your data, for example:

$token = '12134234';
$id_accoun = 1;
$name = 'tommy';
$gender = 1;
$role = 'user';
$age = '33';
$get_profile = 'https://www.html5-videochat.com/index.php?/profile/1-chat5html/';
$fotoDef = 'https://www.html5-videochat.com/uploads/monthly_2023_11/logo_a.thumb.png.0a576758854862896fbf8c6f8e6a1f94.png';

$json = json_encode(array(
 'password'=> $token,
 'id_account'=> $id_accoun,
 'username'=> $name,
 'gender'=> $gender,
 'role'=> $role,
 'birthyear'=> $age,
 'profile_link'=> "$get_profile",
 'immage_user'=> $fotoDef,
 'room_id'=> ''
));

Step 2 : you encode it using the html5 JWT online service

$encoded = file_get_contents("https://www.html5-videochat.com/applications/chat_webcam_personale/crypt.php/?code_crypt=".base64_encode($json));

Step 3 : Get all links inside an iframe

    <style>
    body, html {
      margin: 0;
      padding: 0;
      height: 100%;
      width: 100%;
      font-family: Arial, sans-serif;
      overflow: hidden;
    }

    #container {
      display: flex;
      flex-direction: column;
      height: 100%;
    }
#header iframe {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: none;
}

 


    #header {
      height: 40px;
      width: 100%;
      background-color: #ffffff;
      border-bottom: 1px solid #ccc;
      background-image: url(https://1.bp.blogspot.com/-GcoS_cvHRy4/VSeF66WGJ7I/AAAAAAAACKU/XDhKDPJprjU/s1600/12.gif);

    }

    #content {
      flex-grow: 1;
      width: 100%;
    }

    #iframeChat {
      width: 100%;
      height: 100%;
      border: none;
    }
  </style>
 

   <div id="container">
     <div id="header" style="display: none;">
      <!-- Contenuto dell'intestazione, incluso l'iframe -->

     </div>
    <div id="content">
      <iframe   id="iframeChat"  width="100%" height="100%" src="https://www.html5-videochat.com/index.php?/chat/$encoded" allowfullscreen="" allow="geolocation; microphone; camera; allowfullscreen; autoplay;" ></iframe>
 
   </div>
  </div>

 

Step 4 : The post variable is inserted to enter the profile-show chats through the widgets.

$profile_id_show_room_request = $_POST[id_room_show];

 

And that’s ALL:

role: can be adminsupremoadmin, moderatorpremiumuser, ospitedeejay, custom1, custom2

profile: the link to the user profile (if available)

startRoom : the id of the room where to start in (room_id is an integer number)

Gender: 

id=1 (Male)

id=2 (Female)

id=3 (Couple)

 

Get user in room, global or single

Global;

Use the name_user_global variable to see the complete list of users inside the rooms

https://www.html5-videochat.com/index.php?/pca/info_user_chat/&id_account=1&name_user_global=true

 

For the global number of users use the num_user_global variable

https://www.html5-videochat.com/index.php?/pca/info_user_chat/&id_account=1&num_user_global=true

 

Single;

Use the name_user_room variable to see the complete list of users inside the rooms

https://www.html5-videochat.com/index.php?/pca/info_user_chat/&id_account=1&roomId=0&name_user_room=true

 

For the global number of users use the num_user_room variable

https://www.html5-videochat.com/index.php?/pca/info_user_chat/&id_account=1&roomId=0&num_user_room=true

 

Use your variable;

 id_account; - your account id, e.g. 1

 roomId; - room id e.g. 12

example web page html

 

<?php 
$token = '12134234';
$id_accoun = 1;
$name = 'tommy';
$gender = 1;
$role = 'user';
$age = '33';
$get_profile = 'https://www.html5-videochat.com/index.php?/profile/1-chat5html/';
$fotoDef = 'https://www.html5-videochat.com/uploads/monthly_2023_11/logo_a.thumb.png.0a576758854862896fbf8c6f8e6a1f94.png';
$id_room = ''; //Insert the room ID that will be opened by default or leave the field blank. 

if($id_room === ''){
 $id_room = $_POST[id_room_show];;
}

$json = json_encode(array(
 'password'=> $token,
 'id_account'=> $id_accoun,
 'username'=> $name,
 'gender'=> $gender,
 'role'=> $role,
 'birthyear'=> $age,
 'profile_link'=> "$get_profile",
 'immage_user'=> $fotoDef,
 'room_id'=> $id_room
)); 
$encoded = file_get_contents("https://www.html5-videochat.com/applications/chat_webcam_personale/crypt.php/?code_crypt=".base64_encode($json));

?>

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="keywords" content="videochat, my siteweb, chat online, comunicazione">
  <meta name="description" content="Videochat su my siteweb">
  <meta property="og:site_name" content="my siteweb">
  <meta property="og:locale" content="it_IT">
  <meta property="og:type" content="website">
  <meta name="twitter:card" content="summary_large_image" />
  <title>my siteweb Videochat</title>
  <link rel="icon" href="favicon.ico" type="image/x-icon">
  <style>
    body, html {
      margin: 0;
      padding: 0;
      height: 100%;
      width: 100%;
      font-family: Arial, sans-serif;
      overflow: hidden;
    }

    #container {
      display: flex;
      flex-direction: column;
      height: 100%;
    }
#header iframe {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: none;
}

 


    #header {
      height: 0px;
      width: 100%;
      background-color: #ffffff;
      border-bottom: 1px solid #ccc;
      background-image: url('');
      border: none;
    }

    #content {
      flex-grow: 1;
      width: 100%;
    }

    #iframeChat {
      width: 100%;
      height: 100%;
      border: none;
    }
  </style>
</head>
<body>
  <div id="container">
     <div id="header">
      <!-- Contenuto dell'intestazione, incluso l'iframe -->
          <iframe id="myIframe" src="https://www.example.com" scrolling="no"></iframe>
     </div>
    <div id="content">
      <iframe   id="iframeChat"  width="100%" height="100%" src="https://www.html5-videochat.com/index.php?/chat/<?php $encoded ?>" allowfullscreen="" allow="geolocation; microphone; camera; allowfullscreen; autoplay;" ></iframe>
    </div>
  </div>
  

</body>
</html>

 

For any issues you may encounter, please feel free to reach out to us using the contact form here or via email at [email protected]. We provide top-notch support.

 

 Share

0 Comments


Recommended Comments

There are no comments to display.

×
×
  • Create New...