There are 2 options for integrating VideoWhisper scripts with your site:
- Deploy existing turnkey editions (WordPress editions recommended)
- Integrate with your own scripts: Start from plain PHP editions
If you’re using a standard CMS like WordPress, Joomla, Elgg, Moodle, Oxwall, Drupal you can find some ready made integrations to start from, on VideoWhisper.com .
If you don’t have a strict CMS choice yet, VideoWhisper recommends WordPress. WP editions include most advanced and up to date features, maintained by VideoWhisper developers. Also WP is most popular framework, used by over 20% of top internet sites (supported by large community and effective security/feature updates that often lead to project success) .
Integrations for other CMS are mostly developed by 3rd party developers and often require extra work, updates.
All integrations include full php in source form, that can be downloaded for free from the downloads section (after registering a free account).
Integration is not affected by the license. When domain is licensed flash application starts in full mode (without limitations and intrusive ads showing in flash interface).
Integration depends mainly on site developers and site logic. We recommend starting with the simple php editions when integrating with new scripts. If needed apps can be tweaked to call other types of scripts (asp, jsp). Most already include parameters to change external script call path and extension.
VideoWhisper can provide professional integration services, for additional fees after original setup of full mode editions.
ASP, JSP and other script and URL types
Use these SWF parameters for changing script extension and location in calls:
– extension= script extension (ex: .asp or _none_ to use blank when calling url with params)
– prefix= absolute or relative (to swf) path and/or name prefix for scripts
– ws_res= absolute or relative (to swf) path to resources (templates folder)
– ssl=1 to enable SSL licensing mode (over HTTPS) in latest versions
Example:
consultation.swf?extension=.asp
Application will call c_login.asp instead of c_login.php so parameters like username can be sent to application from ASP.
Example from latest WP Live Streaming plugin that uses admin-ajax.php for such requests as per WP coding standards:
$swfurl = plugin_dir_url(__FILE__) . “ls/live_broadcast.swf?ssl=1&room=” . urlencode($stream);
$swfurl .= “&prefix=” . urlencode(admin_url() . ‘admin-ajax.php?action=vwls&task=’);
$swfurl .= ‘&extension=’.urlencode(‘_none_’);
$swfurl .= ‘&ws_res=’ . urlencode( plugin_dir_url(__FILE__) . ‘ls/’);$swfurl = plugin_dir_url(__FILE__) . “ls/live_watch.swf?ssl=1&n=” . urlencode($stream);
$swfurl .= “&prefix=” . urlencode(admin_url() . ‘admin-ajax.php?action=vwls&task=’);
$swfurl .= ‘&extension=’.urlencode(‘_none_’);
$swfurl .= ‘&ws_res=’ . urlencode( plugin_dir_url(__FILE__) . ‘ls/’);
This will call urls like:
https://[your-site.com]/wp-admin/admin-ajax.php?action=vwls&task=vc_login instead of vc_login.php
https://[your-site.com]/wp-admin/admin-ajax.php?action=vwls&task=lb_status instead of lb_status.php
LOGIN / Integrate your members system
Flash applications call scripts ( _login.php : vc_login.php, lb_login.php, r_login.php …) to get start up parameters, user information (grant access), update user status.
These can be integrated as needed with site logic.
In example the login script could check cookies/sessions depending on site authentication type and allow user to access if logged in. Also this could populate username, gender and user permissions depending on user type. Also settings saved somewhere in backend.
Example: vc_login.php for video conference php edition contains output code like this:
firstParameter=fix&server=<?=$rtmp_server?>&serverAMF=<?=$rtmp_amf?>&serverRTMFP=<?=$rtmfp_server?>&p2pGroup=VideoWhisper&enableRTMP=1&enableP2P=0&supportRTMP=1&supportP2P=1&alwaysRTMP=0&alwaysP2P=0&username=<?=urlencode($username)?>&loggedin=<?=$loggedin?>&userType=<?=$userType?>&administrator=<?=$admin?>&room=<?=urlencode($room)?>&welcome=<?=urlencode($welcome)?>&userPicture=<?=$userPicture?>&userLink=<?=$userLink?>&webserver=&msg=<?=urlencode($msg)?>&tutorial=1&room_delete=0&room_create=0&file_upload=1&file_delete=1&panelFiles=1&panelRooms=1&panelUsers=1&showTimer=1&showCredit=1&disconnectOnTimeout=0&camWidth=320&camHeight=240&camFPS=15&micRate=11&camBandwidth=32768&bufferLive=0.1&bufferFull=0.1&bufferLivePlayback=0.1&bufferFullPlayback=0.1&showCamSettings=1&advancedCamSettings=1&camMaxBandwidth=81920&configureSource=0&disableVideo=0&disableSound=0&disableBandwidthDetection=0&disableUploadDetection=0&limitByBandwidth=1&background_url=&autoViewCams=1&layoutCode=<?=urlencode($layoutCode)?>&fillWindow=0&filterRegex=<?=$filterRegex?>&filterReplace=<?=$filterReplace?>&writeText=1&floodProtection=3®ularWatch=1&newWatch=1&privateTextchat=1&ws_ads=<?=urlencode(“ads.php”)?>&adsTimeout=15000&adsInterval=240000&statusInterval=10000&verboseLevel=2&loadstatus=1
How to integrate with common member CMS scripts?
Method 1 : Most cms have some inclusion libraries or bootstrap that can be included in the login.php scripts to access cms api, functions for getting current user or certain module/plugin settings.
(This method is no longer used for popular scripts that require certain url formats.)
In example for Joomla (update JPATH_BASE to reflect location relative to your script):
define( ‘_JEXEC’, 1 );
define(‘JPATH_BASE’, dirname(__FILE__));
define( ‘DS’, DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.’includes’.DS.’defines.php’ );
require_once ( JPATH_BASE .DS.’includes’.DS.’framework.php’ );/* Create the Application */
$mainframe =& JFactory::getApplication(‘site’);/* Make sure we are logged in at all. */
if (JFactory::getUser()->id == 0) die(“Access denied: login required.”);For WordPress (update inclusion to reflect location on wordpress relative to your script):
include_once(“../../../../wp-config.php”);
global $current_user;
get_currentuserinfo();
if ($current_user->$userName) $username=urlencode($current_user->$userName);
Method 2 (MVC): Another solution is to change application call urls to call CMS requests/views instead for frameworks that provide such interface.
For this there are 2 options (you can combine):
1) Change all requests to a different base folder with the base flash embed parameter:
base – [base directory] or [URL]. Specifies the base directory or URL used to resolve all relative path statements in the SWF file. This attribute is helpful when your SWF file is kept in a different directory from your other files.
2) Pass prefix and extension parameters to videowhisper applications. Here it how it was done for Joomla Video Consultation Component:
$swfurl = “components/com_videowhisper_consultation/consultation.swf?room=” . urlencode($this->room_name);
$swfurl .= “&prefix=” . urlencode(“index.php?option=com_videowhisper_consultation&view=flash&format=raw&videowhisper=1&task=”);
$swfurl .= “&extension=_none_”;
$swfurl .= “&ws_res=” . urlencode(“components/com_videowhisper_consultation/”);
With these parameters, instead of calling c_login.php, flash application will call index.php?option=com_videowhisper_consultation&view=flash&format=raw&videowhisper=1&task=c_login
The ws_res parameter tells the application where to look for the resources like templates or emoticons folders.
The flash applications can also be embed in any html pages or templates for 3rd party scripts and some parameters like room name can be passed via a swf parameter like .swf?room=Test . Then flash will call the external scripts like login script where integration can be done as mentioned above.
Details about these calls (including explanations for multiple parameters you can pass) are listed on the php edition pages from VideoWhisper website:
http://www.videowhisper.com/?p=PHP-Video-Recorder-Script
http://www.videowhisper.com/?p=PHP-Live-Streaming
http://www.videowhisper.com/?p=PHP-Video-Conference
http://www.videowhisper.com/?p=PHP-Video-Consultation
http://www.videowhisper.com/?p=PHP-2-Way-Video-Chat
http://www.videowhisper.com/?p=PHP-Video-Messenger-Script
http://www.videowhisper.com/?p=PHP-Video-Live-Support
http://www.videowhisper.com/?p=Admin-Software
ONLINE SESSIONS
The applications can show timer/credits info and also communicate with scripts enabling access/disconnecting users as needed but logic must be implemented by site developers.
This can be used for keeping lists of online users, getting and controlling user time online.
If you want to integrate this functionality in your custom projects see php edition pages and references to the _status.php scripts for each.
Sample: Implementing an online channels list for Live Streaming
The php edition does not use any sql tables so you can easily install it and integrate with a database system of your choice.
You have to build the online channels list same way as it’s done for Joomla and WordPress:
Each broadcaster application calls lb_status.php (about each 10s depending on connection) . You need to add channel name to an online broadcasters table (mysql). If already there update access time to current time. Delete all rows that were not access recently (last 30s) because these users must have disconnected.
Here is how it’s done for wordpress integration:
$s=$_POST[‘s’];
$u=$_POST[‘u’];
$r=$_POST[‘r’];
$m=$_POST[‘m’];$ztime=time();
$sql = “SELECT * FROM $table_name where session=’$s’ and status=’1′”;
$session = $wpdb->get_row($sql);
if (!$session)
{
$sql=”INSERT INTO `$table_name` ( `session`, `username`, `room`, `message`, `sdate`, `edate`, `status`, `type`) VALUES (‘$s’, ‘$u’, ‘$r’, ‘$m’, $ztime, $ztime, 1, 1)”;
$wpdb->query($sql);
}
else
{
$sql=”UPDATE `$table_name` set edate=$ztime, room=’$r’, username=’$u’, message=’$m’ where session=’$s’ and status=’1′”;
$wpdb->query($sql);
}$exptime=$ztime-30;
$sql=”DELETE FROM `$table_name` WHERE edate < $exptime”;
$wpdb->query($sql);This table is used:
CREATE TABLE `$table_name` (
`id` int(11) NOT NULL auto_increment,
`session` varchar(64) NOT NULL,
`username` varchar(64) NOT NULL,
`room` varchar(64) NOT NULL,
`message` text NOT NULL,
`sdate` int(11) NOT NULL,
`edate` int(11) NOT NULL,
`status` tinyint(4) NOT NULL,
`type` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
KEY `status` (`status`),
KEY `type` (`type`),
KEY `room` (`room`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=’Video Whisper: Sessions – 2009@videowhisper.com‘ AUTO_INCREMENT=1 ;”;
Other Integration Topics
Implement Advanced Security with RTMP Session Checking
Playback RTMP Streams with JW Player
Integrating VideoWhisper Applications with other scripts http://t.co/MYCvpFqmxE #authenticate #authorize #bridge
Integrating VideoWhisper Applications with other scripts http://t.co/MYCvpFqmxE #asp #authenticate #authorize
Integrating VideoWhisper Applications with other scripts https://t.co/MYCvpF8LpA #asp #authenticate #authorize