2 questions: Disabling sounds and using session based usernames



  • Hi,

    First off, I am impressed with this product. I was a little bit worried about buying something like this but I am happy now that I did. Thanks.

    I have been able to get the interface working with Stratus and have been able to modify the interface to suit my needs

    http://dev.gigape.com/chat

    I did all this with Adobe Flash Builder, which I got on trial for 60 days. Its a little bit intimidating at first, but you can work through it. My advice is not to delete any of the mxml, but rather use the visible="false" tag to blank out what you don't want to see. You can also edit the css to pretty good effect. I've also moved some of the panels around, which is possible.

    Anyway, 2 issues I can't resolve are as follows:

    1. Sounds

    I don't want the MP3 files to play on connect, disconnect etc

    I've renamed the /jabbercam/media/sounds directory, but this produces an ActionScript error when I load the SWF.

    I can see a useSounds boolean in the AS, but I'd prefer to be able to edit this in PHP somewhere, so that I can change it without have to recompile.

    2. login.php

    I note that I can set the username by simply passing a $_GET['uname'] value to index.html.

    I can't figure out how this works, however.

    What I want is to be able to set the username based on a $_SESSION value in my application. Therefore, what I propose to do is redirect like this:

    index.html?uname=

    However, I don't want users to be able to figure this out, so that they can alter their usernames.

    Any advice on how I could pass a $_SESSION variable into Flash in a way that the user cannot alter?

    G



  • The sounds issue should be addressed a long time ago, we just had such a long list before. At the moment, the best way to get rid of the sounds without actionscript error is to replace the voices with a short or muted sound (using the same name). Ex. you copy the message sound and rename it to welcome.mp3.

    The login.php should work fine, after including it into the project (months ago) we never used it again so please let me take a look at it.



  • @'JabberCam':

    The login.php should work fine, after including it into the project (months ago) we never used it again so please let me take a look at it.

    The login.php is working fine. I'm just trying to figure out how it works, so that a user cannot use it to set a username for themselves. I want their username to be set by my application.



  • The login.php is just a sample for implementing the login into any php script. If you need to include RVC into your own system, use the method found in login.php. More than likely you will have to change the script and instead of using input variables, you'll pass the usernames already in your system (database).

    Your script/page needs a bridge to pass usernames to RVC and the sample for that bridge is the login.php



  • @'JabberCam':

    The login.php is just a sample for implementing the login into any php script. If you need to include RVC into your own system, use the method found in login.php. More than likely you will have to change the script and instead of using input variables, you'll pass the usernames already in your system (database).

    Your script/page needs a bridge to pass usernames to RVC and the sample for that bridge is the login.php

    Actually, from what I can see the ActionScript, there isn't anyway to pass a username to the SWF application other than in the URI.

    var url : String = ExternalInterface.call("function(){" +
    		"return window.location.href;" +
    		"}");
    
    var uname : String = "";
    try {
    	uname = url.match(/uname=(\w{3,})/)[1];
    } catch(e : Error) {
    	uname = "";
    }
    
    

    Based on this, the only way to pass a username is to have your PHP application redirect the user to a specialing formatted URL, which isn't ideal.

    I was thinking of writing the username value as a hidden element value in my HTML, and then having Javascript pick this up.

    eg

    var uname : String = ExternalInterface.call("function(){" +
    		"return document.getElementById('username').value;" +
    		"}");
    
    

    Would that work?



  • If you wish to modify the source that way, yes, it should work. Passing the variables via URI was the easiest method. If you succeed with something more complex (recommended), we would be happy to see it here.



  • @'JabberCam':

    If you wish to modify the source that way, yes, it should work. Passing the variables via URI was the easiest method. If you succeed with something more complex (recommended), we would be happy to see it here.

    Hi, I can confirm that the above method works.

    I use PHP to write a HTML element with the username, from a SESSION variable, and then have Javascript retrieve that value from within the ActionScript.

    Passing the variables via the URI wasn't sufficient for me.

    Firstly, it allows the user to set their own username, which I don't want.

    Secondly, it requires a redirect out of my application, which is messy, as my application has already generated http headers at this point.

    Now, I can run JabberCam as a component of my overall app, rather than as a separate service.

    Can I also ask why Gender, Age etc are commented out of the design in the Partner Video Window?



  • These filters were moved to the "Settings" panel. Thank you for the above post!



  • @'GarrethNBF':

    @'JabberCam':

    If you wish to modify the source that way, yes, it should work. Passing the variables via URI was the easiest method. If you succeed with something more complex (recommended), we would be happy to see it here.

    Hi, I can confirm that the above method works.

    I use PHP to write a HTML element with the username, from a SESSION variable, and then have Javascript retrieve that value from within the ActionScript.

    Passing the variables via the URI wasn't sufficient for me.

    Firstly, it allows the user to set their own username, which I don't want.

    Secondly, it requires a redirect out of my application, which is messy, as my application has already generated http headers at this point.

    Now, I can run JabberCam as a component of my overall app, rather than as a separate service.

    Can I also ask why Gender, Age etc are commented out of the design in the Partner Video Window?

    Hi!
    Would it be to much if I asked you to share what you did to make it work with your existing user database?



  • I have tried this and it works

    var uname : String = ExternalInterface.call("function(){" +
    "return document.getElementById('username').value;" +
    "}");

    What can I add here to so that the user can't access jabbercam if the variable uname is empty

    for example:

    var uname : String = ExternalInterface.call("function(){" +
    "return document.getElementById('username').value;" +
    "}");

    window.location.href="logout.html";


 

Looks like your connection to H7 was lost, please wait while we try to reconnect.