1.1.9 • Published 4 years ago

@feizheng/next-audio v1.1.9

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

next-audio

Pure audio api for next.

version license size download

installation

npm install -S @feizheng/next-audio

status

codestatusdescription
-1error当在音频/视频加载期间发生错误时
0init当音频组件在初始状态
1play当音频/视频已开始或不再暂停时
2pause当音频/视频已暂停时
3loaded当浏览器已加载音频/视频的元数据时
4ended当目前的播放列表已结束时
5canplay当浏览器可以播放音频/视频时

apis

apimemberparamsdescription
playmethod-Play audio
pausemethod-Pause audio
loadmethod-Force load audio
stopmethod-Stop audio
seekmethod(num)Set seek by currentTime
movemethod(num)Set seek percent(0-1)
destroymethod(num)Destroy from memroy/dom and unload events.
propmethod(name,args)Set props(loop/volume/rate/current)
timesproperty-Return rate/current/total seconds

props

namedescription
loopSet/get loop
volumeSet/get volume
rateSet/get playback rate
currentSet/get play currentTime
mutedSet/get muted(mute/unmute)
endedGet if audio is ended

usage

<audio id="audio" controls src="http://kolber.github.io/audiojs/demos/mp3/juicy.mp3">
  NOT SUPPORT
</audio>
import NxAudio from 'next-audio';

// code goes here:
const nxAudio = new NxAudio({ element: document.getElementById('audio') });
nxAudio.play();
nxAudio.prop('loop', true);

resources

license

Code released under the MIT license.

1.1.9

4 years ago

1.1.8

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago