PHP 2 Way Video Chat

VideoWhisper > 2 Way Video Chat > PHP Stand Alone

2 Way Video Chat Script : Instant One on One HD Video Conferencing

1 On 1 Video Chat Script
  • Create private video chat rooms
  • Share room link
  • Quick access: fill name and enter
  • Easy to Install
  • Simple setup
  • Highly customisable
  • Full PHP source code
  • Easy to Integrate

PHP 2 Way Video Chat edition can be used for quick stand alone setup and fast integration with php sites and projects.

Find on this page:

Demo

Enter 2 Way Video Chat Script Demo

On the simple php demo you'll be able to create an instant one on one video chat room, get the invite link and enter video chat to wait for the other person to join.

Installation Instructions for PHP 2 Way Video Chat

Before installing, make sure your hosting environment meets all requirements.

  1. If you're not hosting RTMP with us go to RTMP Application Setup for installation details.
  2. Download PHP Stand Alone zip and copy contents of 2wvc_php inside to your web installation location. (Example: www.yoursite.com/videochat/)
  3. Fill your RTMP path into settings.php as $rtmp_server .
  4. Get a RTMFP path (i.e. by registering for a free developer key from Adobe Stratus ) and fill into settings.php as $rtmfp_server .
  5. If you don't use suPHP, enable write permissions 0777 for folder "uploads" where scripts will save logs and snapshots.
Customizations
  • Edit skins, icons, logo, background, sounds, video panel backgrounds & masks in templates/2wvc .
  • This can be integrated with your members database and login system. Variables like username, loggedin (1 if user was logged in and allowed to enter, 0 otherwise), welcome message, streaming settings are passed from 2_login.php :
    • Custom skin for session:
      &templateFolder=2wvc (folder from templates folder)
      &imageLogo=logo.png - relative to template folder
      &imageBackground=background.jpg - relative to template folder
      For absolute image paths, different domains must have a crossdomain policy.
    • servers:
      server=<?=$rtmp_server?>&serverAMF=<?=$rtmp_amf?>&serverRTMFP=<?=$rtmfp_server?>
      &serverProxy=best : "none", "HTTP", "CONNECT", "best"
      To use native SSL, set the property to "best". If the player cannot make a direct connection to the server (over the default port of 443 or over another port that you specify) and a proxy server is in place, the player tries to use the CONNECT method. If that attempt fails, the player tunnels over HTTPS.
      If the property is set to "HTTP" and a direct connection fails, HTTP tunneling is used. If the property is set to "CONNECT" and a direct connection fails, the CONNECT method of tunneling is used. If that fails, the connection does not fall back to HTTP tunneling.
      This property is applicable only when using RTMP, RTMPS, or RTMPT. The CONNECT method is applicable only to users who are connected to the network by a proxy server.
    • user login and room:
      &room=<?=urlencode($room)?> - landing room
      &welcome=<?=urlencode($welcome)?> - welcome message to show in chat box
      &username=<?=$username?> - avoid special characters as this is used in file system (screenshots)
      &msg=<?=$message?> - message to show if login is denied
      &loggedin=<?=$loggedin?> - 1 if login is permitted
    • enable credits / time limitations (session control is done with 2_status.php script):
      &showTimer=1&showCredit=1&disconnectOnTimeout=0
    • allow P2P/Server video streaming:
      &enableP2P=1&enableServer=1
    • configure streaming settings:
      &camWidth=320&camHeight=240&camFPS=15 - default cam resolution
      &camBandwidth=40960&showCamSettings=1&camMaxBandwidth=81920 - bandwidth settings for video
      &silenceLevel=0&silenceTimeout=0&micGain=50
    • H264 codec settings: &videoCodec=H264&codecProfile=main&codecLevel=3.1
      videoCodec: H264 / other value uses default codec
      codecProfile: baseline/main for H264
      codecLevel: 1, 1b, 1.1, 1.2, 1.3, 2, 2.1, 2.2, 3, 3.1, 3.2, 4, 4.1, 4.2, 5, 5.1 for H264
    • sound codec settings: &soundCodec=Speex&soundQuality=9&micRate
      soundCodec: Speex/Nellymoser
      micRate: 11/22/44 for Nellymoser
      soundQuality: 0-10 for Speex
    • Push to Talk / Silence to Talk features to prevent echo / moderate discussion:
      &pushToTalk=1 - broadcasts sound only when button is clicked (kept pressed) or Down arrow on keyboard pressed while focus (click chat first)
      &silenceToTalk=1- silences other participant during talk
    • enable/disable text chat and buttons:
      &showTextChat=1&sendTextChat=1
      &configureConnection=1&configureSource=1&enableNext=1
      &enableBuzz=1&enableSoundFx=1&requestSnapshot=1
    • interface items:
      &enableButtonLabels=1&enableFullscreen=1&enableSwap=1&enableLogout=1&enableLogo=1&enableHeaders=1&enableTitles=1
    • configure video panels and interface item positions:
      &videoW=480&videoH=365&video2W=480&video2H=365&layoutCode=<?=urlencode($layoutCode)?>
      To get layout code items, just open chat and send "/videowhisper layout" message using chat box.
    • configure buffering:
      &bufferLive=0.5&bufferFull=0.5&bufferLivePlayback=0.2&bufferFullPlayback=0.5
    • text filtering i.e. bad words:
      &filterRegex=<?=$filterRegex?>&filterReplace=<?=$filterReplace?>
    • disable emoticons (faster loading):
      &disableEmoticons=0
      disabling emoticons will replace emoticons chat with standard html text area that loads css styles from templates/2wvc/styles.css and standard text copy
    • &verboseLevel=4 //verboseLevel (higher reports more to user): 0 = Nothing, 1 = Failure, 2 = Warning / Recoverable Failure, 3 = Success, 4 = Action . At least 1 or 2 is recommended to spot any issues.
    • configure automated snapshots:
      &autoSnapshots=1&snapshotsTime=20000
    • &adServer=<?=urlencode('2_ads.php')?>&adsInterval=600000&adsTimeout=20000 Display ads right inside text chat
      Setup adsInterval in milliseconds (0 to disable ad calls), adsTimeout to setup time in milliseconds until first ad is shown. Also see AD in Chat compatible ad management server.
  • Sessions are reported and can be controlled from 2_status.php (see comments in file for details)
    POST Variables:
    u=Username
    s=Session, usually same as username
    r=Room
    ct=session time (in milliseconds)
    lt=last session time received from this script in (milliseconds)

    $maximumSessionTime=0; //900000ms=15 minutes (in free mode this is forced)
    $redirect_url=urlencode(""); //disconnect and redirect to url
    $disconnect=urlencode(""); //disconnect with that message to standard disconnect page
    $message=urlencode(""); //show this message to user
    $send_message=urlencode(""); //user sends this message to room
    $next_room=urlencode(""); //user is moved to this room

  • Edit logout page 2_logout.php
  • Edit emoticons list and mappings in emoticons/emoticons.xml
  • Edig text chat loggin in vc_chatlog.php
  • Edit snapshot publishing in vc_snapshots.php
  • This application can be configured to load other script extensions by swf parameters. Example: For using .cfm scripts edit 2wvideochat.php and change $swfurl="2wvc.swf" to $swfurl="2wvc.swf?extension=.cfm";
  • Implement a NEXT button functionality from 2_next.php :
    • $redirect_url=urlencode(""); //disconnect and redirect to url
    • $disconnect=urlencode(""); //disconnect with that message to standard disconnect page
    • $message=urlencode("Next button pressed. This feature can be programmed from 2_next.php or disabled from 2_login.php parameters. $chatlog"); //show this message to user
    • $send_message=urlencode("I pressed next."); //user sends this message to room
    • $next_room=urlencode($next_room); //user moves to this room
  • Translate to any language (or multiple with php scripting) with translation.php:
    Just type "/videowhisper translation" in chat to get current translation xml in your clipboard.
    Only texts that were used during current session will be listed - if you encounter new messages get translations list again for updates.
  • Implement web server based text chat filtering or other operations (like translation API integrations) using chatfilter.php after enabling from 2_login.php with webfilter=1
  • Certain functions in the flash can be triggered from javascript (next, snapshot, snapshot_self, buzz, p2p_toggle):

<SCRIPT language="JavaScript">
//the code below allows activating certain functions from javascript

function getFlashMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
//alert("IE");
if (typeof (window[movieName].videowhisperToActionscript) == 'function') {
// alert("< IE9");
movie = window[movieName];
}
else if (typeof (document[movieName].videowhisperToActionscript) == 'function') {
// alert(">= IE9");
movie = document[movieName];
}
}
else {
// alert("NON IE");
movie = document[movieName];
}

return movie;
}

//flash = flash html object name (ie "videowhisper_chat")
//action = next / snapshot / snapshot_self / buzz / p2p_toggle
function videowhisperCallActionscript(flash, action)
{
var movie = getFlashMovie(flash);
if (movie == null || movie == undefined) window.alert("Flash element not found:" + flash + " :" + movie);
else movie.videowhisperToActionscript(action);
}
</SCRIPT>

<object id="videowhisper_chat" width="1000" height="700" type="application/x-shockwave-flash" data="<?=$swfurl?>">
<param name="movie" value="<?=$swfurl?>" /><param name="bgcolor" value="<?=$bgcolor?>" /><param name="salign" value="lt" /><param name="scale" value="noscale" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /> <param name="base" value="<?=$baseurl?>" /> <param name="wmode" value="<?=$wmode?>" />
</object>

Add a link like:
<a href="JavaScript: videowhisperCallActionscript('videowhisper_chat','buzz');">Buzz!</a>

Details, Forums, Downloads

Order Now!   Instant 100% web based video communications for your business. WELCOME TO THE NEXT LEVEL!