Well, I need to create a player on my site, that when I click the watch button, it opens in full screen and contains a "back" button for the user to return home. Is it possible to do this using the youtube player?
Well, I need to create a player on my site, that when I click the watch button, it opens in full screen and contains a "back" button for the user to return home. Is it possible to do this using the youtube player?
Friend, you can simulate the full screen as follows:
In HTML you create a template structure that will be used inside a modal window:
<script type="text/template" id="video_1">
<iframe width="100%" height="720px" src="https://www.youtube.com/embed/LGApONHq8LI?feature=player_embedded"frameborder="0" allowfullscreen></iframe>
<a href="link voltar"> Voltar</a>
</script>
<a href="javascript:void(0);" class="video" data-id="1">Vídeo</a>
After you create the modal structure:
<div id="modal_video"></div>
I did not create the modal, I just put the video in a div to get an idea.
jQuery:
$('.video').click(function(){
var idVideo = $(this).data('id');
var video = $('#video_'+idVideo).html();
$('#modal_video').html(video);
});
The back link you can change to close as the user will not leave the page, just close the modal. follow the example of the operation: link
In this way the video opens in another window, occupying all the space of the same, so if the user wants to return to the site is just close it, I do not think there is a method of automatically opening in fullscreen because it would be invasive to the user. / p>
<a href="https://www.youtube.com/v/GsF1jnTjRLo?autoplay=1" target="_blank">assistir</a>
o https://www.youtube.com/v/GsF1jnTjRLo
is different from https://www.youtube.com/watch?v=GsF1jnTjRLo
Just because the first one occupies the whole page, and the second goes to the link on youtube