Youtube Iframe no fullscreen button

前端 未结 3 1031
-上瘾入骨i
-上瘾入骨i 2021-01-18 23:39

Maybe it\'s Friday afternoon kicking in but for some reason I seem unable to get a fullscreen button to appear on my embedded Youtube videos. All I\'m doing is copying the s

相关标签:
3条回答
  • 2021-01-19 00:28

    The fullscreen option came back expect I had to remove &fs=1 at the end of the link.

    <iframe width="1280" height="720" src="http://www.youtube.com/embed/doXntJaJ-nQ" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
    
    0 讨论(0)
  • 2021-01-19 00:30

    It seems I needed a number of changes, final code:

    <iframe width="560" height="315" src="http://www.youtube.com/embed/hFoQVx8ZcHo?rel=0&fs=1" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>​
    

    Firstly, the URL needs &fs=1, this triggers the button to show. Additionally, webkitallowfullscreen and mozallowfullscreen are needed, stating the obvious these solve browser specific problems.

    One interesting thing I did find, despite having the working code, this sample DOES NOT work through jsfiddle, presumably something to do with being inside of an iframe. See http://jsfiddle.net/mrchris2013/v8sjL/5/ for what I mean.

    0 讨论(0)
  • 2021-01-19 00:45

    solved...! if you have an iframe(youtube) inside an iframe(jsfiddle) inside main HTML you need to define

    webkitallowfullscreen mozallowfullscreen allowfullscreen

    to both the iframes in order for it to work.....

    0 讨论(0)
提交回复
热议问题