diff --git a/web/js/011-display.js b/web/js/011-display.js
index c9b6c78..5e73920 100644
--- a/web/js/011-display.js
+++ b/web/js/011-display.js
@@ -183,32 +183,31 @@ $(document).ready(function() {
}
function showPhoto() {
var width, height, photoSrc, videoSrc, previousPhoto, nextPhoto, nextLink, text;
- width = currentPhoto.size[0];
- height = currentPhoto.size[1];
+ width = currentPhoto.size[0];
+ height = currentPhoto.size[1];
if (currentPhoto.mediaType == "video") {
- if (!Modernizr.video) {
- $('
').appendTo('#video-box-inner');
- }
- else if (!Modernizr.video.h264) {
- $('Sorry, your browser doesn\'t support the H.264 video format!
').appendTo('#video-box-inner');
- }
- else {
- $(window).unbind("resize", scaleVideo);
- $(window).unbind("resize", scaleImage);
- videoSrc = photoFloat.videoPath(currentAlbum, currentPhoto);
- $('', { id: 'video', controls: true }).appendTo('#video-box-inner')
- .attr("width", width).attr("height", height).attr("ratio", currentPhoto.size[0] / currentPhoto.size[1])
- .attr("src", videoSrc)
- .attr("alt", currentPhoto.name)
- .on('loadstart', scaleVideo);
- }
+ $("#video-box-inner").empty();
+ if (!Modernizr.video) {
+ $('').appendTo('#video-box-inner');
+ }
+ else if (!Modernizr.video.h264) {
+ $('Sorry, your browser doesn\'t support the H.264 video format!
').appendTo('#video-box-inner');
+ } else {
+ $(window).unbind("resize", scaleVideo);
+ $(window).unbind("resize", scaleImage);
+ videoSrc = photoFloat.videoPath(currentAlbum, currentPhoto);
+ $('', { id: 'video', controls: true }).appendTo('#video-box-inner')
+ .attr("width", width).attr("height", height).attr("ratio", currentPhoto.size[0] / currentPhoto.size[1])
+ .attr("src", videoSrc)
+ .attr("alt", currentPhoto.name)
+ .on('loadstart', scaleVideo);
+ }
$("head").append("");
$("#video-box-inner").css('height', height + 'px').css('margin-top', - height / 2);
$("#photo-box").hide();
$("#video-box").show();
- }
- else {
+ } else {
width = currentPhoto.size[0];
height = currentPhoto.size[1];
if (width > height) {