[WordPress] 外掛分享: Speak Sound Library

首頁外掛目錄 › Speak Sound Library
WordPress 外掛 Speak Sound Library 的封面圖片
全新外掛
安裝啟用
尚無評分
4024 天前
最後更新
問題解決
WordPress 3.8.1+ v1.0.0 上架:2015-02-16

內容簡介

Speak Sound Library 可以讓你緊緻的管理和展示音樂圖書館。使用者可以透過個別的上傳器或遞迴掃描通過 FTP 上傳的文件夾來將 mp3 文件導入系統。掃描完成後,ID3 信息從 mp3 文件中提取出來並用於創建 SQL 条目。這些 “帖子” 然後可以通過藝術家、類型、專輯等進行組織和篩選。使用者還可以附加額外的元數據,例如每首歌曲的 YouTube 鏈接。這個歌曲資料可以使用我們的外掛的短代碼方法在前端展示,它返回 PHP 對象,或者使用 ajax 鉤子,返回格式化的 JSON 數據。一個示例實現(仍在測試中)可以在 http://www.speakstudioscoop.com/music 上看到。

連接前端播放器

這個外掛僅是一個後端管理系統,可以使用任何前端播放器進行擴展。你可以使用 PHP 鉤子來準備 HTML,或者使用一個 jQuery ajax 方法,它會返回以 JSON 格式格式化的聲音數據。

下面的程式碼會返回你的圖書館中所有聲音的 JSON 字符串:

var data = {
action: ‘get_songs’
};

jQuery.post(ajaxurl, data, function (response) { console.log(response);
});

你也可以按類型、專輯或藝術家(互斥)進行篩選,像這樣:

var data = {
action: ‘get_songs’,
albumFilter: ‘Dark Side of the Moon’,
artistFilter: ‘Pink Floyd’,
genreFilter: ‘Rock’
};

jQuery.post(ajaxurl, data, function (response) { console.log(response);
});

使用 PHP,你可以像任何其他帖子一樣檢索聲音,只需將 “post_type” => “sounds” 添加到你的 get_posts() 查詢中即可。

享受吧 🙂

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Speak Sound Library」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Speak Sound Library allows tight management and presentation of a music library. Users can import mp3’s into the system with an individual uploader or by recursively scanning a folder uploaded via ftp. Once scanned, the ID3 information is extracted out of the mp3 files and used to create a SQL entry. The resulting ‘posts’ are then organized and filterable by artist, genre, album, etc. Users can also attach additional meta-data, such as a youtube link to each song. This song data can be presented on the front-end using our plugin’s short code methods, which returns PHP objects, or using an ajax hook, which returns formatted JSON data. An example implementation (still beta), can be seen at http://www.speakstudioscoop.com/music.
Wiring up a Frontend Player
This plugin is merely a backend management system and can be extended using any type of front-end player. You can either use PHP hooks to prepare html, or use a jQuery ajax method, which returns sound data formatted in JSON.
This method will return a JSON string of all of the sounds in your library:
var data = {
action: ‘get_songs’
};
jQuery.post(ajaxurl, data, function (response) { console.log(response);
});

You can also filter by genre, album or artist (mutually exclusive), like this:
var data = {
action: ‘get_songs’,
albumFilter: ‘Dark Side of the Moon’,
artistFilter: ‘Pink Floyd’,
genreFilter: ‘Rock’
};
jQuery.post(ajaxurl, data, function (response) { console.log(response);
});

Using PHP, you can retrieve sounds the same as you would any other post, just add ‘post_type’ => ‘sounds’ to your get_posts() query.
Enjoy 🙂

延伸相關外掛

文章
Filter
Mastodon