my questions is about good practice to write clean code in angular 4.
I have two components - client and host, their are pretty similar, both have some <video> element and both have similar code for handle this <video> element.
So what is the best way to implement this without duplicating code in this two components?
Remember if I will create another component for example video-component and then I will have in this <video> I must supply some public functions to turn on, off camera, microphone, start stream, close stream, etc...
There are a few functions that I have to run from Client/Host-Component in my new Video-Component.