Embedding video

Why dont we just use URL of a video for src attribute in video tag to embed a video, instead of using iframe? I tried using URL for doing the same to embed a youtube video and it just didn’t work. Is there any special reason why URL has been disabled for videos and iframe is used instead?

Hello @Manvitha_Reddy

for the youtube it’s one of it’s embedded security setting
another thing if you tried to change the iframe to be sandbox it will not work that one of google settings

and if you checked the src of any video in youtube it will show something like that scr = “blob:https://www.youtube.com/21a62bef-c332-4065-9a81-9609f3602810” which is not valid video file which is type of binary data that stored in database https://en.wikipedia.org/wiki/Binary_large_object

plus some security setting can block content from another website so all content should be from same origin this setting can be applied on server or even you can do that in your browser settings

try using the url with local video file on your computer and it will work fine

hope that help and have a nice day