Show youtube full screen video in a click

2019-09-12 17:06发布

问题:

In one of my web app I am showing a youtube videos thumb nails like

<img height="150px" id="youtubeImage" src="http://img.youtube.com/vi/VIDEO_ID/default.jpg" href="">

I am fetching the video id from database. I want to show a full screen if this video while clicking on this link. I showed this in a iframe using jQuery. But how to show this in full screen ?

Please help Thanks

回答1:

Not really a jQuery answer, but this can almost be achieved by using the URL:

http://www.youtube.com/v/[VIDEO_ID]

This will redirect to

http://youtube.googleapis.com/v/[VIDEO_ID]

Which has the video taking up the full browser tab. Not strictly fullscreen as it won't hide the player components but I'm not sure you can do it any other way.