Use Modernizr to check for <video> support and show an error messag if absent.
This commit is contained in:
parent
80060b37c1
commit
471e0eb820
@ -199,6 +199,14 @@ a:hover {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#video-unsupported {
|
||||
background-image: url(../img/video-unsupported.png);
|
||||
background-position: top center;
|
||||
background-repeat: no-repeat;
|
||||
padding-top: 96px;
|
||||
}
|
||||
|
||||
#auth-text input {
|
||||
color: rgb(0, 0, 0);
|
||||
background-color: rgb(200, 200, 200);
|
||||
|
BIN
web/img/video-unsupported.png
Normal file
BIN
web/img/video-unsupported.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
1393
web/js/005-modernizr.js
Normal file
1393
web/js/005-modernizr.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -147,7 +147,8 @@ $(document).ready(function() {
|
||||
$("#album-view").removeClass("photo-view-container");
|
||||
$("#subalbums").show();
|
||||
$("#photo-view").hide();
|
||||
$("#video").remove();
|
||||
$("#video-box-inner").empty();
|
||||
$("#video-box").hide();
|
||||
}
|
||||
setTimeout(scrollToThumb, 1);
|
||||
}
|
||||
@ -182,18 +183,26 @@ $(document).ready(function() {
|
||||
}
|
||||
function showPhoto() {
|
||||
var width, height, photoSrc, videoSrc, previousPhoto, nextPhoto, nextLink, text;
|
||||
width = currentPhoto.size[0];
|
||||
height = currentPhoto.size[1];
|
||||
|
||||
if (currentPhoto.mediaType == "video") {
|
||||
width = currentPhoto.size[0];
|
||||
height = currentPhoto.size[1];
|
||||
$(window).unbind("resize", scaleVideo);
|
||||
$(window).unbind("resize", scaleImage);
|
||||
videoSrc = photoFloat.videoPath(currentAlbum, currentPhoto);
|
||||
$('<video/>', { 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);
|
||||
if (!Modernizr.video) {
|
||||
$('<div id="video-unsupported"><p>Sorry, your browser doesn\'t support the HTML5 <video> element!</p><p>Here\'s a <a href="http://caniuse.com/video">list of which browsers do</a>.</p></div>').appendTo('#video-box-inner');
|
||||
}
|
||||
else if (Modernizr.video.webm) {
|
||||
$('<div id="video-unsupported"><p>Sorry, your browser doesn\'t support the WebM video format!</p></div>').appendTo('#video-box-inner');
|
||||
}
|
||||
else {
|
||||
$(window).unbind("resize", scaleVideo);
|
||||
$(window).unbind("resize", scaleImage);
|
||||
videoSrc = photoFloat.videoPath(currentAlbum, currentPhoto);
|
||||
$('<video/>', { 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("<link rel=\"video_src\" href=\"" + videoSrc + "\" />");
|
||||
$("#video-box-inner").css('height', height + 'px').css('margin-top', - height / 2);
|
||||
$("#photo-box").hide();
|
||||
@ -219,7 +228,7 @@ $(document).ready(function() {
|
||||
.attr("title", currentPhoto.date)
|
||||
.load(scaleImage);
|
||||
$("head").append("<link rel=\"image_src\" href=\"" + photoSrc + "\" />");
|
||||
$("#video").remove();
|
||||
$("#video-box-inner").empty();
|
||||
$("#video-box").hide();
|
||||
$("#photo-box").show();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user