Yes, I can confirm both of your questions.
http://media.myserver.dk/28/3849 is a .jpg file path, and the picture shows up in the browser (Firefox) if i type it into the address bar. I can also load it the the mx.controls.Image class as in both the examples (AS3 and MXML). But I cannot load it into OSMF as in the example i provide.
I read in some post (sorry, can't remember where), that metadata only applys for videos (?), and that a metadata workaround was upcoming (or present) for video urls with no file extension. But i have not tried that out myself.
In the osmf.elements.ImageLoader this method (from the osmf framework) search the url for file extensions in the url string, so if it is a framework but, then this could be it (?):
* Indicates whether this ImageLoader is capable of handling the specified resource.
* Returns <code>true</code> for URLResources with GIF, JPG, or PNG extensions.
* @param resource Resource proposed to be loaded.
override public function canHandleResource(resource:MediaResourceBase):Boolean
var rt:int = MediaTypeUtil.checkMetadataMatchWithResource(resource, MEDIA_TYPES_SUPPORTED, MIME_TYPES_SUPPORTED);
if (rt != MediaTypeUtil.METADATA_MATCH_UNKNOWN)
return rt == MediaTypeUtil.METADATA_MATCH_FOUND;
var urlResource:URLResource = resource as URLResource;
if (urlResource != null &&
urlResource.url != null)
var url:URL = new URL(urlResource.url);
return (url.path.search(/\.gif$|\.jpg$|\.png$/i) != -1);
Anyway it should be possible to apply the image filetype as metadata for urls like this one http://media.myserver.dk/28/3849. Or if it could be possible to setup an default fallback filetype for theese kind of urls. An even better solution would be if the framework could recognize the type of image filetype (as it seems the mx.controls.Image class do), but I am not sure how to implement this.
It would be great if you would log it as a bug - please confirm when it is done, or I will do it later. Thanks!
"myserver" is an alias for my company's media server.
I have found a workaround for urls not containing the filetype extension:
var url:String = "http://media.myserver.dk/28/3849?height=400"; // <- jpg file path
var element:ImageElement = new ImageElement();
element.resource = new URLResource( url );
element.resource.mediaType = MediaType.IMAGE;
By setting the MediayType specifically to image, the ImageElement component can load the url even if the filetype is not present in the url string. If the url contains "'.jpg", ".gif" og ".png", then it is not nessesary to explicit define the MediaType for the element's resource.
Im not sure if this is intended use of the MediaType class or a workaround. It seems counterintuitive that i have to set the MediaType to IMAGE for an ImageElement.
Yes, that is exactly the way to load an image that has no file extension. This is not a design flaw of OSMF because for this type of URL, there is really no way to figure out what is the media type except for getting helps from the client. Think about it, the URL can potentially point to any file type, an FLV file, F4M file for http streaming, or anything.
Senior Computer Scientist
Adobe Systems, Inc.