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
merge main into develop with 4.5.1 patch
  • Loading branch information
jeanem committed Mar 7, 2025
commit e129d083d51765b190835c467e384ddc1a059259
2,208 changes: 1,069 additions & 1,139 deletions build/ableplayer.dist.js

Large diffs are not rendered by default.

2,208 changes: 1,069 additions & 1,139 deletions build/ableplayer.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions build/ableplayer.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ableplayer",
"version": "4.5.3",
"version": "4.5.1",
"description": "Accessible HTML5 media player",
"homepage": "http://ableplayer.github.io/ableplayer",
"bugs": "https://github.com/ableplayer/ableplayer/issues",
Expand Down
181 changes: 42 additions & 139 deletions scripts/caption.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
(function ($) {
AblePlayer.prototype.updateCaption = function (time) {
if (
!this.usingYouTubeCaptions &&
!this.usingVimeoCaptions &&
typeof this.$captionsWrapper !== "undefined"
) {
if (this.captionsOn) {
this.$captionsWrapper.show();
if (typeof time !== "undefined") {
this.showCaptions(time);
}
} else if (this.$captionsWrapper) {
this.$captionsWrapper.hide();
this.prefCaptions = 0;
}
}
};

AblePlayer.prototype.updateCaption = function (time) {

if (!this.usingYouTubeCaptions && !this.usingVimeoCaptions &&
(typeof this.$captionsWrapper !== 'undefined')) {
if (this.captionsOn) {
this.$captionsWrapper.show();
if (typeof time !== 'undefined') {
this.showCaptions(time);
}
}
else if (this.$captionsWrapper) {
this.$captionsWrapper.hide();
this.prefCaptions = 0;
}
}
};

AblePlayer.prototype.updateCaptionsMenu = function (lang) {
AblePlayer.prototype.updateCaptionsMenu = function (lang) {
// uncheck all previous menu items
this.captionsPopup.find("li").attr("aria-checked", "false");
if (typeof lang === "undefined") {
// check the last menu item (captions off)
this.captionsPopup.find("li").last().attr("aria-checked", "true");
} else {
// check the newly selected lang
this.captionsPopup
.find("li[lang=" + lang + "]")
.attr("aria-checked", "true");
}
};

// uncheck all previous menu items
this.captionsPopup.find('li').attr('aria-checked','false');
if (typeof lang === 'undefined') {
// check the last menu item (captions off)
this.captionsPopup.find('li').last().attr('aria-checked','true');
}
else {
// check the newly selected lang
this.captionsPopup.find('li[lang=' + lang + ']').attr('aria-checked','true');
}
};
AblePlayer.prototype.getCaptionClickFunction = function (track) {
// Returns the function used when a caption is clicked in the captions menu.
// Not called if user clicks "Captions off". Instead, that triggers getCaptionOffFunction()

var thisObj = this;
return function () {
Expand Down Expand Up @@ -146,79 +150,9 @@
thisObj.captionsOn = false;
thisObj.currentCaption = -1;

thisObj.selectedCaptions = track;
thisObj.captionLang = track.language;
thisObj.currentCaption = -1;
if (thisObj.usingYouTubeCaptions) {
if (thisObj.captionsOn) {
// Two things must be true in order for setOption() to work:
// The YouTube caption module must be loaded
// and the video must have started playing
if (thisObj.youTubePlayer.getOptions('captions') && thisObj.startedPlaying) {
thisObj.youTubePlayer.setOption('captions', 'track', {'languageCode': thisObj.captionLang});
}
else {
// the two conditions were not met
// try again to set the language after onApiChange event is triggered
// meanwhile, the following variable will hold the value
thisObj.captionLangPending = thisObj.captionLang;
}
}
else {
if (thisObj.youTubePlayer.getOptions('captions')) {
thisObj.youTubePlayer.setOption('captions', 'track', {'languageCode': thisObj.captionLang});
}
else {
thisObj.youTubePlayer.loadModule('captions');
thisObj.captionLangPending = thisObj.captionLang;
}
}
}
else if (thisObj.usingVimeoCaptions) {
thisObj.vimeoPlayer.enableTextTrack(thisObj.captionLang).then(function(track) {
// track.language = the iso code for the language
// track.kind = 'captions' or 'subtitles'
// track.label = the human-readable label
}).catch(function(error) {
switch (error.name) {
case 'InvalidTrackLanguageError':
// no track was available with the specified language
console.log('No ' + track.kind + ' track is available in the specified language (' + track.label + ')');
break;
case 'InvalidTrackError':
// no track was available with the specified language and kind
console.log('No ' + track.kind + ' track is available in the specified language (' + track.label + ')');
break;
default:
// some other error occurred
console.log('Error loading ' + track.label + ' ' + track.kind + ' track');
break;
}
});
}
else { // using local track elements for captions/subtitles
thisObj.syncTrackLanguages('captions',thisObj.captionLang);
if (!thisObj.swappingSrc) {
thisObj.updateCaption(thisObj.elapsed);
thisObj.showDescription(thisObj.elapsed);
}
}
thisObj.captionsOn = true;
// stopgap to prevent spacebar in Firefox from reopening popup
// immediately after closing it (used in handleCaptionToggle())
thisObj.hidingPopup = true;
thisObj.captionsPopup.hide();
thisObj.$ccButton.attr('aria-expanded', 'false');
if (thisObj.mediaType === 'audio') {
thisObj.$captionsContainer.removeClass('captions-off');
}
// Ensure stopgap gets cancelled if handleCaptionToggle() isn't called
// e.g., if user triggered button with Enter or mouse click, not spacebar
setTimeout(function() {
thisObj.hidingPopup = false;
}, 100);
thisObj.updateCaptionsMenu(thisObj.captionLang);
thisObj.waitThenFocus(thisObj.$ccButton);
if (thisObj.mediaType === "audio") {
thisObj.$captionsContainer.addClass("captions-off");
}

// stopgap to prevent spacebar in Firefox from reopening popup
// immediately after closing it (used in handleCaptionToggle())
Expand Down Expand Up @@ -295,43 +229,12 @@

// ruby: http://www.w3schools.com/tags/tag_ruby.asp

var c, thisCaption, captionText;
var cues;
if (this.selectedCaptions.cues.length) {
cues = this.selectedCaptions.cues;
}
else if (this.captions.length >= 1) {
cues = this.captions[0].cues;
}
else {
cues = [];
}
for (c = 0; c < cues.length; c++) {
if ((cues[c].start <= now) && (cues[c].end > now)) {
thisCaption = c;
break;
}
}
if (typeof thisCaption !== 'undefined') {
if (this.currentCaption !== thisCaption) {
// it's time to load the new caption into the container div
captionText = this.flattenCueForCaption(cues[thisCaption]).replace('\n', '<br>');
this.$captionsDiv.html(captionText);
this.currentCaption = thisCaption;
if (captionText.length === 0) {
// hide captionsDiv; otherwise background-color is visible due to padding
this.$captionsDiv.css('display','none');
}
else {
this.$captionsDiv.css('display','inline-block');
}
}
}
else {
this.$captionsDiv.html('').css('display','none');
this.currentCaption = -1;
}
};
// WebVTT also supports 'u' (underline)
// I see no reason to support that in Able Player.
// If it's available authors are likely to use it incorrectly
// where <i> or <b> should be used instead
// Here are the rare use cases where an underline is appropriate on the web:
// http://html5doctor.com/u-element/

var result = [];

Expand Down
81 changes: 23 additions & 58 deletions scripts/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,21 @@
// Converts string of form hh:mm:ss to seconds
var timeParts, hours, minutes, seconds, newTime;

// Takes seconds and converts to string of form hh:mm:ss
// If showFullTime is true, shows 00 for hours if time is less than an hour
// and show milliseconds (e.g., 00:00:04.123 as in Video Track Sorter)
// Otherwise, omits empty hours and milliseconds (e.g., 00:04 as in timer on controller)
timeParts = timeStr.split(":");
if (timeParts.length === 3) {
hours = parseInt(timeParts[0]);
minutes = parseInt(timeParts[1]);
seconds = parseFloat(timeParts[2]);
return hours * 3600 + minutes * 60 + seconds;
} else if (timeParts.length === 2) {
minutes = parseInt(timeParts[0]);
seconds = parseFloat(timeParts[1]);
return minutes * 60 + seconds;
} else if (timeParts.length === 1) {
seconds = parseFloat(timeParts[0]);
return seconds;
}
};

AblePlayer.prototype.capitalizeFirstLetter = function (string) {
return string.charAt(0).toUpperCase() + string.slice(1);
Expand All @@ -129,60 +140,14 @@

var attr = object.attr(attribute);

timeParts = timeStr.split(':');
if (timeParts.length === 3) {
hours = parseInt(timeParts[0]);
minutes = parseInt(timeParts[1]);
seconds = parseFloat(timeParts[2]);
return ((hours * 3600) + (minutes * 60) + (seconds));
}
else if (timeParts.length === 2) {
minutes = parseInt(timeParts[0]);
seconds = parseFloat(timeParts[1]);
return ((minutes * 60) + (seconds));
}
else if (timeParts.length === 1) {
seconds = parseFloat(timeParts[0]);
return seconds;
}
};

AblePlayer.prototype.capitalizeFirstLetter = function (string) {
return string.charAt(0).toUpperCase() + string.slice(1);
};

AblePlayer.prototype.roundDown = function (value, decimals) {

// round value down to the nearest X decimal points
// where X is the value of the decimals parameter
return Number(Math.floor(value+'e'+decimals)+'e-'+decimals);
};

AblePlayer.prototype.hasAttr = function (object, attribute) {

// surprisingly, there is no hasAttr() function in Jquery as of 3.2.1
// return true if object has attribute; otherwise false
// selector is a Jquery object
// attribute is a string

var attr = object.attr(attribute);

// For some browsers, `attr` is undefined; for others,
// `attr` is false. Check for both.
if (typeof attr !== typeof undefined && attr !== false) {
return true;
}
else {
return false;
}
};

Number.isInteger = Number.isInteger || function(value) {

// polyfill for IE11, which doesn't otherwise support Number.isInteger
// https://stackoverflow.com/a/31720368/744281
return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
};
// For some browsers, `attr` is undefined; for others,
// `attr` is false. Check for both.
if (typeof attr !== typeof undefined && attr !== false) {
return true;
} else {
return false;
}
};

Number.isInteger =
Number.isInteger ||
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.