內容簡介
這個外掛可以讓你在文章編輯器中新增影片和影片播放清單的按鈕,只需點擊該按鈕,貼上 YouTube 影片網址,再按下插入影片的按鈕即可。未來也將會支援其他影片主機。使用者可以在文章及頁面中,包括自訂文章類型中使用影片嵌入的短代碼。
以下是關於上方章節的一些注意事項:
在編輯器中使用簡單的按鈕來新增影片到你的頁面和文章中
影片響應式嵌入並且會自動適應容器大小,保持長寬比
支援以下參數:控制條(開/關)、自動播放(開/關)、自動隱藏控制條(開/關)、循環播放(開/關)
點選「插入影片」按鈕會開啟彈出視窗,你可以在那裡貼上影片網址和設定參數。你也可以設定起始時間,或者留下 0:00 從頭播放。播放清單也得到支援。此外,這個外掛還會儲存最近使用過的影片清單,供未來使用。在之後的版本中,將會有類似影片庫的功能,以在多位 WordPress 管理員和編輯之間存取和分享影片。
這個外掛是另一個更大型的專案的一部分。因為實用又簡便,所以我決定將代碼分離出來作為單獨的外掛免費提供給大眾。
使用方式
當你在文章/頁面編輯器中使用「插入影片」按鈕時,它會自動新增一個短代碼。或者,你也可以手動輸入短代碼:
[rem_video id=”影片ID” list=”播放清單ID” autoplay=0 controls=1 autohide=0 loop=0]
影片ID 是從 YouTube 網址中取得,為 v= 後的部分,例如 https://www.youtube.com/watch?v=mbBmc8RC_S8
播放清單ID 是指播放清單的 ID,例如 https://www.youtube.com/watch?v=mbBmc8RC_S8&list=PLCF042F294768BFD1
autoplay=(0|1):若設為1,則當你的頁面載入後就會自動播放影片。預設值為 0,不會自動播放
autohide=(0|1):若設為1,在播放影片時將隱藏控制條。預設值為 0,控制條將一直顯示
controls=(0|1):若設為1,將顯示控制條;若設為0,控制條將不顯示。預設值為 1。
loop=(0|1):若設為1,當影片結束時,會重新播放影片並從頭開始播放;如果是播放清單,將循環播放自清單的第一部影片。
外掛標籤
開發者團隊
原文外掛簡介
This plugin adds a button to post editor to insert videos and video playlists easily. Simply click the button, paste YoutubeURL
and kick Insert Video. Support for other video hostings will be added later. Video embedding can be used as a shortcode in posts
and pages, including custom post types.
A few notes about the sections above:
Simple button in editor to add videos to your pages and posts
Video is embedded responsively – will fit the container, keeping aspect ratio
Supports the following parameters: controls (on/off), autoplay (on/off), autohide controls (on/off), loop (on/off)
By clicking > Insert Video button it opens a popup window where you can paste video URL and set parameters. You can also set start time,
or just leave it 0:00 if you want to play video from the beginning. Playlists are also supported.
It also stores a list of recent videos where you can chose one of the videos you have used before (or saved for future). In later versions,
there will be something like a video library to access and share videos between multiple wordpress administrators and editors.
This plugin was a part of another bigger project. It was handy and easy to use, so I decided to extract the code to a stand-alone
plugin and make it available for free for public.
Usage
When you use > Insert Video button in post / page editor, it adds a shortcode automatically. Alternatively, you can put a shortcode manually:
[rem_video id=”XXXXX” list=”YYYYY” autplay=0 controls=1 autohide=0 loop=0]
XXXXX is a video ID from Youtube URL, it comes after v=, like https://www.youtube.com/watch?v=mbBmc8RC_S8
YYYYY is a playlist ID (for playlists), like https://www.youtube.com/watch?v=mbBmc8RC_S8&list=PLCF042F294768BFD1
autoplay=(0|1): if 1, video will start automatically when your page is loaded. Default is 0 – video will not start automatically.
autohide=(0|1): if 1, it will hide controls when video is played. Default is 0 – controls will be always visible.
controls=(0|1): if 1, controls will be shown, if 0 – hidden. Default is 1.
loop=(0|1): if 1, when video is ended, it will start from the beginning. If it is a playlist, it will loop from first video in the list.
