Skip to content

emka.web.id

Menu
  • Home
  • Indeks Artikel
  • Tutorial
  • Tentang Kami
Menu

SoundManager2 sekarang dengan HTML5 Audio!

Posted on May 17, 2013 by Syauqi Wiryahasana
Schott Schiller, seroang frontend engineer dari moustache-d merilis update terbaru dari library javascript buatannya: SoundManager. Versi terbaru dari SoundManager 2 kini datang dengan tambahan dukungan audio HTML5. Dengan demikian, SoundManager menjadi salah satu dari beberapa JavaScript Sound API yang telah layak disebut HTML5 Audio()-capable selain berkutat dengan format-format populer Flash seperti MP3/MP4. Fitur utama: - Support HTML5 Audio() -- dalam tahap eksperimental dengan umpanbalik yang dibutuhkan berformat MP3/MP4. - 100% bebas-Flash! - API tak berubah, tetap sama walaupun menggunakan HTML5 atau Flash Nah, berikut kutipan bagaimana SoundManager bisa bekerja:
soundManager.useHTML5Audio Determines whether HTML5 Audio() support is used to play sound, if available, with Flash as the fallback for playing MP3/MP4 (AAC) formats. Browser support for HTML5 Audio varies, and format support (eg. MP3, MP4/AAC, OGG, WAV) can vary by browser/platform. The SM2 API is effectively transparent, consistent whether using Flash or HTML5 Audio() for sound playback behind the scenes. The HTML5 Audio API is roughly equivalent to the Flash 8 feature set, minus ID3 tag support and a few other items. (Flash 9 features like waveform data etc. are not available.) SoundManager 2 + useHTML5Audio: Init Process At DOM ready (if useHTML5Audio = true), a test for Audio() is done followed by a series of canPlayType() tests to see if MP3, MP4, WAV and OGG formats are supported. If none of the "required" formats (MP3 + MP4, by default) are supported natively, then Flash is also added as a requirement for SM2 to start. soundManager.audioFormats currently defines the list of formats to check (MP3, MP4 and so on), their possible canPlayType() strings (long story short, it's complicated) and whether or not they are "required" - that is, whether Flash should be loaded if they don't work under HTML5. (Again, only MP3 + MP4 are supported by Flash.) If you had a page solely using OGG, you could make MP3/MP4 non-required, but many browsers would not play them inline. SM2 will indicate its state (HTML 5 support or not, using Flash or not) in console.log()-style debug output messages when debugMode = true.
Tertarik? Silakan cek source code terbaru disini: http://github.com/scottschiller/SoundManager2/
Seedbacklink

Recent Posts

TENTANG EMKA.WEB>ID

EMKA.WEB.ID adalah blog seputar teknologi informasi, edukasi dan ke-NU-an yang hadir sejak tahun 2011. Kontak: kontak@emka.web.id.

©2024 emka.web.id Proudly powered by wpStatically