The first time I faced a problem to insert code video to text (plain textarea in the General case). At the entrance there are various codes of the players (e.g., auto generated by YouTube, RuTube and other), you must implement them in a safe insert in the text of the record. All attempts to insert the "wrong" code will be blocked. How to distinguish safe player code from a potentially unsafe?