Skip to content

Commit

Permalink
Added call to progress polyfill (where needed) after multimedia playe…
Browse files Browse the repository at this point in the history
…r interface has loaded.
  • Loading branch information
Paul Jackson authored and Paul Jackson committed Aug 16, 2012
1 parent 821da4c commit 16687bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/js/pe-ap-min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/js/pe-ap.js
Expand Up @@ -893,7 +893,7 @@
}
});
// Find all elements that match the element selector
all_elms = $(non_deps.join(','));
all_elms = $(non_deps.join(',')).filter(':not(".polyfill")');
// Process each polyfill
$.each(polyfills, function (polyname, polyprefs) {
var elms = all_elms.filter(polyprefs.selector),
Expand All @@ -910,6 +910,9 @@
// Polyfill is needed and has no dependencies so load now
loadnow[polyname] = elms;
}
$('html').addClass('polyfill-' + polyname);
} else {
$('html').addClass(polyname);
}
}
});
Expand Down
5 changes: 4 additions & 1 deletion src/js/workers/multimedia.js
Expand Up @@ -102,6 +102,9 @@
//Add the interface
$.extend(elm.get(0), {object: media.get(0)}, _pe.fn.multimedia._intf);
media.after(_pe.fn.multimedia._get_ui(media_id));
if ($('html').hasClass('polyfill-progress')) {
elm.find('progress').progress();
}

//Scale the UI when the video scales
$(window).on('resize', {'media' : media, width : width, height : height}, function (e) {
Expand Down Expand Up @@ -219,6 +222,7 @@
p = this.getCurrentTime() / this.getDuration();
timeline = $w.find('.wet-boew-multimedia-timeline progress');
timeline.attr('value',p);

//Update captions
if ($.data(e.target, 'captions') !== undefined) {
_pe.fn.multimedia._update_captions($w.find('.wet-boew-multimedia-captionsarea'), this.getCurrentTime(), $.data(e.target, 'captions'));
Expand All @@ -243,7 +247,6 @@
}
}


return elm;
}, // end of exec

Expand Down

0 comments on commit 16687bf

Please sign in to comment.