For vue2 projects, use @94ai/common-ui
LLMs.md

nf-audio ​

Custom audio player with seeking, segment playback, speed, volume and replaceable controls.

Import the components below; see the package README for standalone installation.

Basic usage ​

Loading example…
Basic usage

Attribute ​

parametersDescriptionTypeOptional valueDefault value
srcaudio recording filestring—''
sizeSizestringminiundefined
disabledWhether to disableboolean—false
backgroundWhether to display the background; false to remove the background.boolean—true
jump-timeSpecify frame skip timenumber—0
show-jump-timeTurn off frame skippingnumber(unit seconds)—true
back-secondSpecify the number of seconds to rewind, 0 turns off the rewind functionnumber—0
forward-secondSpecify the number of seconds to fast forward, 0 turns off the fast forward functionnumber—0
init-volumn-valueSpecify the default volume, ranging from 0 to 1number / string—0.8
init-speed-valueSpecify default playback speednumber / string—1
multiple-arrayDouble speed optionArray—['1.0', '1.25', '1.5', '1.75', '2.0', '2.5', '3.0', '3.5', '4.0', '10.0']
show-more-btnPass false to turn off double speed and downloadingboolean—true
speed-descMultiplication function descriptionstring—undefined
download-descDownload function descriptionstring—undefined
speed-pre-descSpeed option description prefix, default such as 1x, 2xstring—'x '
cross-time-tipThe start time cannot be greater than the total durationstring—undefined
unload-tipAudio resources cannot be played at the momentstring—undefined
between-startInterval playback start time, in seconds.number—0
between-endInterval playback end time, unit second; 0 means playback to the end.number—0
high-precisionTurn on AudioWorklet auxiliary timing, which requires security context; falls back to RAF/timeupdate when unavailable, and does not guarantee a fixed error.boolean—false
debuglogOutput fallback logs when a high-precision clock is unavailable.boolean—false
download-enabledWhether to enable downloading functions (including copying audio addresses and opening new tabs)boolean—true
copySuccessDescPrompt for successful copying of audio address.string—Follow language pack
copyAddressDescCopy the menu text of the audio address.string—Follow language pack
openWindowDescMenu text for new tab opening.string—Follow language pack

Event ​

event nameDescriptioncallback parameters
downloadDownload callbacke:Event
volumeChangeVolume changevolume: number(0…100)
speedChangespeed changespeed: speed of change
jumpToTimeframe skipping(time: time to jump to,autoPlay:Whether to play automatically Boolean Defaulttrue)
updateProgressPositioning progressoffsetX: Positioning offset
pauseOrPlayplay/pausepaused: Whether to pause
forwardfast forwardtime: Fast forward to time
backRewindtime: Fast rewind to time
errorResource loading errorerror: Event / Error
canPlayResource loaded successfullytotalTime: string(mm:ss)
updateTimeNative timeupdate event.event: Event
native media eventsTransparently transmit native events such as play, pause, ended, loadedmetadata, canplay, seeking, seeked, volumechange, ratechange, etc.event: Event

Slot ​

NameDescription
jumpCustomized frame skipping
playCustomized playback and pause
timeCustomized play time
fastBackCustomized rewind
progressCustomized progress
fastForwardCustomized fast forward
volumeCustom volume
moreCustomize more
volume-muteCustom mute icon.
volume-unmuteCustom unmute icon.
more-btn-listCustomize more menu content.
speed-btn-listCustomize double speed menu content.

Expose ​

NameTypeDescription
locationToTimeFunctionframe skipping
handleBackFunctionRewind
handleForwardFunctionfast forward
handlePauseOrPlayFunctionPause or play
pauseFunctionpause
playFunctionplay
betweenPlayFunctioninterval play
jumpToTime(time, autoPlay = true)voidJump to a specified number of seconds; autoplay can be turned off.
changeSpeed(value)voidSet playback speed.
copyAddress()Promise<boolean>Copy the audio address.
openWindow()voidOpen the audio address in a new tab.

Instructions for use ​

The audio example follows the recording address of common-ui. download only dispatches download requests, and file downloads are handled by the consumer. High-precision mode requires a security context; falls back when unavailable, and does not promise millisecond accuracy.