Why does the embed for twitter and youtube in post content don’t show the data?

I’ m working on wordpress plugin where I create a new post using wp_insert_post() but when I view the post from frontent the embeded twiiter and youtube url do not get converted to iframe but when I see the content in admin side editor it show both the iframe with data in it. Next when I update the same content from the admin side editor it show the content properly in the front end as well. I could not get what should be the problem? and what should I do to remove this issue?

eg url used : https://www.youtube.com/watch?v=7TF00hJI78Y

Related posts