Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
c103f75
Change default skin to "2020"
terrill Nov 11, 2022
f576704
Remove data-skin="2020" attribs from all demos
terrill Nov 11, 2022
9dc0013
[CLEANUP] TABs & colors
xerc Nov 20, 2022
5e1adce
[REMOVE] IE rules
xerc Nov 20, 2022
02c8428
[CLS] 9dc0013
xerc Nov 20, 2022
ff01b78
[CLEANUP] indentation @ `vimeo.js`
xerc Nov 20, 2022
a9af6f6
[CLEANUP] scripts/
xerc Nov 20, 2022
ac5f507
[FIX] VIMEO usage
xerc Nov 26, 2022
ad9f60a
[ADD] noreferrer @ credits-links
xerc Nov 26, 2022
53c91b7
[CLEANUP] more indentation
xerc Nov 26, 2022
d442e83
[CLEANUP] even more ident/tabs
xerc Nov 26, 2022
4346cf5
Added https: to dependencies
candideu Dec 7, 2022
fab3bd5
Too -> to
candideu Dec 7, 2022
7e9cad3
Merge pull request #1 from candideu/main
candideu Dec 7, 2022
4e3ab2e
Merge pull request #561 from candideu/develop
terrill Dec 8, 2022
45c8815
Merge branch 'patch-1' of https://github.com/xerc/ableplayer into xer…
terrill Dec 8, 2022
1df2a2f
Merge branch 'xerc-patch-1' into develop
terrill Dec 8, 2022
d657a71
Merge pull request #557 from xerc/patch-2
terrill Dec 8, 2022
28a99d7
Merge pull request #558 from xerc/patch-3
terrill Dec 8, 2022
c6b95db
Increment version
terrill Dec 8, 2022
abb33b7
Handle failure of Safari on Mac OS to getVoices for speechSynthesis
terrill Dec 11, 2022
f3f095e
Added a screenshot of the player
candideu Mar 24, 2023
60b0c0a
Improve speech initialization for Linux browsers
jbylsma Apr 11, 2023
10385d3
Merge branch 'jbylsma-improve-speech-support' into develop
terrill May 24, 2023
c11e0d8
Merge pull request #573 from candideu/patch-1
terrill May 24, 2023
480456f
Add YouTube (no captions) demo
terrill Jun 13, 2023
85c1fc4
Merge branch 'develop' of github.com:ableplayer/ableplayer into develop
terrill Jun 13, 2023
d7286b1
revert typo from early 2021
conorom Jul 24, 2023
6c41745
Add polish translation
zwiastunsw Mar 14, 2024
43fbd77
resolve problems
zwiastunsw Mar 16, 2024
2c9a4f3
fix typo
zwiastunsw Mar 26, 2024
e129d08
merge main into develop with 4.5.1 patch
jeanem Mar 7, 2025
e551e94
updating current develop version
jeanem Mar 7, 2025
f4a4430
Merge branch 'main' into develop
jeanem Mar 14, 2025
28f7d59
update to develop version
jeanem Mar 21, 2025
3c860a0
Merge pull request #595 from lepszyweb/polish-translation
joedolson May 4, 2025
2cb3f6a
Merge pull request #583 from conorom/571/geteferences_typo
joedolson May 4, 2025
f3662ab
Change 'lead developer' to 'original lead developer'.
joedolson May 6, 2025
4f15b20
Change copyright to Able Player Contributors
joedolson May 6, 2025
6b008e6
The translations object has these camel-cased with 'screen' as a sepa…
joedolson May 24, 2025
ec804b0
Replace deprecated `.click()` with `.trigger( 'click' );`
joedolson May 24, 2025
cbc6d33
Replace deprecated .focus() in demos
joedolson May 24, 2025
7316ecf
Replace jquery `.focus()` with `.trigger( 'focus' )`
joedolson May 24, 2025
af166de
Replace .click() in demos.
joedolson May 25, 2025
e55c22c
Replace .click() with .on( 'click'
joedolson May 25, 2025
63e1a82
Replace instances of $.trim() with .trim()
joedolson May 25, 2025
b1d05bb
Replace .change() with .on( 'change'
joedolson May 25, 2025
e7fa7d3
Replace .keydown with .on( 'keydown'
joedolson May 25, 2025
69caf80
Use 'inert' to change interactivity state of non-modal content.
joedolson May 25, 2025
6f682d0
Replace jQuery isNumeric with vanilla JS numeric check.
joedolson May 25, 2025
913eb71
typeof needs to compare to a string, not a var.
joedolson May 25, 2025
a82fa2a
Firefox no longer requires the orient attribute or the slider-vertica…
joedolson May 25, 2025
3c3bf47
Switch to lr to keep previous appearance.
joedolson May 25, 2025
e2bd655
Remove the `role` and `aria-label` on transcript containers if they a…
joedolson May 25, 2025
6521b22
When fullscreen on narrow screens, using vw caption units is too small.
joedolson May 25, 2025
7b6a59e
Remove console.log
joedolson May 25, 2025
176fdb8
Update PR 575
joedolson May 25, 2025
dac86c7
Merge branch 'main' into fix-unbind-click-event
joedolson Jun 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[CLEANUP] scripts/
  • Loading branch information
xerc committed Nov 20, 2022
commit a9af6f6c29b113c189281fc12332d34221705fec
99 changes: 49 additions & 50 deletions scripts/ableplayer-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ var AblePlayerInstances = [];

(function ($) {
$(function () {

$('video, audio').each(function (index, element) {
if ($(element).data('able-player') !== undefined) {
AblePlayerInstances.push(new AblePlayer($(this),$(element)));
Expand Down Expand Up @@ -88,14 +87,14 @@ var AblePlayerInstances = [];

// autoplay (Boolean; if present always resolves to true, regardless of value)
if ($(media).attr('autoplay') !== undefined) {
this.autoplay = true; // this value remains constant
this.autoplay = true; // this value remains constant
this.okToPlay = true; // this value can change dynamically
}
else {
this.autoplay = false;
this.okToPlay = false;
}

// loop (Boolean; if present always resolves to true, regardless of value)
if ($(media).attr('loop') !== undefined) {
this.loop = true;
Expand All @@ -120,13 +119,13 @@ var AblePlayerInstances = [];
this.hasPoster = false;
}

// get height and width attributes, if present
// and add them to variables
// Not currently used, but might be useful for resizing player
if ($(media).attr('width')) {
this.width = $(media).attr('width');
// get height and width attributes, if present
// and add them to variables
// Not currently used, but might be useful for resizing player
if ($(media).attr('width')) {
this.width = $(media).attr('width');
}
if ($(media).attr('height')) {
if ($(media).attr('height')) {
this.height = $(media).attr('height');
}

Expand Down Expand Up @@ -177,13 +176,13 @@ var AblePlayerInstances = [];
else {
this.useChaptersButton = true;
}
// Control whether text descriptions are read aloud

// Control whether text descriptions are read aloud
// set to "false" if the sole purpose of the WebVTT descriptions file
// is to integrate text description into the transcript
// set to "true" to write description text to a div
// This variable does *not* control the method by which description is read.
// For that, see below (this.descMethod)
// set to "true" to write description text to a div
// This variable does *not* control the method by which description is read.
// For that, see below (this.descMethod)
if ($(media).data('descriptions-audible') !== undefined && $(media).data('descriptions-audible') === false) {
this.readDescriptionsAloud = false;
}
Expand All @@ -195,24 +194,24 @@ var AblePlayerInstances = [];
this.readDescriptionsAloud = true;
}

// Method by which text descriptions are read
// Method by which text descriptions are read
// valid values of data-desc-reader are:
// 'brower' (default) - text-based audio description is handled by the browser, if supported
// 'screenreader' - text-based audio description is always handled by screen readers
// The latter may be preferable by owners of websites in languages that are not well supported
// by the Web Speech API
// 'brower' (default) - text-based audio description is handled by the browser, if supported
// 'screenreader' - text-based audio description is always handled by screen readers
// The latter may be preferable by owners of websites in languages that are not well supported
// by the Web Speech API
if ($(media).data('desc-reader') == 'screenreader') {
this.descReader = 'screenreader';
}
else {
this.descReader = 'browser';
}

// Default state of captions and descriptions
// This setting is overridden by user preferences, if they exist
// values for data-state-captions and data-state-descriptions are 'on' or 'off'
// Default state of captions and descriptions
// This setting is overridden by user preferences, if they exist
// values for data-state-captions and data-state-descriptions are 'on' or 'off'
if ($(media).data('state-captions') == 'off') {
this.defaultStateCaptions = 0; // off
this.defaultStateCaptions = 0; // off
}
else {
this.defaultStateCaptions = 1; // on by default
Expand All @@ -224,13 +223,13 @@ var AblePlayerInstances = [];
this.defaultStateDescriptions = 0; // off by default
}

// Default setting for prefDescPause
// Extended description (i.e., pausing during description) is on by default
// but this settings give website owners control over that
// since they know the nature of their videos, and whether pausing is necessary
// This setting is overridden by user preferences, if they exist
// Default setting for prefDescPause
// Extended description (i.e., pausing during description) is on by default
// but this settings give website owners control over that
// since they know the nature of their videos, and whether pausing is necessary
// This setting is overridden by user preferences, if they exist
if ($(media).data('desc-pause-default') == 'off') {
this.defaultDescPause = 0; // off
this.defaultDescPause = 0; // off
}
else {
this.defaultDescPause = 1; // on by default
Expand Down Expand Up @@ -276,7 +275,7 @@ var AblePlayerInstances = [];
if (this.transcriptSrcHasRequiredParts()) {
this.transcriptType = 'manual';
}
else {
else {
console.log('ERROR: Able Player transcript is missing required parts');
}
}
Expand Down Expand Up @@ -390,22 +389,22 @@ var AblePlayerInstances = [];
this.skin = 'legacy';
}

// Size
// width of Able Player is determined using the following order of precedence:
// 1. data-width attribute
// Size
// width of Able Player is determined using the following order of precedence:
// 1. data-width attribute
// 2. width attribute (for video or audio, although it is not valid HTML for audio)
// 3. Intrinsic size from video (video only, determined later)
if ($(media).data('width') !== undefined) {
this.playerWidth = parseInt($(media).data('width'));
}
else if ($(media)[0].getAttribute('width')) {
// NOTE: jQuery attr() returns null for all invalid HTML attributes
// NOTE: jQuery attr() returns null for all invalid HTML attributes
// (e.g., width on <audio>)
// but it can be acessed via JavaScript getAttribute()
// but it can be acessed via JavaScript getAttribute()
this.playerWidth = parseInt($(media)[0].getAttribute('width'));
}
else {
this.playerWidth = null;
else {
this.playerWidth = null;
}

// Icon type
Expand All @@ -429,9 +428,9 @@ var AblePlayerInstances = [];
else {
this.allowFullscreen = true;
}
// Define other variables that are used in fullscreen program flow
this.clickedFullscreenButton = false;
this.restoringAfterFullscreen = false;
// Define other variables that are used in fullscreen program flow
this.clickedFullscreenButton = false;
this.restoringAfterFullscreen = false;

// Seek interval
// Number of seconds to seek forward or back with Rewind & Forward buttons
Expand Down Expand Up @@ -470,15 +469,15 @@ var AblePlayerInstances = [];
// Fallback
// The data-test-fallback attribute can be used to test the fallback solution in any browser
if ($(media).data('test-fallback') !== undefined && $(media).data('test-fallback') !== false) {
if ($(media).data('test-fallback') == '2') {
this.testFallback = 2; // emulate browser that doesn't support HTML5 media
if ($(media).data('test-fallback') == '2') {
this.testFallback = 2; // emulate browser that doesn't support HTML5 media
}
else {
this.testFallback = 1; // emulate failure to load Able Player
else {
this.testFallback = 1; // emulate failure to load Able Player
}
}
else {
this.testFallback = false;
else {
this.testFallback = false;
}

// Language
Expand Down Expand Up @@ -605,8 +604,8 @@ var AblePlayerInstances = [];
}
}
).
fail(function() {
thisObj.provideFallback();
fail(function() {
thisObj.provideFallback();
});
};

Expand All @@ -630,9 +629,9 @@ var AblePlayerInstances = [];
// for playlists, recreatePlayer() is called from within cuePlaylistItem()
}
else {
thisObj.recreatePlayer().then(function() {
thisObj.recreatePlayer().then(function() {
thisObj.initializing = false;
thisObj.playerCreated = true; // remains true until browser is refreshed
thisObj.playerCreated = true; // remains true until browser is refreshed
});
}
});
Expand Down
32 changes: 16 additions & 16 deletions scripts/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,29 @@

AblePlayer.prototype.browserSupportsVolume = function() {

// To test whether the browser supports changing the volume,
// create a new audio element and try setting the volume to something other than 1.
// Then, retrieve the current setting to see if it preserved it.
// To test whether the browser supports changing the volume,
// create a new audio element and try setting the volume to something other than 1.
// Then, retrieve the current setting to see if it preserved it.

// Unfortunately, this doesn't work in iOS. In 2022, our tests yield the same results as reported here:
// Unfortunately, this doesn't work in iOS. In 2022, our tests yield the same results as reported here:
// https://stackoverflow.com/questions/72861253/how-do-i-detect-if-a-browser-does-not-support-changing-html-audio-volume

// So, unfortunately we have to resort to sniffing for iOS
// before testing for support in other browsers
var audio, testVolume;
if (this.isIOS()) {
return false;
// So, unfortunately we have to resort to sniffing for iOS
// before testing for support in other browsers
var audio, testVolume;

if (this.isIOS()) {
return false;
}

testVolume = 0.9; // any value between 0.1 and 0.9
testVolume = 0.9; // any value between 0.1 and 0.9
audio = new Audio();
audio.volume = testVolume;
if (audio.volume === testVolume) {
return true;
}
else {
return false;
if (audio.volume === testVolume) {
return true;
}
else {
return false;
}
};

Expand Down
Loading