Forum Moderators: open

Message Too Old, No Replies

youtube video in modal window (wordpress) stopped working

         

alexod

12:30 am on Sep 18, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



hi,

I have a Youtube video embedded into the modal window (without plugin) and it worked long time. Recently I noticed that video file don't loading

Error message: This video is unavailable.

I checked video files in live, nothing has been changed with the video, but it stopped loading on my side.

Can you advice what I'm doing wrong or has been changed in youtube regulations?

Here is the Demo version [ddavi.com]

Code that I'm using
 <div class="js-modal-btn" style="position: relative; cursor: pointer;" data-video-id="P3lXZvqoY1M"><img style="width: 350px; height: auto;" src="path /wp-content/uploads/2019/09/1n.jpg" />
<i class="fa fa-youtube-play" style="position: absolute; top: 50%; left: 23%; transform: translate(-50%,-50%); color: #fff; font-size: 48px;" aria-hidden="true"></i></div>


P.s. Everything is fine when I load with <iframe> in body, but client likes Modal Window version.

Any advice will be appreciated.

NickMNS

3:34 pm on Sep 18, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I took a quick look. The script used to create the modal appears to use it's own method to show the video and seems to have one for each supported video platform. It seems that possibly Youtube made a change and the maintainers of the script didn't update the script accordingly. You would need to file a bug report for the script, the maintainers contact information is included in the script.

not2easy

4:25 pm on Sep 18, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I know that some changes recently took effect in YouTube, I had to agree to the YT api terms to use a video we had uploaded over 10 years ago when I updated the page it was on - this was late July of this year.

robzilla

9:29 pm on Sep 18, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Update your jquery-modal-video.min.js script to the latest version: [github.com...]

That will fix it. The problem is that the script adds a bunch of parameters to the YouTube embed URL that are no longer supported. Seems to have been resolved a few months back: [github.com...]

alexod

4:44 pm on Sep 20, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



@robzilla
@not2easy
@NickMNS

Thank you guys. You are the rock stars !