This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

janedoe
janedoe

i have a jquery in my html template that play music in my template.But that jquery needs the url of the song to be played.suppose if i have to upload 10 songs i need to copy a function 10 times and give url of 10 songs seperately.is there any solution by which i can make loop for that function and upload song from backend and then it play that music.for more clearance i am giving that jquery.

/* var myPlaylist = [

{
    mp3:'http://localhost/himsmusic2/themes/himsmusic/assets/playlist/songs/1.mp3',
    oga:'playlist/3.ogg',
    title:'City of star',
    artist:'Ryan Gosling',
    love:5,
    duration:'0:30',
    cover:'http://localhost/himsmusic2/themes/himsmusic/assets/playlist/2.jpg'  
},
{
    mp3:'http://localhost/himsmusic2/themes/himsmusic/assets/playlist/songs/3.mp3',
    oga:'playlist/1.ogg',
    title:'Ankhiyan',
    artist:'Kanika Kapoor',
    love:2,
    duration:'0:30',
    cover:'http://localhost/himsmusic2/themes/himsmusic/assets/playlist/1.jpg'  
},      
{
    mp3:'playlist/songs/2.mp3',
    oga:'playlist/2.ogg',
    title:'California Gurls',
    artist:'Katy Perry',
    love:1,
    duration:'0:30',
    cover:'playlist/3.jpg'
},
{
    mp3:'playlist/songs/4.mp3',
    oga:'playlist/4.ogg',
    title:'Teenage Dream',
    artist:'Katy Perry',
    love:5,
    duration:'0:30',
    cover:'playlist/4.jpg'  
},
{
    mp3:'playlist/songs/5.mp3',
    oga:'playlist/5.ogg',
    title:'31 Minutes to Takeoff',
    artist:'Mike Posner',
    love:4,
    duration:'0:30',
    cover:'playlist/5.jpg'  
},
{
    mp3:'playlist/songs/6.mp3',
    oga:'playlist/6.ogg',
    title:'Mine',
    artist:'Taylor Swift',
    love:2,
    duration:'0:30',
    cover:'playlist/6.jpg'  
},
{
    mp3:'playlist/songs/7.mp3',
    oga:'playlist/7.ogg',
    title:'Dynamite',
    artist:'Taoi Cruz',
    love:4,
    duration:'0:30',
    cover:'playlist/7.jpg'  
},
{
    mp3:'playlist/songs/8.mp3',
    oga:'playlist/8.ogg',
    title:'Whatcha Say',
    artist:'Jason Derulo',
    love:4,
    duration:'0:30',
    cover:'playlist/8.jpg'  
},      
{
    mp3:'playlist/songs/9.mp3',
    oga:'playlist/9.ogg',
    title:'Let Me Fall',
    artist:'B.o.B',
    love:3,
    duration:'0:30',
    cover:'playlist/9.jpg'
},
{
    mp3:'playlist/songs/10.mp3',
    oga:'playlist/10.ogg',
    title:'Club Cant Handle Me',
    artist:'Flo Rida',
    love:5,
    duration:'0:30',
    cover:'playlist/10.jpg' 
}

]; is octobercms has any solution for this so that i should not have to copy that function for every new song.Thanks in advance

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.