Ext.Media "preload" configuration variable ignored
REQUIRED INFORMATION
Ext version tested:
Browser versions tested against:- Safari 6
- Chrome 21.0.1180.89
DOCTYPE tested against:
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});
}
});