Releases: lijinke666/react-music-player
Releases · lijinke666/react-music-player
v4.11.0
Features
- support
Media Session
- support internationalization
- add umd cjs es module output file
- add less file support customize theme
Bug fixes
- fix: extends content not visible in mobile
Optimize
- refactor code
- add some test case
- upgrade webpack babel version
Break change
All text fields are discarded
now, please use locale
field
import Locale from 'react-jinke-music-player/lib/config/locale'
// Two languages are provided by default
// one of zh_CN | en_US
<ReactJkMusicPlayer locale={Locale.zh_CN}/>
// <ReactJkMusicPlayer locale={'en_US'}/>
// Custom override
const customLocale = {
playModeText: {
order: '',
orderLoop: '',
singleLoop: '',
shufflePlay: ''
},
openText: '',
closeText: '',
notContentText: '',
clickToPlayText: '',
clickToPauseText: '',
nextTrackText: '',
previousTrackText: '',
reloadText: '',
volumeText: '',
playListsText: '',
toggleLyricText: '',
toggleMiniModeText: '',
destroyText: '',
downloadText: '',
lightThemeText: '',
darkThemeText: '',
switchThemeText: '',
removeAudioListsText: '',
controllerTitle: '',
emptyLyricText: '',
clickToDeleteText: (name) => ``,
audioTitle: ''
// audioTitle: (audioInfo) => ``
}
<ReactJkMusicPlayer locale={customLocale}/>
// Support partial override, auto merge
<ReactJkMusicPlayer locale={{ audioTitle: "xxx" }}/>
v4.10.1
v4.10.0
Features
- enhance audio hooks
before
onAudioEnded(audioInfo)
onAudioAbort(event)
onAudioLoadError(event)
after
onAudioEnded(currentPlayId, audioLists, audioInfo)
onAudioAbort(currentPlayId, audioLists, audioInfo)
onAudioLoadError(errMsg, currentPlayId, audioLists, audioInfo)
Bug Fixes
- fix
onAudioVolumeChange
typing - fix can't toggle play audio when seek progress bar
v4.9.0
v4.8.1
v4.8.0
v4.7.2
v4.7.1
v4.7.0
v4.6.1
Bug Fixes
- fix
onAudioPlay
hook cannot trigger when audio track change AudioInfo
contains the custom field for audio lists now #73
function onAudioPlay(audioInfo) {
console.log(audioInfo.id) // 1
console.log(audioInfo.test) // 2
}
<ReactJkMusicPlayer audioLists={[{id:1, test: 2, ...}]} onAudioPlay={onAudioPlay}/>
- optimize typescript typing define