dcsimg
www.webdeveloper.com
Results 1 to 8 of 8

Thread: How to make a audio + video + text chat system in php?

  1. #1
    Join Date
    May 2012
    Location
    India
    Posts
    25

    Question How to make a audio + video + text chat system in php?

    Hello to all,
    I came with an idea to develop a system of audio visual chat in php but i would like to know how to capture camera stream with php , is it possible in any means .... i would be interested in knowing the procedure to do so , please help me i wanna put it on my website.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,609
    Since the camera is on the user's PC, and PHP (normally) is running on the web server, that aspect of the application will probably not be a PHP issue -- you'll need something running on the browser (Flash, Java applet, whatever?) to handle it. In fact, you'll probably end up doing most of the actual chat work in the browser, and PHP will just be used to establish the initial connections between clients. (And at this point you're getting pretty far out of my area of expertise, such as it is.)
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Feb 2014
    Location
    Canada
    Posts
    155
    If you're open to using open source libraries, there probably are a bunch out there that can help you out and be easily integrated in your chat system, such as this (however I've never used it, just found it on Google).

    If you want to do it by yourself, PHP won't be able to do what you want as the user needs (and should) give explicit permission before their hardware is accessed.

    Opera supports navigator.getUserMedia() but I'm not sure whether other browsers support it and mobile devices are going to be a whole other story. Check out these links that should help you out:

    - Link 1
    - Link 2
    - Link 3
    Last edited by Error404; 04-29-2014 at 02:48 PM.

  4. #4
    Join Date
    May 2012
    Location
    India
    Posts
    25
    Quote Originally Posted by Error404 View Post
    If you're open to using open source libraries, there probably are a bunch out there that can help you out and be easily integrated in your chat system, such as this (however I've never used it, just found it on Google).

    If you want to do it by yourself, PHP won't be able to do what you want as the user needs (and should) give explicit permission before their hardware is accessed.

    Opera supports navigator.getUserMedia() but I'm not sure whether other browsers support it and mobile devices are going to be a whole other story. Check out these links that should help you out:

    - Link 1
    - Link 2
    - Link 3
    Thanks for the info ..... I noticed the same that I have to use some client side thing to access the hardware , suppose I program a flash actionscript to access the camera then can you please guide me that how I can redirect that stream to the specified user through php ...... I think I am making myself clear.

    Example : We both are chatting through example.com you logged in through demo1 username and I logged in through demo2 username then actionscript takes my webcam stream then what it has to do , to redirect that stream to your side through the example.com website so that you can see me .... the same has to be done from your side so that I can see you.

    Thanks in advance.

    Really excited with your response.

  5. #5
    Join Date
    May 2012
    Location
    India
    Posts
    25
    Quote Originally Posted by NogDog View Post
    Since the camera is on the user's PC, and PHP (normally) is running on the web server, that aspect of the application will probably not be a PHP issue -- you'll need something running on the browser (Flash, Java applet, whatever?) to handle it. In fact, you'll probably end up doing most of the actual chat work in the browser, and PHP will just be used to establish the initial connections between clients. (And at this point you're getting pretty far out of my area of expertise, such as it is.)
    Thanks for the quick reply , I will try to do something similar to access the hardware ........ Thanks again.

  6. #6
    Join Date
    Feb 2014
    Location
    Canada
    Posts
    155
    Quote Originally Posted by jayantgeek View Post
    Thanks for the info ..... I noticed the same that I have to use some client side thing to access the hardware , suppose I program a flash actionscript to access the camera then can you please guide me that how I can redirect that stream to the specified user through php ...... I think I am making myself clear.

    Example : We both are chatting through example.com you logged in through demo1 username and I logged in through demo2 username then actionscript takes my webcam stream then what it has to do , to redirect that stream to your side through the example.com website so that you can see me .... the same has to be done from your side so that I can see you.

    Thanks in advance.

    Really excited with your response.
    Keep in mind, before you do any programming for this, you need to have a server that can handle this. From what I've read (since this idea also got me interested ) is to have a video streaming server, although these seem a bit complex to set up and usually aren't free. On the other hand, there's HTTP streaming, which can be done from a free server. For this, I figure you can create a default <video> tag that each webcam would link to. Since each camera would have a unique link, there wouldn't be any problem in multiple users simultaneously uploading and downloading (assuming the server can handle it). Flash certainly can be used for this, however, an alternative is Java. You most likely will need to use AJAX to send the data to the server for PHP to have access, so if you don't know AJAX yet, you should familiarize yourself with it (can be done with pure JavaScript or frameworks such as jQuery).

    As for how you'd direct that stream to the specific user, well, I haven't done it before so I'd have to figure it out first. My suggestion though would be to find an open source library (there's a lot for this) and check how they're doing it. Don't copy them but just understand the logic.

  7. #7
    Join Date
    May 2012
    Location
    India
    Posts
    25
    Quote Originally Posted by Error404 View Post
    Keep in mind, before you do any programming for this, you need to have a server that can handle this. From what I've read (since this idea also got me interested ) is to have a video streaming server, although these seem a bit complex to set up and usually aren't free. On the other hand, there's HTTP streaming, which can be done from a free server. For this, I figure you can create a default <video> tag that each webcam would link to. Since each camera would have a unique link, there wouldn't be any problem in multiple users simultaneously uploading and downloading (assuming the server can handle it). Flash certainly can be used for this, however, an alternative is Java. You most likely will need to use AJAX to send the data to the server for PHP to have access, so if you don't know AJAX yet, you should familiarize yourself with it (can be done with pure JavaScript or frameworks such as jQuery).

    As for how you'd direct that stream to the specific user, well, I haven't done it before so I'd have to figure it out first. My suggestion though would be to find an open source library (there's a lot for this) and check how they're doing it. Don't copy them but just understand the logic.

    Glad to hear that you also liked the idea , I know ajax from jquery and can you please name 1 or 2 library so that I can download and have a look on them as how they are doing it ....... thanks again ....

  8. #8
    Join Date
    May 2012
    Location
    India
    Posts
    25
    Quote Originally Posted by Error404 View Post
    Keep in mind, before you do any programming for this, you need to have a server that can handle this. From what I've read (since this idea also got me interested ) is to have a video streaming server, although these seem a bit complex to set up and usually aren't free. On the other hand, there's HTTP streaming, which can be done from a free server. For this, I figure you can create a default <video> tag that each webcam would link to. Since each camera would have a unique link, there wouldn't be any problem in multiple users simultaneously uploading and downloading (assuming the server can handle it). Flash certainly can be used for this, however, an alternative is Java. You most likely will need to use AJAX to send the data to the server for PHP to have access, so if you don't know AJAX yet, you should familiarize yourself with it (can be done with pure JavaScript or frameworks such as jQuery).

    As for how you'd direct that stream to the specific user, well, I haven't done it before so I'd have to figure it out first. My suggestion though would be to find an open source library (there's a lot for this) and check how they're doing it. Don't copy them but just understand the logic.
    Here are some things I found out related to the topic

    AjaxCam
    Firefox get user media test page (example) Please see how mozilla folks do it .....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles