Skip to content

Instantly share code, notes, and snippets.

@quannh02
Last active June 23, 2016 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quannh02/efa6b5ae5a59323cd0afc3d302d0c432 to your computer and use it in GitHub Desktop.
Save quannh02/efa6b5ae5a59323cd0afc3d302d0c432 to your computer and use it in GitHub Desktop.
var re = /(\[([A-G])\])/g;
var str = "[ar: Sam Smith]\n[ti: I'm Not The Only One]\n[length: 03:58]\n[00:00.76]gsgasdgasgdasgsgs[B]きって行くぞ(青春 All right [C]青春 Oh";
var str_convert = str.replace(re, '<span class="hopam">$1</span>');
//alert(str_convert);
var ap5 = new APlayer({
element: document.getElementById('player5'),
narrow: false,
autoplay: false,
showlrc: 1,
mutex: true,
theme: '#ad7a86',
music: [
{
title: 'あっちゅ~ま青春!',
author: '七森中☆ごらく部',
url: 'http://guitar.vn/upload/Sam%20Smith%20-%20I%27m%20Not%20The%20Only%20One.mp3',
pic: 'http://devtest.qiniudn.com/あっちゅ~ま青春!.jpg',
lrc: str_convert
}
]
});
ap5.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment