Sydney Video Widget is causing parsed JavaScript during initial page load

I’m optimizing my website and the Sydney Video Widget is causing delayed uploading times and loss of page performance due to parsed JavaScript during the initial page load. My PageSpeed Score drops 10% when I use the Video Widget. What can be done about this?

I really appreciate your help on this one!

Hello there,

I am sorry I don’t have a specific answer to recommend as site optiomization goes beyond our support service. However, I can point you to the official WordPress codex which has a complete information about it. You can read it on this link.

Regards,
Kharis

You know I’ll understand if you say you can’t help me, but I WILL LOVE YOU IF YOU CAN! Lol. This is what I need to learn how to do- https://varvy.com/pagespeed/defer-videos.html

I’m sure once we figure this out we can make the Sydney Video Player MUCH MORE VALUABLE! I just need to figure out where to enter the following Java script-

<script>
function init() {
var vidDefer = document.getElementsByTagName(‘iframe’);
for (var i=0; i<vidDefer.length; i++) {
if(vidDefer[i].getAttribute(‘data-src’)) {
vidDefer[i].setAttribute(‘src’,vidDefer[i].getAttribute(‘data-src’));
} } }
window.onload = init;
</script>

If I remove the Sydney Video Widget and create a Text Widget or Site Origin Editor then I can enter the following embed video code and get the video to play that way- <iframe width=“560” height=“315” src=“https://www.youtube.com/embed/iuz8UiWuauQ” frameborder=“0” allowfullscreen></iframe>

Now, when I make the changes, as suggested in the link above, to the src=" “, and add the data-src=”, it doesn’t work as suggested. I’m going to keep trying to figure out what I’m doing wrong, but once we figure this out I’m sure we can edit the Sydney Video Player so that it defers the video, instead of parsing it, which would make EVERY Sydney Video Player User happier! I would imagine everyone would be happier if we can figure out how to prevent the parsing from slowing things down so much.

Hello there,

To add extra custom JS code to your site, you can do the below steps:

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box. You don’t need the <script> opening and </script> closing tags as the plugin does it automatically.
  4. Update

Regards,
Kharis

VERY NICE! Once again… thank you, Kharis! That plugin, deferring the video and java script code makes a HUGE difference in performance.

You’re welcome! You did a really great job on improving the video performance. Thank you for sharing it here. We really appreciate it.

Regards,
Kharis