Maybe my question title maybe wrong and i can't try too big as title, but the thing is i am trying to add song in playlist from ajax request.
in jplayer i created playlist and set songs using setPlaylist function and this works fine. problem is when i click on album button it start playing song and i want it to pause.
This is my song function :
AddSongToPlaylist(songs) {
songs.filter((song) => {
self.MySong.addSong(song);
self.MySong.setUser(song.user_id);
myplayer.setPlaylist(self.MySong.getSongList());
});
}
And on button i did this : AddSongToPlaylist(song_object)
My song is object class that adds songs to songList and from there i pick songs using .getSongList
But i don't think there will be any issue but there could be solution where i can run AddSongToPlaylist(song_object)
function one time only when no matched song added to list.
Please let me know if anyone tried this.