how to update url of Sencha audio player

Hi,

I am currently working with your audio player extension which works great by the way. The only thing I was wondering was, is there anyway to change the song url reliably??. Below I've got a snippet from my code which shows me changing the url of the song player on listSelect event. This actually works as I have been able to confirm from both mozilla and chrome while debugging. The only thing is despite the fact that I've been able to change the url, the song player still insists on playing the url it was initialsed with, in this case "InitialSongUrl" below. Any sugestions?? thank you!

Ext.define('senchaFirst.view.MyTabPanel', { 
    extend: 'Ext.tab.Panel', 
 
    requires: [ 
        'Ext.Panel', 
        'Ext.form.FieldSet', 
        'Ext.ux.AudioPlayer', 
        'Ext.dataview.List', 
        'Ext.XTemplate', 
        'Ext.MessageBox' 
    ], 
 
    config: { 
        ui: 'light', 
        layout: { 
            type: 'card', 
            animation: 'pop', 
            'animation.direction': 'up' 
        }, 
        items: [ 
            { 
                xtype: 'container', 
                title: 'Songs', 
                layout: 'vbox', 
                items: [ 
                    { 
                        xtype: 'panel', 
                        items: [ 
                            { 
                                xtype: 'fieldset', 
                                id: 'playa', 
                                items: [ 
                                    { 
                                        url: 'InitialSongUrl', 
                                        title: 'Play', 
                                        thumb: '', 
                                        xtype: 'audioplayer', 
                                        id: 'm_player', 
                                        margin: 20 
                                    } 
                                ] 
                            } 
                        ] 
                    }, 
                    { 
                        xtype: 'list', 
                        flex: 2, 
                        cls: 'tpl-1hvtl5mo', 
                        id: 'song_list', 
                        itemId: 'mylist', 
                        itemTpl: [ 
                            '<div class="s_title">{title}</div><br/>', 
                            '<div class="s_album">{album}</div><br/>', 
                            '<div class="s_artist">{artist}</div><br/>' 
                        ], 
                        store: 'SongStore', 
                        grouped: true 
                    } 
                ] 
            }, 
            { 
                xtype: 'container', 
                title: 'Radio', 
                layout: 'vbox', 
                items: [ 
                    { 
                        xtype: 'panel', 
                        flex: 1, 
                        items: [ 
                            { 
                                xtype: 'fieldset', 
                                items: [ 
                                    { 
                                        url: 'SongUrl', 
                                        title: 'Play', 
                                        thumb: '', 
                                        xtype: 'audioplayer', 
                                        id: 'm_player1', 
                                        margin: 20 
                                    } 
                                ] 
                            } 
                        ] 
                    }, 
                    { 
                        xtype: 'list', 
                        flex: 2, 
                        id: 'radio_list', 
                        itemTpl: [ 
                            '<div>{station}</div>', 
                            '<div>{name}</div>' 
                        ], 
                        store: 'RadioStore' 
                    } 
                ] 
            } 
        ], 
        listeners: [ 
            { 
                fn: 'onMylistSelect', 
                event: 'select', 
                delegate: '#song_list' 
            } 
        ] 
    }, 
 
    onMylistSelect: function(dataview, record, eOpts) { 
        // Ext.Msg.alert(record.get('title')); 
        var m = Ext.ComponentQuery.query('#m_player')[0]; 
        var p  = Ext.ComponentQuery.query('#playa')[0]; 
 
        console.log(p); 
        m._url = "urlPrefix/"+record.get('url'); 
        m.config.url = "urlPrefix"+record.get('url'); 
        m.items.items[0]._url = "urlPrefix"+record.get('url'); 
        m.applyTitle(record.get('title')); 
        
        //m.items.items[0].mediaEvents.play(); 
 
        //m.items[0].url = "urlPrefix"+record.get('url'); 
        console.log("after: "+m._url); 
        //m.play(); 
        //Ext.Msg.alert("Here!: "+ m.items); 
 
        //console.log(m.items.items[0]); 
        //console.log(m.mediaEvents); 
 
    } 
 
});
URL SENCHA AUDIO PLAYER

Submitted by sunil On Tuesday, 01 July 2014.
Category: Sencha 2 Audio Player

[RESOLVED]

0
1 Answers.
 
Super User
crooker

Re:how to update url of Sencha audio player

use

m.setUrl(  "urlPrefix/"+record.get('url')   );



for more info Ext.ux.AudioPlayer-method-setUrl
Submitted by Super User On Tuesday, 01 July 2014
0
This Answer has been Chosen as Best Answer
Question is marked as resolved.