Archive for December 20th, 2006

SatayTube, wordpress plugin

English Version

前言

Satay (沙嗲)是吃的,satay 法則是一種在網頁中嵌入 flash 影片的方法,特色是合法(可以通過 W3C HTML validator)、簡單(句法很短,不需要 javascript)、通用(幾乎所有瀏覽器都支援)。

YoutubeGoogle VideoYahoo Video 的影片放上網頁現正流行。把影片貼上網頁的方法則是使用由上述網站提供的語法,把 flash video player 寫進部落格或是網頁中。而網頁所供應的語法中,多摻入了 <embed> 標籤。

問題是,由於 <embed> 並非 W3C 認可的合格語法,注射了 <embed> 語法的網頁就再也通不過 HTML validator。有沒有辦法可以讓 HTML 標準的擁護者可以把 Youtube 等影片合格地放上網頁呢?

2002 年十一月 A List Apart 介紹了 flash satay 法,利用 type=”application/x-shockwave-flash” 使鑲嵌在網頁中的 flash 影片可以成功地被所有瀏覽器讀取,再加上一個 container flash loader 使 flash 影片可以串流播放,更重要的是完全符合 W3C 規範。

在 2005年八月accessibility 的文章比較了各種能通過 HTML Validator 的 flash 鑲嵌法,其中 flash satay 依然是最為簡潔的方案,唯一美中不足的是無法正常的被 JAWS 讀取。JAWS 是為視力障礙者設計的螢幕閱讀器,可以念出螢幕上的字句。

出於對 Flash Satay 的喜愛,我寫了我的第一個 Wordpress Plugin:SatayTube。

下載

使用

  1. 把 sataytubeXX.zip 解壓縮;
  2. 把解開的 sataytube.php 上傳到 wp-content/plugins/;
  3. 再後台啟用。

用途

  1. 自動辦識由 Youtube、Google Video、Yahoo Video 提供的鑲嵌語法,將之轉換成 flash satay 的鑲嵌語法。
  2. 自動加上 alternative content,當訪客的瀏覽器沒有安裝 flash player 時,不會看到一個叉燒包,而會看到替代圖片。

注意事項

  1. 如果您不是遵守 HTML 標準的偏執狂、或您使用 rich editor,那麼您不需要安裝這個 plugin。
  2. 在正常的情形下,應該完全感受不到這個 plugin 在運作。
  3. 唯二可以發現 plugin 在執行的方法是 a. 使用沒有安裝 flash player 的瀏覽器,b. 把您的網頁去餵 HTML validator
  4. 如果 Youtube、Google Video、Yahoo Video 改變了其影片的鑲嵌語法,這個 plugin 可能會失效,如果各位發現了這類的問題,麻煩請立刻告訴我。
  5. 關於 alternative image,我原本打算做一個 random dots 3d stereogram,中間可以浮現一個 flash 的商標,可是我找遍了工具都做不出來,拜託各位能人做一張給我吧!

English Version

Introduction

Flash Satay is a method to embed flash movie into HTML document. It is not only W3C valid, but also supported by almost all browsers. SatayTube is a wordpress plugin which can automatically transfer the codes provided by Youtube, Google Video, Yahoo Video, or Brightcove.com into Flash Satay format. A custom alternative picture would be shown up if the adobe flash player is not installed.

Requirement

Wordpress 2.0-2.2

Download
Installation
  1. Download and extract the sataytubeXX.zip
  2. Upload the sataytube.php to wp-content/plugins/
  3. Activate it from admin panel.
Usage
  1. Setup the URL to custom alternative picture at Option-> SatayTube menu. (Optional)
  2. Just copy and paste the embed code provided by Youtube, Google Video, Yahoo Video, or Brightcove.com into your post, no special tags needed.

Change Log

  • v1.6 Support videos hosted on Brightcove.com
  • v1.5 Restore RSS and Atom feed
  • v1.1 Rewrite the RegExp
  • v1.0 Removal of default alternative image, add option page for custom alternative image
  • v0.1 The initial version

14 comments December 20th, 2006


Calendar

December 2006
S M T W T F S
« Nov   Jan »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Posts by Month

Posts by Category

Copyright