上周在facebook看到小鐵大大的分享一個有關於HEAD的元素的repo,
有需要的時候可以速查一下:
https://github.com/joshbuchea/HEAD
星期日, 5月 29, 2016
星期日, 3月 06, 2016
[Html5]多國語系 i18n 字串符設定
新版的lang設定值已進化成以下的列表了,有需求要朋友可以參考一下。
Lang對應清單
zh-Hans 簡體中文
zh-Hans-CN 大陸地區使用的簡體中文
zh-Hans-HK 香港地區使用的簡體中文
zh-Hans-MO 澳門使用的簡體中文
zh-Hans-SG 新加坡使用的簡體中文
zh-Hans-TW 臺灣使用的簡體中文
zh-Hant 繁體中文
zh-Hant-CN 大陸地區使用的繁體中文
zh-Hant-HK 香港地區使用的繁體中文
zh-Hant-MO 澳門使用的繁體中文
zh-Hant-SG 新加坡使用的繁體中文
zh-Hant-TW 臺灣使用的繁體中文
其他舊式用法,PS:不符合RFC 4646規範
zh-hakka 客家話
zh-cmn 普通話
zh-Hans-CN 大陸地區使用的簡體中文
zh-Hans-HK 香港地區使用的簡體中文
zh-Hans-MO 澳門使用的簡體中文
zh-Hans-SG 新加坡使用的簡體中文
zh-Hans-TW 臺灣使用的簡體中文
zh-Hant 繁體中文
zh-Hant-CN 大陸地區使用的繁體中文
zh-Hant-HK 香港地區使用的繁體中文
zh-Hant-MO 澳門使用的繁體中文
zh-Hant-SG 新加坡使用的繁體中文
zh-Hant-TW 臺灣使用的繁體中文
其他舊式用法,PS:不符合RFC 4646規範
zh-hakka 客家話
zh-cmn 普通話
星期四, 3月 03, 2016
[Html5] 在網頁播放midi音樂檔
因為工作需求需要在網頁上播放midi,
查了一下使用html5 audio的播放器是無法播放的,
使用舊式的object tag chrome會跳出禁用的警告,
最後使用https://github.com/chenx/MidiPlayer 這個方法是最簡單處理的,
只需要下載一個js檔就可以簡單使用了!!
Features
Can specify these in constructor parameter list: midi, target, loop, maxLoop, end_callback.- - midi: MIDI file path.
- - target: Target html element that this MIDI player is attached to.
- - loop: Optinoal. Whether loop the play. Value is true/false, default is false.
- - maxLoop: Optional. max number of loops to play when loop is true. Negative or 0 means infinite. Default is 1.
- - end_callback: Optional. Callback function when MIDI ends.
- e.g., use this to reset target button value from "stop" back to "play".
- Can specify a debug div, to display debug message: setDebugDiv(debug_div_id).
- Start/stop MIDI by: start(), stop().
- If a MIDI started play, call start() again will stop and then restart from beginning.
範例
//初始化
// * @param midi MIDI file path.
// * @param target Target html element that this MIDI player is attached to.
// * @param loop Optinoal. Whether loop the play. Value is true/false, default is false.
// * @param maxLoop Optional. max number of loops to play when loop is true.
// * Negative or 0 means infinite. Default is 1.
// * @param end_callback Optional. Callback function when MIDI ends.
midiPlayer = new MidiPlayer(url, MIDI_ELEM_ID, true, 1, function() {
console.log('midi done');
});
//播放
midiPlayer.play();
//停止
midiPlayer.stop();
參考連結
https://github.com/mudcube/MIDI.js => 功能最強大的midi庫
https://developer.mozilla.org/zh-TW/docs/Web_Audio_API
http://stackoverflow.com/questions/5789734/does-the-html5-audio-tag-encompass-mid-midi-unofficially
http://homeofcox-cs.blogspot.tw/2015/04/play-midi-in-browser-by-javascript-only.html
https://github.com/chenx/MidiPlayer
星期五, 6月 13, 2014
[HTML] HTML5 的筆記
昨天看了intel有關enterprice API appliance的簡報,
談到了一些使用HTML5制作APP的內容,順便來複習一下HTML5。
以下是網路上擷取的資訊 :D
談到了一些使用HTML5制作APP的內容,順便來複習一下HTML5。
以下是網路上擷取的資訊 :D
什麼是HTML5
- 目標是為了取代1999年所制定的HTML 4.01和XHTML 1.0標準。
- 廣義而言包含HTML、Javascript、CSS3三個技術
- 減少瀏覽器對於需要外掛程式(Flash, Silverlight, JavaFX)的豐富性網路應用服務(Rich Internet Application, RIA)的需求
訂閱:
意見 (Atom)