Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3391 in a recent build.
  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    8
    Vote Rating
    0
    Samuel Horwitz is on a distinguished road

      0  

    Default Ext.Media "preload" configuration variable ignored

    Ext.Media "preload" configuration variable ignored


    REQUIRED INFORMATION


    Ext version tested:
    • Sencha Touch 2.0.1

    Browser versions tested against:
    • Safari 6
    • Chrome 21.0.1180.89

    DOCTYPE tested against:
    • HTML5

    Description:
    • Setting the "preload" variable on a media element such as Video does not actually have any effect.

    Steps to reproduce the problem:
    • Create an Ext.Video
    • Use "preload" config attribute (which defaults to "true")
    • Note how nothing actually happens in the DOM with the preload attribute and the video will preload no matter what (default handling by browser)

    The result that was expected:
    • Setting preload to false should prevent preloading and add an attribute to video element 'preload="none"'
    • Otherwise, preload should be 'preload="auto"' or just non-existant (this works because of default behavior)

    The result that occurs instead:
    • The preload attribute has no bearing on the DOM or the preloading of the video

    Test Case:

    Code:
        Ext.create('Ext.Video', config:{preload: false, url: '<VIDEO URL HERE>'});


    HELPFUL INFORMATION


    Debugging already done:
    • Preload just simply has no bearing on anything once set

    Possible fix:
    Code:
    Ext.define('YourProject.Media', {
    	override: 'Ext.Media',
    
    	applyPreload: function(preload)
    	{
    		if (preload === true)
    		{
    			preload = 'auto';
    		}
    		else if (preload === false)
    		{
    			preload = 'none';
    		}
    		else if (Ext.isString(preload) == false)
    		{
    			preload = 'auto';
    		}
    
    		return preload;
    	},
    
    	updatePreload: function(newPreload, oldPreload)
    	{
    		var media = this.media,
    			dom = media.dom,
    			el = Ext.get(dom);
    
    		el.set({preload: newPreload});
    	}
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Should make it into 2.1.0 b3. You can pass true or false but also the strings 'auto', 'metadata' and 'none'.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #4
    Sencha User
    Join Date
    Sep 2012
    Posts
    8
    Vote Rating
    1
    dhennen is on a distinguished road

      0  

    Default


    Did this make it into the 2.1.0 final release? I still see this bug on our site and looking at the Sencha source it seems nothing is done with the preload attribute.

Thread Participants: 2

Tags for this Thread