simplewebrtc / SimpleWebRTC

Simplest WebRTC ever
Other
4.66k stars 1.19k forks source link

2 views from remote videos #722

Open nasersobhan opened 6 years ago

nasersobhan commented 6 years ago

I want to have 2 videos from each incoming video. I want to have a list of all videos including my own screen in the side in small box and when i click on one of them it should move to other side with bigger size. I tried to move it but it removes the small one and I can't move back to what it was. or maybe full screen can anyone help me?

JakeTrock commented 6 years ago

without providing code/a screenshot, I don't know what you really want to do but I think styling the video element you want to hide like below would be a great idea: .hiddenvideo{display:none} then to show it again: .shownvideo{display:inline}

nasersobhan commented 6 years ago

no, I know css, I use the normal code in the github noting special but I am trying to make 2 videos from one connection (one Small and one big) or at least something that moves the video src from one video to another video element. so to be short, I want two video elements with one source how can I get src from current video element and move it to another.

JakeTrock commented 6 years ago

oh, that makes more sense, I can't help much but I think you can actually grab frames from the localvideo, or more simply, you could use 2 iframes on a seperate video page

wardhanster commented 6 years ago

You can use html5 canvas API to do that take a look at https://www.w3schools.com/tags/canvas_drawimage.asp for a quick and easy demo.