
內容簡介
這個極簡主義的懶加載程式可以使得你的影片頁面變得更加輕量且更快速。SlimFast透過縮圖取代了繁重的YouTube iframe。 查看演示。
該如何使用?
在頁面中貼上YouTube影片的網址(例如:https://youtu.be/neV3EPgvZ3g),WordPress 會將它轉換為影片 iframe。SlimFast將從這裡接手,並用影片縮圖和一個播放影片的按鈕取代 iframe。這也適用於所有以這種方式嵌入的現有影片。
什麼是懶加載,為什麼在YouTube影片上使用它很重要?
懶加載是一種技術,可以使您的頁面在訪問者請求它們時只加載必需的元素,從而加快頁面加載速度。頁面速度是 Google 排名頁面的關鍵因素。
嵌入YouTube iframe會為每個單獨的影片加載大量腳本,這將減慢您的頁面,特別是當訪問者沒有頂級連接時。因此需要懶加載程序!
有兩種類型的懶加載程序:
當訪問者滾動頁面查看屏幕上的影片時,才會加載影片 iframe。
當訪問者點擊播放按鈕後才會加載 iframe。 SlimFast 是其中之一。我們認為,讓您的訪問者自行決定是否要點擊,只有在他點擊時才加載 iframe,這是最好的方法。
在“屏幕截圖”部分中查看有/沒有使用SlimFast的性能比較。
為什麼SlimFast比其他YouTube懶加載外掛更好?
因為其他外掛需要兩次點擊才能播放影片:首先載入iframe,然後再點擊播放按鈕!這實際上就是我們建立這個外掛的原因:SlimFast 只需一次單擊即可載入和播放影片,即使在移動設備上也是如此!考慮到您的用戶體驗,這很重要。如果用戶需要兩次點擊播放按鈕才能啟動影片,那麼他們可能會感到沮喪!
因為它不使用任何自訂短碼。當您貼上YouTube網址時, WordPress 已經識別到了YouTube影片。SlimFast從這裡接手。何必費心使用短碼?看長遠吧!如果您決定放棄 SlimFast,只需停用它,所有的 YouTube 影片都會恢復到它們的預設 iframe。
因為我們盡可能地簡化了它!該插件只會為包含YouTube影片的頁面添加3個小腳本(YouTube iframe API,1個自定義 Javascript 和1個 CSS),僅增加4KB的額外重量。如果您的頁面不含任何 YouTube 影片,將不會加載任何東西!這就是為什麼您只會看到一個自定義設置。我們決定牺牲所有設置(例如播放列表支持和影片標題),這些設置可能會增加不必要的重量。您的 WordPress 插件有多少選項是真正需要的呢?
是否可以不使用SlimFast來處理特定的影片?
當然可以!只需貼上由 YouTube 提供的 iframe 代碼(例如:<iframe width= »560″ height= »315″ src= »https://www.youtube.com/embed/neV3EPgvZ3g » frameborder= »0″ allow= »accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture » allowfullscreen></iframe>),SlimFast將保持其完整性。如果您認為某些影片需要我們裁剪的功能,可以這麼做。
程式碼中包含什麼?
僅有3個小腳本(YouTube iframe API, 1個自定義JavaScript和1個 CSS)。
這將只會在包含 YouTube 影片的頁面中加載,增加4KB的額外重量,對不包含 YouTube 影片的頁面不進行任何加載。
不使用JavaScript庫,例如 jQuery,以確保最大程度的網站運行速度。
外掛標籤
開發者團隊
② 後台搜尋「SlimFast – YouTube Lazyloader」→ 直接安裝(推薦)
📦 歷史版本下載
原文外掛簡介
This minimalist lazyloader makes your video pages slimmer and faster. SlimFast replaces heavy YouTube iframes by their thumbnail. View a demo.
How to use it?
Paste the url of the YouTube video in a page (for example https://youtu.be/neV3EPgvZ3g). WordPress will convert it into a video iframe. SlimFast will take it from there and replace the iframe by the video thumbnail and a button to play the video. This will also work for all pre-existing videos embedded this way.
What is lazyloading and why is it important to use it on YouTube videos?
Lazyloading is a technique to make your pages load faster, by only loading required elements when the visitor requests them. The page speed is a key element in Google’s algorithm to rank pages.
Embedding a YouTube iframe will load a lot of scripts for every single video and will slow down your page, especially if your visitor doesn’t have a top connection. Hence the need for lazyloaders!
2 types of lazyloaders exist:
Those who load the video iframe when the visitor scrolls down to the point where he sees the video on his screen.
Those who load the iframe after the visitor clicks the Play button. SlimFast is one of those. We believe it is the best approach to let your visitor decide if he wants to click or not, and only load the iframe if he clicks.
See a comparison of performances with/without SlimFast in the “Screenshots” section.
Why is SlimFast better than other YouTube lazyloading plugins?
Because they require 2 click to play a video: 1 to load the iframe, 1 to play it! This is actually the reason why we built this plugin: SlimFast loads & play videos with 1 single click, even on mobile! Think about your User Experience, it’s crucial. Your visitors are frustrated if they have to click twice on that Play button to launch a video!
Because it doesn’t use any custom shortcode. WordPress already recognises YouTube videos when you paste their urls. SlimFast takes it from there. Why bother with shortcodes? Think long term! Shortcodes are painful if you decide to drop a plugin. If you’re unhappy with SlimFast, just deactivate it and all your YouTube videos will be back to their default iframes.
Because we’ve made it as light as possible! The plugin only adds 3 small scripts (YouTube iframe API, 1 custom javascript and 1 css) to your pages containing YouTube videos, for an extra weight of 4KB only. And nothing will be loaded if your pages don’t have YouTube videos! This is why you’ll only see 1 custom setting. We decided to sacrifice all settings (such as playlists support and video titles) that would add unnecessary weight. How many options do you really need on your WordPress plugins?
Is it possible not to use SlimFast on specific videos?
Of course! Juste paste the iframe code provided by YouTube (for example ) and SlimFast will leave it intact. Do it if you feel like certain videos deserve features we’ve cut.
What is in the code?
Just 3 little scripts (YouTube iframe API, 1 custom javascript and 1 css).
These will be loaded on your pages containing YouTube videos for an extra weight of 4KB only. Nothing will be loaded on pages that don’t host YouTube videos.
No JavaScript library such as jQuery is used to ensure a maximum compatibility with all themes.
Demo
View a demo.
