APlayer icon indicating copy to clipboard operation
APlayer copied to clipboard

can someone guide me how to integrate aplayer with angular js

Open mihir-kumar-thakur opened this issue 9 years ago • 2 comments

I am currently using

var app = angular.module('myApp', []);

app.config([
  '$interpolateProvider', function($interpolateProvider) {
    return $interpolateProvider.startSymbol('{(').endSymbol(')}');
  }
]);

app.directive("aplayer", function() {
  return {
    restrict : "AC",
    link: function(scope, element, attrs) {
      var nativeElement = element[0];
      var ap1 = new APlayer({
        element: nativeElement,
        narrow: false,
        autoplay: false,
        showlrc: false,
        mutex: true,
        theme: '#ad7a86',
        mode: 'circulation',
        listmaxheight: '0px',
        music:[
        {
            title: 'あっちゅ~ま青春!',
            author: '七森中☆ごらく部',
            url: 'http://devtest.qiniudn.com/あっちゅ~ま青春!.mp3',
            pic: 'http://devtest.qiniudn.com/あっちゅ~ま青春!.jpg'
        },
        {
            title: 'secret base~君がくれたもの~',
            author: '茅野愛衣',
            url: 'http://devtest.qiniudn.com/secret base~.mp3',
            pic: 'http://devtest.qiniudn.com/secret base~.jpg'
        },
        {
            title: '回レ!雪月花',
            author: '小倉唯',
            url: 'http://devtest.qiniudn.com/回レ!雪月花.mp3',
            pic: 'http://devtest.qiniudn.com/回レ!雪月花.jpg'
        }
    ]
      });
    }
  };
});

Everything works fine. But i don't know how to pass music list dyanamically

mihir-kumar-thakur avatar May 13 '17 14:05 mihir-kumar-thakur

What do you mean pass music list dyanamically?

DIYgod avatar May 18 '17 03:05 DIYgod

issue solved. thanks for reply

mihir-kumar-thakur avatar May 19 '17 12:05 mihir-kumar-thakur