Aplayer ´Â MIT ¶óÀ̼¾½º¸¦ ÁöÇâ ÇÕ´Ï´Ù.
Aplayer ´Â Html + JavaScript ·Î ±¸¼º µÇ¾î ÀÖ½À´Ï´Ù.
<div id="aplayer1" class="aplayer"></div>
<script src="dist/APlayer.min.js"></script>
var ap = new APlayer({
element: document.getElementById('aplayer1'),
music: {
title: 'Preparation',
author: 'Hans Zimmer/Richard Harvey',
url: 'Preparation.mp3',
}
});
API¸¦ Á¦°øÇϱ⠶§¹®¿¡ °ü·Ã ±â´É üũ ¹× »ç¿ë¹ýÀ» ã±â°¡ Æí¸®Çϳ׿ä.
APlayer ¿¡¼ Á¦°øÇÏ´Â ±â´É Áß ¸¹ÀÌµé ¾²½Ã´Â ±â´ÉÀº °ÅÀÇ ´Ù Àֳ׿ä.
ap.play() // Resume play
ap.play(time) // Set currentTime
ap.pause() // Pause
ap.toggle() // Toggle between play and pause
ap.volume(percentage) // Set volume
ap.on(event, handler) // Event binding
ap.setMusic(index) // Switch music
ap.destroy() // Destroy this player
ap.addMusic(newMusics) // Add music dynamically, newMusics should be an array
ap.lrc // Lrc time and text
ap.playIndex // Current playing index
ap.audio // Return native audio, most native api are supported
ap.audio.currentTime // Returns the current playback position
ap.audio.loop // Returns whether the audio should start over again when finished
ap.audio.paused // Returns whether the audio paused
Most native api
¾ÆÂü ÀÚ¸·±â´É Lrc ±â´Éµµ ÀÖ±ä ÇÕ´Ï´Ù¸¸ ... ÇѶ¡ ÇѶ¡ ÅÍÄ¡°¡ ÇÊ¿äÇÒµí ÇÕ´Ï´Ù. ^^;
<div id="player1" class="aplayer">
<pre class="aplayer-lrc-content">
[00:00.00]øÁÛíñýÖØ - ÚÓ树
[00:04.01]íÂ词£º韩ùÎ ÚÓ树
[00:08.02]íÂÍØ£ºÚÓ树 编ÍØ£ºÚÓ树
[00:12.02]ÛÇüàó·îÜ î¤ÖØß¾îÜ
[00:17.37]你é©ñË吗
[00:23.20]æ¶áïîÜ 骄çìó·
</pre>
</div>
¾Æ·¡ÀÇ À̹ÌÁö´Â Ç÷¹ÀÌ¾î ½ºÅ©¸°¼¦ ÀÔ´Ï´Ù. ^^
|