I am trying to build video conferencing using html5 and javascript so far, I can transfer the capture of my camera and display it on canvas
here is the code
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <head> <style> nav .search { display: none; } .demoFrame header, .demoFrame .footer, .demoFrame h1, .demoFrame .p { display: none !important; } h1 { font-size: 2.6em; } h2, h3 { font-size: 1.7em; } .left { width: 920px !important; padding-bottom: 40px; min-height: auto !important; padding-right: 0; float: left; } div.p { font-size: .8em; font-family: arial; margin-top: -20px; font-style: italic; padding: 10px 0; } .footer { padding: 20px; margin: 20px 0 0 0; background: #f8f8f8; font-weight: bold; font-family: arial; border-top: 1px solid #ccc; } .left > p:first-of-type { background: #ffd987; font-style: italic; padding: 5px 10px; margin-bottom: 40px; } .demoAds { position: absolute; top: 0; right: 0; width: 270px; padding: 10px 0 0 10px; background: #f8f8f8; } .demoAds a { margin: 0 10px 10px 0 !important; display: inline-block !important; } #promoNode { margin: 20px 0; } @media only screen and (max-width : 1024px) { .left { float: none; } body .one .bsa_it_ad { position: relative !important; } } </style> <style> video { border: 1px solid #ccc; display: block; margin: 0 0 20px 0; } #canvas { margin-top: 20px; border: 1px solid #ccc; display: block; } </style> </head> <body> <div id="page"> <div id="contentHolder"> <section class="left"> <video id="video" width="640" height="480" autoplay></video> <button id="snap" class="sexyButton">Snap Photo</button> <canvas id="canvas" width="640" height="480"></canvas> <script> </script> </section> <style> body .one .bsa_it_ad { background: #f8f8f8; border: none; font-family: inherit; width: 200px; position: absolute; top: 0; right: 0; text-align: center; border-radius: 8px; } body .one .bsa_it_ad .bsa_it_i { display: block; padding: 0; float: none; margin: 0 0 5px; } body .one .bsa_it_ad .bsa_it_i img { padding: 10px; border: none; margin: 0 auto; } body .one .bsa_it_ad .bsa_it_t { padding: 6px 0; } body .one .bsa_it_ad .bsa_it_d { padding: 0; font-size: 12px; color: #333; } body .one .bsa_it_p { display: none; } body #bsap_aplink, body #bsap_aplink:hover { display: block; font-size: 10px; margin: 12px 15px 0; text-align: right; } </style> </div> </body> </html>
now I just want streaming video to make a conference between two people, I know that I need to use webRTC or websocket, but I don’t know how to start writing code for this. any help or suggestion would be very helpful.
source share