'I want to put a Youtube URL in a HTML5 video tag and play it

<video muted autoplay playinline loop controls preload="metadata" src="https://www.youtube.com/××××××"></video>

I would like to put a Youtube URL in a HTML5 video tag and play it.

When I use the above code, I get a black screen and the video does not play.

Is there a better way to do this?

I want to use AR.js to play a video using AR technology, but if I put the Yotube embed code in place of the video tag, it will not play, and if I put the youtube URL inside the video tag as shown above, it will not play.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source