-
Author
Tagged: optimize, defer javascript, speed
-
July 11, 2015 at 15:29 #67788ghodsonParticipant
Hey Guys
I am noticing that the video embeds cannot defer javascript using any defer js plugins.
This is slowing my sight considerably as i have quiet a few posts using embeds.
Can you please advise on how to achieve?Thanks
July 12, 2015 at 14:22 #67890LauraModeratorHello, will assign the ticket to a higher support lever who can help and advise you in your query.
Thanks! 🙂Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
July 12, 2015 at 14:26 #67891sharmstrModeratorThis seems to work https://wordpress.org/plugins/lazy-load-for-videos/screenshots/
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 12, 2015 at 15:50 #67900ghodsonParticipantTried that already, didn’t work.
I think it might have something to do with being src rather than data-src. It’s not just YouTube either. I am also embedding Soundcloud and using video option in Post to be able to show image.July 14, 2015 at 20:59 #68271AndreiModeratorCan you please leave us an url to the page of your site where you’re trying to achieve this ?
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 15, 2015 at 19:46 #68454AndreiModeratorHi @ghodson, in your case it is not about deferring any js, because those elements are iframes and you cannot block their load with a js script. This iframe “deferring” will involve modifying a lot of elements from our listing grids and isn’t something that can be provided as a small/quick fix.
I’ll rename your topic to reflect the right issue and move it to our feature requests voting system so that we can consider it for future implementation.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 16, 2015 at 01:16 #68510ghodsonParticipantIs it not as simple as changing the html to eg. <iframe width=”560″ height=”315″ src=”” data-src=”//www.youtube.com/embed/OMOVFvcNfvE” frameborder=”0″ allowfullscreen></iframe>
Removing src=”” and replacing with data-src=””
and then adding the script to the bottom of the page.
<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>I just need to know what tempaltes to modify?
July 16, 2015 at 03:34 #68519AndreiModeratorThat won’t be as easy as that, a proper defer in this case would be to have a placeholder thumbnail with a proper media icon over it, and when you click the icon it would swap the image placeholder with the real iframe.
The method you posted it will only move all iframes to load after the DOM is ready, but it will still load all of them at once producing the same amounts of requests.
If you still want to proceed with your incomplete solution you will have to modify the “post-content-*” files from the “page-parts” folder.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 21, 2015 at 14:26 #69262ghodsonParticipantWhat would you recommend? My main concern is the site loading time which is around 13 secs. I need to get down to at least 6 secs.
July 21, 2015 at 14:30 #69264AndreiModeratorYou could reduce the amount of items displayed in a page, or instead of using an embed in the posts listing you could only add a picture thumbnail and leave the embed just in the content of the post.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 21, 2015 at 14:40 #69268ghodsonParticipantDoes the thumbnail option require modification to template?
July 21, 2015 at 15:32 #69275AndreiModeratorNo, just change the post format to standard.
CheersHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘Feature requests’ is closed to new topics and replies.