Plugin Generate App TURN/STUN Support Request Install

“Live Stream Add-on For Playtube” Documentation by “Vanea Young” v1.1.26 [12.05.2022]


“Live Stream Plugin For Playtube”

Created: 22/06/2022
By: Vanea Young
Support: Help Desk
Version: v1.0 [22/06/2022]

Thank you for purchasing my item. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

How to install Guide

Attach the plugin to Playtube.
Step 1
Copy all the files & folders from Plugin folder to your /public_html/ directory where is located your playtube files.

[assets]
[vy-livestream]
[themes]
*vy-livestream-cmd.php

Step 2
If you use apache, Open your .htaccess file, and find the code from below.

RewriteCond %{REQUEST_FILENAME} !-d

After this add the following code.

# Live Plugin
RewriteRule ^livestream$ vy-livestream-cmd.php [QSA]
RewriteRule ^watchstream$ vy-livestream-cmd.php?cmd=watchstream [QSA]
Redirect 301 /live /livestream
RewriteRule ^livestream/g/([^\/]+)(\/|)$ vy-livestream-cmd.php?group_id=$1 [NC,QSA]
RewriteRule ^livestream/p/([^\/]+)(\/|)$ vy-livestream-cmd.php?page_id=$1 [NC,QSA]
RewriteRule ^livestream/up$ vy-livestream-cmd.php?cmd=blueimpupload [NC,QSA]
RewriteRule ^livestream/u/(.*)$ vy-livestream-cmd.php?cmd=openuser&id=$1 [NC,QSA]

If you use nginx, Open your nginx.conf file, and add the code from below.

# Live Plugin
location = /live { return 301 /livestream; } 
rewrite ^/livestream$ /vy-livestream-cmd.php;
rewrite ^/watchstream$ /vy-livestream-cmd.php?cmd=watchstream;
rewrite ^/livestream/g/([^\/]+)(\/|)$ /vy-livestream-cmd.php?group_id=$1;
rewrite ^/livestream/p/([^\/]+)(\/|)$ /vy-livestream-cmd.php?page_id=$1;
rewrite ^/livestream/up$ /vy-livestream-cmd.php?cmd=blueimpupload;
rewrite ^/livestream/u/(.*)$ /vy-livestream-cmd.php?cmd=openuser&id=$1;

Step 3
Open your playtube container.phtml file. You can find it here:

 /themes/YOUR_THEME/layout/container.html

Go to end of file.. and above of below code:

   </body>
</html>

Add this code:


	<?php 
	  if (IS_LOGGED == true) {
	    // Live stream plugin
	    include(getcwd().'/vy-livestream/assets.html');
	  } else {
	  ?>
	  <Script>
	  function vy_global_openLiveStream(ev,el,id,no_loading){

	    ev.preventDefault();
	    ev.stopImmediatePropagation();
	    return $('[data-target="#loginbox"]').trigger('click');
	  }
	  </Script>
	  <?php
	  }
	  ?>
	

Step 4
Open file /assets/init.php and add the following line of code at the end of the file:
// include Live stream
if( file_exists(getcwd().'/assets/vaneayoung/LiveStream/classes/class.LiveStream.php'))
require_once('vaneayoung/LiveStream/classes/class.LiveStream.php');

Step 5 (optional) [settings]
Go to /assets/vaneayoung/LiveStream/ini/config.ini file, and add your settings:

;<?php die('Direct access not allowed ;') ?>
;The above is for security, do not remove

[purchase code]
st__PURCHASE_KEY = YOUR_PURCHASE_KEY

[THEME]
st__ORIGINAL_THEME_NAME = "youplay";  


[TIMEZONE]
timezone = "Europe/Berlin"

[playtube tables]
tbl_users 		=	"`users`";
tbl_comments 		= 	"`comments`";
tbl_notif 		= 	"`notifications`";
tbl_posts 		= 	"`videos`";

[plugin tables]
tbl_vy_lv_broadcasts 	= 	"`vy_live_broadcasts`"
tbl_vy_lv_config 	=	"`vy_live_conf`"

[server url]
st__APP_SERVER_URL = ""; # your domain name where running nodejs application

[plugin location]
st__PLUGIN_ASSETS = "/vy-livestream" ;

[default blank cover]
st__DEFAULT_BLANK = "/vy-livestream/blank.png";

[ffmpeg]
st__ffmpeg_path = "/usr/bin/ffmpeg"; # define ffmpeg location [ $ whereis ffmpeg ]

[sounds]
st__success = "sounds/success.mp3";
st__countdown2 = "sounds/countdown2.mp3";
st__countdown = "sounds/countdown.mp3";
st__clickuibut = "sounds/clickuibut.mp3";
st__openpopup = "sounds/openpopup.mp3";

[storage]
st__STORAGE_DIR = "upload/vy-streams-media"; # the path where to save all the broadcast records
st__recording = 1; # record bool true|false
st__record_type = ".mp4"; # allowed format > [.mp4 or .webm], record video format webm or mp4 [this is only for local device streaming not for OBS]
st_mp4_high_quality = 0; #  this only works if record_type option is set to .mp4 value,
		             # if you enable this to true the video size will increase x4, 
			     # for example a 1 minute video size will be almost 100MB


[settings]
st__obs_enabled = 1; # OBS ENABLED TRUE / FALSE
st__away_desktop = 0; # IF USER STREAMING FROM PC (DESKTOP) enable disable Away feature ( by default away feature is enabled only for mobiles )
st__audioBitsPerSecond = 128000; # AUDIO BITS PER SECOND
st__videoBitsPerSecond = 2500000 ;# VIDEO BITS PER SECOND
st__fr_miliseconds = 1000 ;# the number of milliseconds to record into each Blob
st__stream_secret = "nodemediavylivestream2022" # stream secret, any word
st__stream_prefix = "VY" #  stream key prefix
st__app_name = "live"; # define app name, you can leave it as default
st__hls = true; # hls bool true/false
st__hlsFlags = "[hls_time=2:hls_list_size=3:hls_flags=delete_segments]"; # hls options
st__dash = true; # dash bool true/false
st__dashFlags = "[f=dash:window_size=3:extra_window_size=5]"; # dash options
st__mp4Flags = "[movflags=faststart]"; # mp4 options 

Step 6
Please go to folder cr_turnserver, open file turnserver.json and populate these 3 lines:
      {
         "urls":"turn:YOUR_TURN_SERVER_URL:PORT", 
         "username":"YOUR_TURN_SERVER_USERNAME", 
         "credential":"YOUR_TURN_SERVER_CREDENTIAL" 
      }

Step 7
Now please go to your phpmyadmin and upload the SQL file
database.sql 

Step 8
The last step, you have to go to https://liveplugin.kontackt.de/setup.html and complete all the fields to get your Nodejs Application Server directly via your email.
https://liveplugin.kontackt.de/setup.html

STUN/TURN SERVER CONFIGURATION.
We Recommend to configure your own STUN/TURN SERVER, to do this you must run at least VPS.

Full Documentation URL: https://www.webrtc-experiment.com/docs/TURN-server-installation-guide.html#top