Well the phone already has two cameras, so at least one would have the ability to have video recording. If this is the case, all you would need is an app that can connect the camera to you and the internet. You don't need a separate actual webcam.
You would just need a good webcam app. There are quite a few out there. Like "IP Webcam" as an example. Then, once you have chosen what app you want to use and installed it you will need to learn that apps settings. You will also need to, each time you go to use said app, to change your phone's settings. Not the apps settings but the ones for the phone itself. This is because you won't want the screen to go to sleep when nothing is touching it, as they normally do. But you will want it to still sleep when using it for other things. So before you go to use the webcam app, each time, you will need to change the phones settings so that the screen never sleeps. Then, once you are done with the app, change the phones settings back to what they were before. I know way to automatically have this change happen, it is something you would need to do yourself each time.