INDRAJITH EKANAYAKE
INDRAJITH EKANAYAKE

Reputation: 4274

HTML: trying to embed youtube video

When I'm embedding a Youtube video into my website, the following error occurs:

An error occurred. Please try again later. (Playback ID: 044VSn6cAs2PR3y3) Learn More

enter image description here

My index.html contains the following markup snippet:

<div class="mu-about-us-right">
    <a id="mu-abtus-video" href="https://www.youtube.com/embed/watch?v=lWz-46NPqdk" target="youtube-video">
        <img src="assets/img/about-us.jpg" alt="img">
    </a>
</div>

I can't understand what is the error in my code. I have tried with some other videos as well so it's not a fault of Youtube server.

PS: I'm running my website on localhost

Upvotes: 2

Views: 3124

Answers (3)

sharmag 2
sharmag 2

Reputation: 133

If you are not using iframe and giving the URL in popup anchor tag then, <a class="popup-border popup-videos mt-200" href="https://youtube.com/watch?v=_4EX7bMj2Ak?t=192"> <i class="fa fa-play"></i> make sure that you put only URL that start after = EG. _4EX7bMj2Ak?t=192

Upvotes: 2

Kermit
Kermit

Reputation: 5992

My browsers were blocking the embedded content until I used this extension.


Install

pip install sphinxcontrib.yt

conf.py

extensions = [
    , 'sphinxcontrib.yt'
]

file.rst

.. youtube:: bmbnPvSHcu4

Upvotes: 1

Hemang Rajvanshy
Hemang Rajvanshy

Reputation: 40

Try embedding the video using an iframe like so:

<div class="mu-about-us-right">
   <iframe width="560" height="315" src="https://www.youtube.com/embed/lWz-46NPqdk" frameborder="0" allowfullscreen></iframe>
</div>

You can't use an anchor tag to embed videos.

Upvotes: 2

Related Questions