perminder-klair / angular-soundmanager2

SoundManager2 Music Player for AngularJs
http://perminder-klair.github.io/angular-soundmanager2/
MIT License
169 stars 108 forks source link

add setup parameters and Flash support #22

Open arielfaur opened 9 years ago

arielfaur commented 9 years ago

Hi ! First of all thanks for such a great module! I noticed that the angularPlayer service init function is defined as follows

ngSoundManager.factory('angularPlayer', ['$rootScope',
function($rootScope) {
    var currentTrack = null,
        repeat = false,
        autoPlay = true,
        isPlaying = false,
        volume = 90,
        trackProgress = 0,
        playlist = [];
    return {
        init: function() {
            if(typeof soundManager === 'undefined') {
                alert('Please include SoundManager2 Library!');
            }
            soundManager.setup({
                //url: '/path/to/swfs/',
                //flashVersion: 9,
                preferFlash: false, // prefer 100% HTML5 mode, where both supported
                debugMode: false, // enable debugging output (console.log() with HTML fallback)
                useHTML5Audio: true,

The setup parameters are hard coded and I cannot enable Flash 9 and rtmp streaming. Wouldn't it be better to be able to pass the setup parameters as attributes of the angular directive? Just an idea, I am not sure if that is the best approach. What do you think ? Perhaps something like:

<sound-manager url="/path/to/swfs/" flashVersion="9"></sound-manager>
perminder-klair commented 9 years ago

Hello @arielfaur

That's actually good idea, I will try to implement this and update you with progress.

alijmlzd commented 9 years ago

Hi @perminder-klair I've the same issue with this module as @arielfaur described. and it's so cool to be resolved as soon :)

Thank You