Welcome, Guest
  • Author Topic: Re:private chat with video  (Read 33823 times)

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:private chat with video
    « on: 03/05/04, 12:00 »
    Hi Sam, welcome to the Boards !

    I didn't add Video because people tend to abuse of this feature, and two private windows with video means 4 streaming (2 per user) You will reach your bandwith limit (based on your license) very fast, so I don't think a video-chat is something possible whitout a proffesional license and alot of bandwidth transfer (imposed also by your hosting provider).
    Anyway, in the examples folder of your FlashCom installation, there are a couple of apps that use the video streaming feature, check it. Perhaps in the near future I will add a one-to-one video conference app based on Flashcom.

    Jorge

    gaby

    • Moderator
    • Seasoned Programmer
    • *****
    • Posts: 241
    • To code or not to code
      • View Profile
    Re:private chat with video
    « Reply #1 on: 03/06/04, 04:49 »
    yep here is the code to add in the main movie, on the frame labelled main:

    function pubLive()
    {
       myCam = Camera.get()
       myCam.setQuality(8192,80);
       myCam.setMode("160", "120", "4");
       srcStream = new NetStream(client_nc);
       srcStream.publish(_root.exp, "live");
       srcStream.attachVideo(myCam);
       my_video2.attachVideo(myCam);
       
       //myMic = Microphone.get();
       //srcStream.publish(_root.exp, "live");
       //srcStream.attachAudio(myMic);
       
    }
    function unpubLive()
    {
       //srcStream.attachAudio(null);
       //unloadMovie(_root.my_videodest);
       srcStream.close();
    }

    function disconnect() {

       // Stops publishing the stream.
       destStream.close();
       
       // Deletes the source stream connection.
       client_nc.close();
    }
    //PUBLICATION
    pubLive();

    stop();

    //this is for your camera, dont forget to add a video display element called my_video2

    Now on the new room MC, put this code on the first frame

       //LECTURE
    this.attachMovie("my_video","my_videodest",599,{_x:225, _y:0});
    dstStream = new NetStream(_root.client_nc);
    dstStream.play(guest); (WHERE GUEST IS THE PERSON U R TALKING TO IN PRIVATE
    this.my_videodest.my_video.attachVideo(dstStream);
    //my_audio.attachAudio(dstStream); //U can also add audio but it uses a lot of bandwidth...
    //DONT FORGET TO ADD A VIDEO ELEMENT LABELED my_video

    if anyone see things that can be optimized, that would be cool :-)

    enjoy (you can see it live here: http://www.kinky-mistress.com/ ) register and see..take care, this site is for adults only....
    The courage to begin is the main step to achievement

    gaby

    • Moderator
    • Seasoned Programmer
    • *****
    • Posts: 241
    • To code or not to code
      • View Profile
    Re:private chat with video
    « Reply #2 on: 03/07/04, 15:40 »
    please answer on the forum so everyone can benefit of what's said here...
    so to give you more details

    the functions below create a stream to publish your own camera on the server, and to display it into a video object labelled my_video2...

    note that you have to transmit a variable name "exp", that will be the name for the stream

    function pubLive()
    {
      myCam = Camera.get()
      myCam.setQuality(8192,80);
      myCam.setMode("160", "120", "4");
      srcStream = new NetStream(client_nc);
      srcStream.publish(_root.exp, "live"); //this line tell your movie to publish a live stream named by the variable "exp" transmitted
      srcStream.attachVideo(myCam);
      my_video2.attachVideo(myCam);//this display your cam on a my_video2 object
     
      //myMic = Microphone.get();//you can uncomment this to add audio stream
      //srcStream.publish(_root.exp, "live");
      //srcStream.attachAudio(myMic);
     
    }
    function unpubLive()
    {
      //srcStream.attachAudio(null);
      //unloadMovie(_root.my_videodest);
      srcStream.close();
    }

    function disconnect() {

      // Stops publishing the stream.
      destStream.close();
     
      // Deletes the source stream connection.
      client_nc.close();
    }
    //PUBLICATION
    pubLive();

    stop();

    have this work before you try the second part, which must be placed in the "newroom" movie:

     //LECTURE
    this.attachMovie("my_video","my_videodest",599,{_x:225, _y:0});
    dstStream = new NetStream(_root.client_nc);
    dstStream.play(guest); (WHERE GUEST IS THE PERSON U R TALKING TO IN PRIVATE
    this.my_videodest.my_video.attachVideo(dstStream);
    //my_audio.attachAudio(dstStream); //U can also add audio but it uses a lot of bandwidth...
    //DONT FORGET TO ADD A VIDEO ELEMENT LABELED my_video

    u can make a "trace(guest); to check it's value (which is supposed to be the same name of a stream that is published), so check also in your flash com admin what is the name of the stream publishing the video.

    so if you just take care of the 2 variables "guest" and "exp", this script is supposed to work like this...by the way i'm not publishing my version yet, as i'm doing an admin interface that would allow to kick/ban users....if somebody as any clues to give me, that would help...thx :-)
    The courage to begin is the main step to achievement

    gaby

    • Moderator
    • Seasoned Programmer
    • *****
    • Posts: 241
    • To code or not to code
      • View Profile
    Re:private chat with video
    « Reply #3 on: 03/11/04, 08:59 »
    go in your flash com admin to see the names of actual streams...open a second chat window with another user name...start a private conversation with the user that stream the video, and it should work..sorry i won't post fla until it's finished, as there are still many bugs in it
    The courage to begin is the main step to achievement

    gaby

    • Moderator
    • Seasoned Programmer
    • *****
    • Posts: 241
    • To code or not to code
      • View Profile
    Re:private chat with video
    « Reply #4 on: 03/11/04, 11:20 »
    no i didn't add nothing to the main.asc

    did u check in the flashcomm admin if there were a stream named with your username..?
    The courage to begin is the main step to achievement

    lillo

    • Server what's that
    • *
    • Posts: 13
      • View Profile
      • Email
    Re:private chat with video
    « Reply #5 on: 03/11/04, 23:32 »
    is possible send fla file exsample??

    gaby

    • Moderator
    • Seasoned Programmer
    • *****
    • Posts: 241
    • To code or not to code
      • View Profile
    Re:private chat with video
    « Reply #6 on: 03/15/04, 12:36 »
    yep maybe i forgot this part of code in the newroom movie

       //LECTURE
    this.attachMovie("my_video","my_videodest",599,{_x:225, _y:0});
    dstStream = new NetStream(_root.client_nc);
    dstStream.play(guest);
    this.my_videodest.my_video.attachVideo(dstStream);
    //my_audio.attachAudio(dstStream);

    now you've got everything to make it works...
    The courage to begin is the main step to achievement

    lillo

    • Server what's that
    • *
    • Posts: 13
      • View Profile
      • Email
    Re:private chat with video
    « Reply #7 on: 03/15/04, 21:55 »
    gaby if you have demo is better
    sedn fla file if you have

    lillo

    • Server what's that
    • *
    • Posts: 13
      • View Profile
      • Email
    Re:private chat with video
    « Reply #8 on: 03/22/04, 07:31 »
    please if you have simple demo..send fla file
    is much better for undestand thanksssssssss

    Robert

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
    Re:private chat with video
    « Reply #9 on: 04/28/04, 11:54 »
    gaby :  this is my first post to what looks like a great site. Thanks for the code to add video to the private chat app. I wanted to take a look at your sample site but my french is weak. Is there a demo pass?  I seem to be having some issues with the video in the NewRoom. I am not sure how you intended it to function.  I have the video working in the main but no video is available in the new room.  Any ideas? I will take another try at getting on your site to see the funcitionality. thanks again

    gaby

    • Moderator
    • Seasoned Programmer
    • *****
    • Posts: 241
    • To code or not to code
      • View Profile
    Re:private chat with video
    « Reply #10 on: 04/30/04, 10:16 »
    yes you're right this is a great site...

    to answer your question, as i said i've changed something in the login function, so with my code you have to send a variable called "exp" when calling the swf...i think your issue come from this point...to make sure, check in your flash com admin the name of the broadcating and playing connection...check first if there is a connection broadcasting with the name of your user, and then check if there is a playing stream of the name of the broadcasting stream.
    hope this will help
    gaby
    The courage to begin is the main step to achievement

    Robert

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
    Re:private chat with video
    « Reply #11 on: 04/30/04, 10:26 »
    gaby : thanks for the post I will take a look. I did get onto your site and it looks great. I noticed that you have added audio and vidio on/off switches. Have you got that working yet? I was the only one in the chat so I could not tell. I also notice that you were using a smaller frame for the video in the main. Is that just scaled down or are you actually using a smaller video stream? Thanks again for your posts

    gaby

    • Moderator
    • Seasoned Programmer
    • *****
    • Posts: 241
    • To code or not to code
      • View Profile
    Re:private chat with video
    « Reply #12 on: 04/30/04, 10:43 »
    i disabled the audio for bandwith concerns, but if i remember u just have to remove the // before the audio line and it's working (take care, to have a correct sound requires about 100k/s by stream..u can make it lighter, but with poor quality). the main video is only a resize

    hope that'll help

    G
    The courage to begin is the main step to achievement

    Robert

    • Server what's that
    • *
    • Posts: 8
      • View Profile
      • Email
    Re:private chat with video
    « Reply #13 on: 04/30/04, 11:54 »
    gaby : thanks for your help. This is my first exposure to FlashMX and Flash Com.  Where do I start as far as handeling the variables for exp and guest. I know that this is a broad question but the "help" in Flash MX is not very helpful. I have checked the flash com admin and the two video streams for the NewRoom are Idle.

    gaby

    • Moderator
    • Seasoned Programmer
    • *****
    • Posts: 241
    • To code or not to code
      • View Profile
    Re:private chat with video
    « Reply #14 on: 05/01/04, 06:18 »
    so to pass a variable use in the url: http://localhost/mymovie.swf?exp=boubou

    where exp will be the name of the broadcast...

    nevermind what the statut of the streams is, make first sure that these stream have got a name...(the broadcast stream is supposed to have the of the "exp" variable...

    so open one window like this:

    http://localhost/mymovie.swf?exp=boubou

    and a second one like this:

    http://localhost/mymovie.swf?exp=bb

    so now boubou is supposed to broadcast a video stream name "boubou'... then  invite bb for a private chat, a new stream will appear in admin, (playing, boubou)

    good luck
    The courage to begin is the main step to achievement