Allowing users of your website to include a video into a message, can be done in two ways.
- You instruct all the users to go to the video page, find the embed code, let them upload html to your website and displaying the raw html to all users.
- You tell them to paste the link to the youtube page, and your website generates the embed code right from that link.
While the first option seams like the easiest one (for you as a programmer), it might also be a bad choice in user-friendliness and security wise it isn’t very smart to allow the user to upload html (especially iframes).
The second option, allowing just pasting the link, would seem like a lot of work. But it is actually quitte easy.