Getting Started with Primary Sources
' +
title +
' ' +
'
';
$('.mejs__layers', container).prepend(title_element);
}
}
});
cache[id]['mediaelement'] = mediaelement;
$('audio, video', container).on('update-playlist', function(event, new_media, container_id, callback){
var container = $('#' + container_id).get(0),
id = container.id,
player = cache[id].player,
mediaelement = cache[id].mediaelement,
media_parent;
if(container_id != id){
// This is not the container we triggered it on
return;
}
if(!player.paused) {
mediaelement.pause();
}
mediaelement.remove();
media_parent = $('audio, video', container).parent();
media_parent.empty();
media_parent.append(new_media);
initialize_playlist(new_media, callback);
});
};
$('.media-playlist-container audio, .media-playlist-container video').each(function(index, mediaElement){
initialize_playlist(mediaElement);
});
});
Teaching with the Library of Congress Blog