PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, April 15, 2022

[FIXED] Why is my Youtube video not showing on iFrame with Next.js and UIkit?

 April 15, 2022     iframe, next.js, reactjs, uikit     No comments   

Issue

I have place an iFrame tag in my Next.js component. On my website I can see the frame but it says "Youtube does not authorize this connection". What is wrong ?

Here is my code:

            <iframe 
                src="https://www.youtube.com/watch?v=E8gmARGvPlI" 
                width="1920" 
                height="1080" 
                frameBorder="0" 
                allowFullScreen 
                uk-responsive 
                uk-video="automute: true">
            </iframe>

Solution

If you want to play youtube videos in an iframe you need to do it using their APIs. You can learn more about how to do that here - https://developers.google.com/youtube/iframe_api_reference

If you simply want to embed the video with no external control over the video you can simply embed it. More about embedding here - https://support.google.com/youtube/answer/171780?hl=en



Answered By - NavalRishi
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing