Improved experience on small screens

This commit is contained in:
Sam Potts 2015-02-15 15:15:28 +11:00
parent caeb63f197
commit 801ae4fc1a
4 changed files with 23 additions and 15 deletions

View File

@ -22,6 +22,7 @@
// Default config // Default config
var defaults = { var defaults = {
enabled: true, // /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)
debug: false, debug: false,
seekInterval: 10, seekInterval: 10,
volume: 5, volume: 5,
@ -866,6 +867,11 @@
// Extend the default options with user specified // Extend the default options with user specified
config = extend(defaults, options); config = extend(defaults, options);
// If enabled carry on
if(!config.enabled) {
return false;
}
// Setup the fullscreen api // Setup the fullscreen api
fullscreen = fullscreenApi(); fullscreen = fullscreenApi();
@ -888,15 +894,6 @@
return false; return false;
} }
// If smartphone or tablet, stop customization as video (and captions in latest devices) are handled natively
player.isSmartphoneOrTablet = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent);
if (player.isSmartphoneOrTablet) {
if(config.debug) {
console.error("Browser not suppported.");
}
return false;
}
// Set up aria-label for Play button with the title option // Set up aria-label for Play button with the title option
if (typeof(config.title) === "undefined" || !config.title.length) { if (typeof(config.title) === "undefined" || !config.title.length) {
config.playAriaLabel = "Play"; config.playAriaLabel = "Play";

View File

@ -123,10 +123,14 @@
padding: 20px; padding: 20px;
min-height: 2.5em; min-height: 2.5em;
color: #fff; color: #fff;
font-size: 24px; font-size: 16px;
text-shadow: 0 1px 1px rgba(0,0,0, .75); text-shadow: 0 1px 1px rgba(0,0,0, .75);
text-align: center; text-align: center;
.font-smoothing(); .font-smoothing();
@media (min-width: 560px) {
font-size: 24px;
}
} }
&.captions-active &-captions { &.captions-active &-captions {
display: block; display: block;
@ -352,9 +356,18 @@
} }
.player-captions { .player-captions {
top: auto; top: auto;
bottom: 90px;
@media (min-width: 560px) and (max-width: 767px) {
bottom: 60px;
}
@media (min-width: 768px) {
bottom: 80px; bottom: 80px;
} }
} }
}
.player-controls { .player-controls {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@ -391,8 +404,6 @@
.video-controls .player-volume { .video-controls .player-volume {
position: relative; position: relative;
padding: 0; padding: 0;
//height: 8px;
//top: -3px;
} }
.player-time { .player-time {
margin-top: 4px; margin-top: 4px;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long