1. #11
    Sencha User Ronaldo's Avatar
    Join Date
    Jul 2007
    Location
    Enschede, The Netherlands
    Posts
    290
    Vote Rating
    0
    Ronaldo is on a distinguished road

      0  

    Default


    Thanks for answering. I found the answer and adapted it to my needs (this points to the Ext.form.FormPanel)

    Code:
    this.previewPanel = new Ext.Panel({
                title: 'Preview',
                region: 'east',
                layout: 'fit',
                width: '50%',
                collapsible: true,
                split: true,
                tbar: [{ 
                    text:'Reload player',
                    scope: this,
                    handler:function(){ 
                        this.previewPanel.remove(this.flashComponent); 
                        this.flashComponent = this.getFlashComponent(); // returns a new Ext.FlashComponent
                        this.previewPanel.add(this.flashComponent);
                        this.doLayout();
                    } 
                }]
            });
    Works like charm!

    Cheers,
    Ronaldo
    Ronald van Raaphorst aka Ronaldo
    I'm a freelance software developer in Java, PHP, and ExtJs.


    Skyperonald_twensoc
    Mailinfo@twensoc.nl

  2. #12
    Sencha User Ronaldo's Avatar
    Join Date
    Jul 2007
    Location
    Enschede, The Netherlands
    Posts
    290
    Vote Rating
    0
    Ronaldo is on a distinguished road

      0  

    Default


    Hi,

    One last question (I hope )

    When I minimize the panel, or deactivate the tab the panel is on, the flash movie restarts every time when it becomes visible again... which is rather annoying... It should continue playing, as it does in your examples.

    Your example shows a window, and when minimizing that, the movie just keeps playing.
    In my case (with the same youtube movie) it stops playing and on re-opening the panel, the movie is stopped at time 0.

    Any idea what might cause this behaviour?

    I added a collapsible:true to your panel example, and that seems to work fine. With the following changes, your flashmovie continues playing when collapsed:

    Code:
    northPanel = new Ext.Panel({
                region    : 'north',
                height    : 100,
                layout    : 'fit',
                bodyStyle : 'background:#EDEDED',
                title: 'north',
                collapsible: true,
                split: true
            });
    I also noted that you don't include an items property in the northpanel, like

    Code:
    items:[flashComponent]
    But that appearantly the flashControl attaches itself to the northpanel when rendered/activated:

    Code:
     
    flashControl = new Ext.ux.util.FlashControl({
                flashComponent    : movie,
                container         : northPanel,
                ....
    If I omit the items property in my collapsible panel, I don't see the flash movie when the tab is opened on which the panel is situated...

    Here's my code:

    Code:
    this.flashComponent = this.getFlashComponent(); 
            this.flashControl = this.getFlashControl();
            
            this.previewPanel = new Ext.Panel({
                title: 'Preview',
                region: 'east',
                layout: 'fit',
                width: '50%',
                collapsible: true,
                split: true,
                tbar: [{ 
                    text:'Reload player',
                    scope: this,
                    handler:function(){ 
                        this.reloadPlayer(this.contentField.getRawValue());
                    } 
                }]
                ,
                items:[this.flashComponent]
            });
    
    this.tabPanel = new Ext.TabPanel({
                xtype:'tabpanel',
                activeTab: 0,
                anchor:'0 -65',
                height: 200,
                autoWidth: true,
                hideLabel: true,
                plain: true, 
                items:[{
                     title: 'General',
                     ...
                   }, {
                   title: 'Content',
                   layout:'border',        
                    items: [{
                        title: 'Content',
                        region: 'center',
                        split: true,
                        layout: 'fit',
                        items: [this.contentField] // A textArea
                    }, 
                        this.previewPanel
                    ]
                }]
            });
    
    getFlashComponent: function() {
            return new Ext.FlashComponent({
                // its important to set the FlashComponents hideMode to offsets
                hideMode : 'offsets',
                id : 'dustinthewind',
                swfId : 'dustinthewind', 
                url      : 'http://www.youtube.com/v/1qxSwJC3Ly0&hl=de&fs=1&'
            }); 
        },
        getFlashControl : function() {
            return new Ext.ux.util.FlashControl({
                flashComponent    : this.flashComponent,
                container         : this.previewPanel,
                quirksFF          : false,
                quirksIE          : false,
                autoDragTracker   : false, // true gives same behaviour
                autoDestroy       : true, // false gives same behaviour
                autoAddListeners : [
                 'collapse',
                 'beforecollapse',
                 'expand',
                 'beforeexpand',
                 'maximize'
                ], 
                getListenerConfig : function() {
                    //var tabPanel = this.container.ownerCt;
                    //var mainTabPanel = tabPanel.ownerCt.ownerCt;
                    return {
                        activate : {
                            fn     : this.flashComponent.show,
                            scope  : this.flashComponent,
                            items : [this.container]//, tabPanel, mainTabPanel]
                        },
                        deactivate : {
                            fn     : this.flashComponent.hide,
                            scope  : this.flashComponent,
                            items : [this.container]//, tabPanel, mainTabPanel]
                        },
                        beforecollapse : {
                            // hideFlashComponent...
                            fn    : 'hideFlashComponent',
                            // ...will be called when this.container's
                            // beforecollapse event triggers
                            scope  : this,
                            strict : false,
                            items : [this.container]
                        },
                        maximize : {
                            // showFlashComponent...
                            fn    : 'showFlashComponent',
                            // ...will be called when this.container's
                            // maximize event triggers
                            scope  : this,
                            strict : false,
                            items : [this.container]
                        },
                        expand : {
                            // showFlashComponent...
                            fn    : 'showFlashComponent',
                            // ...will be called when this.container's
                            // expand event triggers
                            scope  : this,
                            strict : false,
                            items : [this.container]
                        },
                        beforeexpand : {
                            // hideFlashComponent...
                            fn    : 'hideFlashComponent',
                            // ...will be called when this.container's
                            // beforeexpand event triggers
                            scope  : this,
                            strict : false,
                            items : [this.container]
                        },
                        collapse : {
                            // hideFlashComponent...
                            fn    : 'hideFlashComponent',
                            // ...will be called when this.container's
                            // collapse event triggers
                            scope  : this,
                            strict : false,
                            items : [this.container]
                        }
                    };
                }
            });
    Ronald van Raaphorst aka Ronaldo
    I'm a freelance software developer in Java, PHP, and ExtJs.


    Skyperonald_twensoc
    Mailinfo@twensoc.nl

  3. #13
    Sencha User ThorstenSuckow's Avatar
    Join Date
    Sep 2007
    Location
    Aachen, Germany
    Posts
    597
    Vote Rating
    2
    ThorstenSuckow is on a distinguished road

      0  

    Default


    Try the following code.

    Code:
            this.previewPanel = new Ext.Panel({
                title: 'Preview',
                region: 'east',
                layout: 'fit',
                width: '50%',
                collapsible: true,
                split: true,
                tbar: [{ 
                    text:'Reload player',
                    scope: this,
                    handler:function(){ 
                        this.reloadPlayer(this.contentField.getRawValue());
                    } 
                }]
                
                // no need to add this, as the container is just a placeholder and
                // no real container for the flashpanel
                //,items:[this.flashComponent]
                
            });
    
    this.tabPanel = new Ext.TabPanel({
                xtype:'tabpanel',
                activeTab: 0,
                anchor:'0 -65',
                height: 200,
                autoWidth: true,
                hideLabel: true,
                plain: true, 
                items:[{
                     title: 'General',
                     ...
                   }, {
                   title: 'Content',
                   layout:'border',        
                    items: [{
                        title: 'Content',
                        region: 'center',
                        split: true,
                        layout: 'fit',
                        items: [this.contentField] // A textArea
                    }, 
                        this.previewPanel
                    ]
                }]
            });
    
    getFlashComponent: function() {
            return new Ext.FlashComponent({
                // its important to set the FlashComponents hideMode to offsets
                hideMode : 'offsets',
                id : 'dustinthewind',
                swfId : 'dustinthewind', 
                url      : 'http://www.youtube.com/v/1qxSwJC3Ly0&hl=de&fs=1&'
            }); 
        },
        
      
        getFlashControl : function() {
            return new Ext.ux.util.FlashControl({
                flashComponent    : this.flashComponent,
                container         : this.previewPanel,
                autoAddListeners  : true
            });
            
            
        
        // Moved here just to make sure components are available when methods are called
        this.flashComponent = this.getFlashComponent(); 
        this.flashControl = this.getFlashControl();
        

  4. #14
    Sencha User Ronaldo's Avatar
    Join Date
    Jul 2007
    Location
    Enschede, The Netherlands
    Posts
    290
    Vote Rating
    0
    Ronaldo is on a distinguished road

      0  

    Default


    Hi,

    Your fixes work fine! Thanks!

    The flashComponent is on a tab in a tabpanel nested in another tabpanel.
    It would be great if your component could autodetect this and automagically attach listeners to it's parenttabpanels for the beforetabchange and tabchange events...

    I did this for my situation like this, but in general, there's no previewPanel.

    Code:
    getListenerConfig : function() {
                    var pItems = [this.container];
                    var ow = this.container.ownerCt;
                    while(ow != null) {
                        if(ow.constructor.xtype=='tabpanel') {
                            pItems.push(ow);
                        }
                        ow = ow.ownerCt
                    }
    
                    return {
                        beforetabchange: {
                            fn: function(p,newTab,currentTab) {
                                if(newTab.previewPanel != this.container) {
                                    this.hideFlashComponent();
                                } 
                            },
                            scope  : this,
                            items : pItems
                        },
                        tabchange: {
                            fn: function(p,newTab) {
                                if(newTab.previewPanel == this.container) {
                                    this.showFlashComponent();
                                } 
                            },
                            scope  : this,
                            items : pItems
                        },...
    Ronaldo
    Ronald van Raaphorst aka Ronaldo
    I'm a freelance software developer in Java, PHP, and ExtJs.


    Skyperonald_twensoc
    Mailinfo@twensoc.nl

  5. #15
    Sencha User Ronaldo's Avatar
    Join Date
    Jul 2007
    Location
    Enschede, The Netherlands
    Posts
    290
    Vote Rating
    0
    Ronaldo is on a distinguished road

      0  

    Default


    Ow, still a small issue... When I reload the player using

    Code:
            this.previewPanel.remove(this.flashComponent);
            this.flashComponent = this.getFlashComponent(data);
            this.previewPanel.add(this.flashComponent);
            this.doLayout();
    where this is an Ext.Panel, it displays fine.
    However when I now start the flash movie, and then collapse its surrounding panel, the movie stops playing.
    It should continue playing.

    After expanding the panel, the movie has jumpt to the start and is not playing any more.
    It just has something to do with the reloading code above, because this scenario works fine when I don't reload the flashComponent using the code above.

    Best regards,
    Ronaldo
    Last edited by Ronaldo; 31 Jul 2009 at 3:25 AM. Reason: typo
    Ronald van Raaphorst aka Ronaldo
    I'm a freelance software developer in Java, PHP, and ExtJs.


    Skyperonald_twensoc
    Mailinfo@twensoc.nl

  6. #16
    Ext User
    Join Date
    Mar 2009
    Posts
    102
    Vote Rating
    0
    casbar is on a distinguished road

      0  

    Default


    Hello,

    really great Extension... !!
    But I have one problem, when I implement the last version of the ManagedIFrame in my application, and I want to close a window, containing a FlashComponent, the Flash movie doesn't will disappear!

    Any idea?
    Thankyou,
    casbar

    woos WebOS:
    http://www.woos.biz
    My website:
    http://www.casbarro.de


    Contributions:


    myTwitter - Twitter Client: http://extjs.com/forum/showthread.php?t=77234

  7. #17
    Sencha User darkdestruction's Avatar
    Join Date
    Apr 2010
    Posts
    2
    Vote Rating
    0
    darkdestruction is on a distinguished road

      0  

    Thumbs up Fix Bug in Parent Window using "renderTo" attribute

    Fix Bug in Parent Window using "renderTo" attribute


    Hello Folks!,

    I fixed a bug in flashControl Component.
    When you had this component into a window which is child of a "renderTo" attribute Ext.Window, You could not destroy it, causing a crash (the component remained in the Window). Bellow, follow the solution:


    Code:
        
        autoEvents : [        'expand',
            'beforeexpand',
            'collapse',
            'beforecollapse',
            'activate',
            'deactivate',
            'maximize',
            'close' //add "close" to autoEvent 
        ],
    
        autoInstallListeners : function()    {
          //preserve the old code here...
    
             //Destroy flashComponent when the last container is a child Window                    case (container.container):
                            if (activeEvents['close'] && container.getXType() == 'window') {
                                
                                var masterContainer = container.container instanceof Ext.Element? Ext.getCmp(container.container.id):container.container;
                                masterContainer.on('close',this.onDestroy,this);
                                this.appliedListeners.push([
                                    masterContainer, 'close', this.onDestroy, this
                                ]);
                            }
        }
    That worked for me!!!

  8. #18
    Sencha User ThorstenSuckow's Avatar
    Join Date
    Sep 2007
    Location
    Aachen, Germany
    Posts
    597
    Vote Rating
    2
    ThorstenSuckow is on a distinguished road

      0  

    Default


    Sweet, thanks. Which Ext-version did you use with this code?

  9. #19
    Sencha User darkdestruction's Avatar
    Join Date
    Apr 2010
    Posts
    2
    Vote Rating
    0
    darkdestruction is on a distinguished road

      0  

    Default Ext Version

    Ext Version


    I'm using Ext 3.4

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."