Skip to content

Commit 7e36975

Browse files
committed
Tweak button styles, fix Safari visible focus bug
1 parent 23335e5 commit 7e36975

File tree

10 files changed

+42
-117
lines changed

10 files changed

+42
-117
lines changed

build/ableplayer.dist.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3663,8 +3663,8 @@
36633663
// Removed rewind/forward in favor of seek bar.
36643664

36653665
var controlLayout = {
3666-
'ul': ['play','restart'],
3667-
'ur': ['rewind','forward','seek'],
3666+
'ul': ['play','restart','rewind','forward'],
3667+
'ur': ['seek'],
36683668
'bl': [],
36693669
'br': []
36703670
}
@@ -6912,7 +6912,7 @@
69126912

69136913
var thisObj, duration, elapsed, lastChapterIndex, displayElapsed,
69146914
updateLive, textByState, timestamp, widthUsed,
6915-
leftControls, rightControls, seekbarWidth, captionsCount,
6915+
leftControls, rightControls, seekbarWidth, seekbarSpacer, captionsCount,
69166916
buffered, newTop, svgLink, newSvgLink;
69176917

69186918
thisObj = this;
@@ -7098,6 +7098,8 @@
70987098
// To do this, we need to calculate the width of all buttons surrounding it.
70997099
if (this.seekBar) {
71007100
widthUsed = 0;
7101+
seekbarSpacer = 40; // adjust for discrepancies in browsers' calculated button widths
7102+
71017103
leftControls = this.seekBar.wrapperDiv.parent().prev('span.able-left-controls');
71027104
rightControls = leftControls.next('span.able-right-controls');
71037105
leftControls.children().each(function () {
@@ -7111,15 +7113,12 @@
71117113
}
71127114
});
71137115
if (this.isFullscreen()) {
7114-
seekbarWidth = $(window).width() - widthUsed - 20;
7116+
seekbarWidth = $(window).width() - widthUsed - seekbarSpacer;
71157117
}
71167118
else {
7117-
seekbarWidth = this.$ableWrapper.width() - widthUsed - 20;
7118-
}
7119-
// Sometimes some minor fluctuations based on browser weirdness, so set a threshold.
7120-
if (Math.abs(seekbarWidth - this.seekBar.getWidth()) > 5) {
7121-
this.seekBar.setWidth(seekbarWidth);
7119+
seekbarWidth = this.$ableWrapper.width() - widthUsed - seekbarSpacer;
71227120
}
7121+
this.seekBar.setWidth(seekbarWidth);
71237122
}
71247123

71257124
if (this.$descButton) {

build/ableplayer.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3663,8 +3663,8 @@
36633663
// Removed rewind/forward in favor of seek bar.
36643664

36653665
var controlLayout = {
3666-
'ul': ['play','restart'],
3667-
'ur': ['rewind','forward','seek'],
3666+
'ul': ['play','restart','rewind','forward'],
3667+
'ur': ['seek'],
36683668
'bl': [],
36693669
'br': []
36703670
}
@@ -6912,7 +6912,7 @@
69126912

69136913
var thisObj, duration, elapsed, lastChapterIndex, displayElapsed,
69146914
updateLive, textByState, timestamp, widthUsed,
6915-
leftControls, rightControls, seekbarWidth, captionsCount,
6915+
leftControls, rightControls, seekbarWidth, seekbarSpacer, captionsCount,
69166916
buffered, newTop, svgLink, newSvgLink;
69176917

69186918
thisObj = this;
@@ -7098,6 +7098,8 @@
70987098
// To do this, we need to calculate the width of all buttons surrounding it.
70997099
if (this.seekBar) {
71007100
widthUsed = 0;
7101+
seekbarSpacer = 40; // adjust for discrepancies in browsers' calculated button widths
7102+
71017103
leftControls = this.seekBar.wrapperDiv.parent().prev('span.able-left-controls');
71027104
rightControls = leftControls.next('span.able-right-controls');
71037105
leftControls.children().each(function () {
@@ -7111,15 +7113,12 @@
71117113
}
71127114
});
71137115
if (this.isFullscreen()) {
7114-
seekbarWidth = $(window).width() - widthUsed - 20;
7116+
seekbarWidth = $(window).width() - widthUsed - seekbarSpacer;
71157117
}
71167118
else {
7117-
seekbarWidth = this.$ableWrapper.width() - widthUsed - 20;
7118-
}
7119-
// Sometimes some minor fluctuations based on browser weirdness, so set a threshold.
7120-
if (Math.abs(seekbarWidth - this.seekBar.getWidth()) > 5) {
7121-
this.seekBar.setWidth(seekbarWidth);
7119+
seekbarWidth = this.$ableWrapper.width() - widthUsed - seekbarSpacer;
71227120
}
7121+
this.seekBar.setWidth(seekbarWidth);
71237122
}
71247123

71257124
if (this.$descButton) {

build/ableplayer.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/ableplayer.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/video5.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ <h1>Able Player Video Demo #5:<br/>Video player with interactive transcript, sub
2424

2525
<p>For additional demos see the <a href="index.html">Index of <em>Able Player</em> Examples</a>.</p>
2626

27-
<video id="video1" preload="auto" width="480" height="360" poster="../media/wwa.jpg" data-able-player data-seekbar-scope="video" data-icon-type="font" data-speed-icons="animals">
27+
<video id="video1" preload="auto" width="480" height="360" poster="../media/wwa.jpg" data-able-player data-speed-icons="animals">
2828
<source type="video/webm" src="../media/wwa.webm" data-desc-src="../media/wwa_described.webm"/>
2929
<source type="video/mp4" src="../media/wwa.mp4" data-desc-src="../media/wwa_described.mp4"/>
3030
<!-- Able Player will display tracks alphabetically by label -->
31-
<track kind="captions" src="../media/wwa_captions_en.vtt" srclang="en" label="English"/>
32-
<!--
3331
<track kind="subtitles" src="../media/wwa_captions_es.vtt" srclang="es" label="Espanol"/>
32+
<track kind="captions" src="../media/wwa_captions_en.vtt" srclang="en" label="English"/>
3433
<track kind="descriptions" src="../media/wwa_description_en.vtt" srclang="en"/>
3534
<track kind="descriptions" src="../media/wwa_description_es.vtt" srclang="es"/>
3635
<track kind="chapters" src="../media/wwa_chapters_en.vtt" srclang="en"/>
37-
-->
3836
</video>
3937

4038
</body>

media/windows.vtt

Lines changed: 0 additions & 64 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ableplayer",
3-
"version": "2.3.66",
3+
"version": "2.3.67",
44
"description": "fully accessible HTML5 media player",
55
"homepage": "http://ableplayer.github.io/ableplayer",
66
"bugs": "https://github.com/ableplayer/ableplayer/issues",

scripts/buildplayer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,8 @@
863863
// Removed rewind/forward in favor of seek bar.
864864

865865
var controlLayout = {
866-
'ul': ['play','restart'],
867-
'ur': ['rewind','forward','seek'],
866+
'ul': ['play','restart','rewind','forward'],
867+
'ur': ['seek'],
868868
'bl': [],
869869
'br': []
870870
}

scripts/control.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235

236236
var thisObj, duration, elapsed, lastChapterIndex, displayElapsed,
237237
updateLive, textByState, timestamp, widthUsed,
238-
leftControls, rightControls, seekbarWidth, captionsCount,
238+
leftControls, rightControls, seekbarWidth, seekbarSpacer, captionsCount,
239239
buffered, newTop, svgLink, newSvgLink;
240240

241241
thisObj = this;
@@ -421,6 +421,8 @@
421421
// To do this, we need to calculate the width of all buttons surrounding it.
422422
if (this.seekBar) {
423423
widthUsed = 0;
424+
seekbarSpacer = 40; // adjust for discrepancies in browsers' calculated button widths
425+
424426
leftControls = this.seekBar.wrapperDiv.parent().prev('span.able-left-controls');
425427
rightControls = leftControls.next('span.able-right-controls');
426428
leftControls.children().each(function () {
@@ -434,15 +436,12 @@
434436
}
435437
});
436438
if (this.isFullscreen()) {
437-
seekbarWidth = $(window).width() - widthUsed - 20;
439+
seekbarWidth = $(window).width() - widthUsed - seekbarSpacer;
438440
}
439441
else {
440-
seekbarWidth = this.$ableWrapper.width() - widthUsed - 20;
441-
}
442-
// Sometimes some minor fluctuations based on browser weirdness, so set a threshold.
443-
if (Math.abs(seekbarWidth - this.seekBar.getWidth()) > 5) {
444-
this.seekBar.setWidth(seekbarWidth);
442+
seekbarWidth = this.$ableWrapper.width() - widthUsed - seekbarSpacer;
445443
}
444+
this.seekBar.setWidth(seekbarWidth);
446445
}
447446

448447
if (this.$descButton) {

styles/ableplayer.css

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,25 +151,19 @@
151151
position: relative;
152152
display: inline-block;
153153
border-style: none;
154-
margin: 0;
154+
margin: 3px;
155155
padding: 0;
156156
font-size: 20px;
157-
width: 40px;
158-
min-width: 20px;
159-
overflow: hidden !important;
157+
min-width: 24px;
158+
outline: 2px solid #464646; /* same color as .able-controller background-color */
159+
border: none;
160+
overflow: visible !important;
160161
z-index: 6600;
161162
}
162-
.able-controller button > span {
163-
/* icomoon font icon */
164-
font-size: 20px;
165-
width: 24px;
166-
margin: 0 5px;
167-
padding: 0;
168-
z-index: 6700;
169-
}
163+
.able-controller button > span,
170164
.able-controller button > img {
171-
/* image icon */
172-
margin: 0 5px;
165+
width: 20px;
166+
margin: 0 auto;
173167
padding: 0;
174168
z-index: 6700;
175169
}

0 commit comments

Comments
 (0)