Skip to content

Commit

Permalink
fixed video wrapping js
Browse files Browse the repository at this point in the history
  • Loading branch information
imathis committed Apr 4, 2013
1 parent 49a27c9 commit 7dfba9a
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .themes/classic/source/javascripts/octopress.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ function addCodeLineNumbers() {
function flashVideoFallback(){
var flashplayerlocation = "/assets/jwplayer/player.swf",
flashplayerskin = "/assets/jwplayer/glow/glow.xml";
$('video').each(function(video){
$('video').each(function(i, video){
video = $(video);
if (!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") !== -1){
video.children('source[src$=mp4]').first().map(function(i, source){
video.children('source[src$=mp4]').first().map(i, function(source){
var src = $(source).attr('src'),
id = 'video_'+Math.round(1 + Math.random()*(100000)),
width = video.attr('width'),
Expand All @@ -92,18 +92,12 @@ function flashVideoFallback(){
}

function wrapFlashVideos() {
$('object').each(function(object) {
object = $(object);
if ( $('param[name=movie]', object).length ) {
var wrapper = object.before('<div class="flash-video"><div>').previous();
$(wrapper).children().append(object);
$('object').each(function(i, object) {
if( $(object).find('param[name=movie]').length ){
$(object).wrap('<div class="flash-video">')
}
});
$('iframe[src*=vimeo],iframe[src*=youtube]').each(function(iframe) {
iframe = $(iframe);
var wrapper = iframe.before('<div class="flash-video"><div>').previous();
$(wrapper).children().append(iframe);
});
$('iframe[src*=vimeo],iframe[src*=youtube]').wrap('<div class="flash-video">')
}

function renderDeliciousLinks(items) {
Expand Down

0 comments on commit 7dfba9a

Please sign in to comment.