-
4 Sep 2012 9:42 AM #1
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}); } });
-
4 Sep 2012 10:00 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
Thanks for the report! I have opened a bug in our bug tracker.
-
4 Sep 2012 10:13 AM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
13 Dec 2012 12:18 PM #4
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.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3391
in
Sprint 24 (2.1.0-b3).


Reply With Quote