Results 1 to 4 of 4

Thread: Ext.Media "preload" configuration variable ignored

Hybrid View

Previous Post Previous Post   Next Post Next Post
    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
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,416
    Vote Rating
    1270
      0  

    Default

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

  3. #3
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,416
    Vote Rating
    1270
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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
      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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •