Refactor the embedded player code injection logic in order to not change the initial structure See merge request !352