Because `_this.getVideoMetadata` returns `Deffered` object we can use following code instead:
```javascript
var metadataXHRs = [];
$.each(this.videos, function (speed, url) {
    var xhr = _this.getVideoMetadata(url, function (data) {
        if (data.data) {
            _this.metadata[data.data.id] = data.data;                
        }
    });

    metadataXHRs.push(xhr);
})

$.when.apply(this, metadataXHRs).done(function () {
    _this.el.trigger('metadata_received');
});
```