Skip to content

Commit e4f9ea6

Browse files
authored
Merge pull request #683 from ableplayer/develop
Merge Develop into Main
2 parents 2194da2 + ef7f2ab commit e4f9ea6

23 files changed

+395
-455
lines changed

README.md

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,7 @@ Setting this to "off" is useful if all videos have plenty of audio space for des
360360

361361
### Sign language
362362

363-
Sign language translation is supported in a separate video player, synchronized with the main player. Tips for filming a sign language interpreter are available from [Signing Books for the Deaf][]:
364-
365-
* [Filming the Signer][]
366-
* [Editing the Signer][]
363+
Sign language translation is supported in a separate video player, synchronized with the main player. Some tips for filming a sign language interpreter are available from [Signing Books for the Deaf][].
367364

368365
#### Loading from local source
369366

@@ -573,7 +570,6 @@ If you don’t have access to your server’s .htaccess file, you should be able
573570
If your site is running on a Windows server, consult the documentation from Microsoft. For example:
574571

575572
- [Configuring MIME Types in IIS 7][]
576-
- [How to add MIME Types with IIS7 Web.config][]
577573

578574
## Keyboard Shortcuts
579575

@@ -610,41 +606,27 @@ One of *Able Player’s* accessibility features is that the player is highly cus
610606
- Highlight transcript as video plays
611607
- Keyboard-enable transcript
612608

613-
## Acknowledgments
609+
## Acknowledgements
614610

615611
- Able Player development is supported in part by the [AccessComputing][] project at the University of Washington, with financial support from the National Science Foundation (grants #CNS-0540615, CNS-0837508, and CNS-1042260).
616612
- Additional support has been provided by the [Committee on Institutional Cooperation][] (CIC).
617613
- Turtle and rabbit icons (available as optional alternatives for the speed buttons) are provided courtesy of [Icons8][].
618614
- Sample video tracks are provided courtesy of [The DO-IT Center][] at the University of Washington. Additional videos are available on the [DO-IT Video][] website, which uses Able Player.
619615
- Sample audio tracks feature songs by Terrill Thompson, Able Player's creator and original lead developer. Check out [Terrill's music site] for more listening, and to support his work.
620616

621-
[AccessComputing]: http://washington.edu/accesscomputing
622-
[Committee on Institutional Cooperation]: https://www.cic.net/home
623-
[Configuring MIME Types in IIS 7]: http://technet.microsoft.com/en-us/library/17bda1f4-8a0d-440f-986a-5aaa9d40b74c.aspx
624-
[Editing the Signer]: http://www.sign-lang.uni-hamburg.de/signingbooks/sbrc/grid/d71/guide13.htm
625-
[develop]: https://github.com/ableplayer/ableplayer/tree/develop
626-
[examples]: http://ableplayer.github.io/ableplayer/demos/
627-
[Filming the Signer]: http://www.sign-lang.uni-hamburg.de/signingbooks/sbrc/grid/d71/guide12.htm
628-
[Flavors, by Flow Theory]: http://www.terrillthompson.com/music/2012/01/flow-theory-flavors/
629-
[DO-IT Video]: http://washington.edu/doit/video
630-
[Google Developer Console]: https://console.developers.google.com/
631-
[Google's Getting Started page]: https://developers.google.com/api-client-library/javascript/start/start-js#Getkeysforyourapplication
632-
[Grunt]: http://gruntjs.com/
633-
[How to add MIME Types with IIS7 Web.config]: http://blogs.iis.net/bills/archive/2008/03/25/how-to-add-mime-types-with-iis7-web-config.aspx
617+
[AccessComputing]: https://www.washington.edu/accesscomputing/
618+
[Committee on Institutional Cooperation]: https://btaa.org/about/news-and-publications/news/2016/06/30/the-committee-on-institutional-cooperation-is-now-the-big-ten-academic-alliance
619+
[Configuring MIME Types in IIS 7]: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc753281(v=ws.10)
620+
[examples]: https://ableplayer.github.io/ableplayer/demos/
621+
[DO-IT Video]: https://doit.uw.edu/videos/
634622
[Icons8]: https://icons8.com
635-
[issues]: https://github.com/ableplayer/ableplayer/issues
636-
[jQuery]: http://jquery.com/
637-
[jquery.cookie]: https://github.com/carhartl/jquery-cookie
623+
[jQuery]: https://jquery.com/
638624
[js-cookie]: https://github.com/js-cookie/js-cookie
639-
[JW Player]: http://www.jwplayer.com/
640-
[Modernizr]: http://modernizr.com/
641-
[npm]: https://www.npmjs.com/
642-
[Signing Books for the Deaf]: http://www.sign-lang.uni-hamburg.de/signingbooks/
625+
[Signing Books for the Deaf]: https://pragmaprojects.eu/signingbooks/index.php/the-project/summary
643626
[Terrill's music site]: https://terrillthompson.com/music
644-
[The DO-IT Center]: http://washington.edu/doit
627+
[The DO-IT Center]: https://doit.uw.edu/
645628
[Video Demo #7]: demos/video7.html
646629
[WebVTT validator]: https://quuz.org/webvtt/
647-
[WebAIM’s 2017 Screen Reader User Survey]: https://webaim.org/projects/screenreadersurvey7/#browsers
648630
[WebVTT]: https://w3c.github.io/webvtt/
649631
[Web Speech API]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API
650632
[YouTube's Terms of Service]: https://developers.google.com/youtube/terms/required-minimum-functionality#overlays-and-frames

build/ableplayer.dist.js

Lines changed: 43 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@ var AblePlayerInstances = [];
14861486
break;
14871487

14881488
case 'slower':
1489-
svg[0] = '0 0 20 20';
1489+
svg[0] = '0 0 11 20';
14901490
svg[1] = 'M0 7.321q0-0.29 0.212-0.502t0.502-0.212h10q0.29 0 0.502 0.212t0.212 0.502-0.212 0.502l-5 5q-0.212 0.212-0.502 0.212t-0.502-0.212l-5-5q-0.212-0.212-0.212-0.502z';
14911491
svg[2] = 'icon-slower';
14921492
svg[3] = this.slowerButtonImg;
@@ -3694,7 +3694,7 @@ var AblePlayerInstances = [];
36943694

36953695
AblePlayer.prototype.injectBigPlayButton = function () {
36963696

3697-
var thisObj, svgData, buttonIcon, svgPath;
3697+
var thisObj;
36983698

36993699
thisObj = this;
37003700

@@ -5012,7 +5012,7 @@ var postProcessing = {
50125012
return vttContent.replace(
50135013
/<c class="([\w\s]+)">/g,
50145014
function (_, classNames) {
5015-
var classes = classNames.replace(/\./g, " ");
5015+
var classes = classNames.replace(/ /g, ".");
50165016
return "<c." + classes + ">";
50175017
}
50185018
);
@@ -7539,6 +7539,13 @@ if (typeof module !== "undefined" && module.exports) {
75397539
this.youTubeSignPlayer.playVideo();
75407540
}
75417541
}
7542+
if (options && typeof options.volume !== 'undefined') {
7543+
if ( this.signVideo ) {
7544+
this.signVideo.volume = 0;
7545+
} else {
7546+
this.youTubeSignPlayer.setVolume(0);
7547+
}
7548+
}
75427549
}
75437550
};
75447551

@@ -7722,17 +7729,6 @@ if (typeof module !== "undefined" && module.exports) {
77227729
}
77237730
}
77247731

7725-
if (context === 'descriptions' || context == 'init'){
7726-
if (this.$descButton) {
7727-
this.toggleButtonState(
7728-
this.$descButton,
7729-
this.descOn,
7730-
this.tt.turnOffDescriptions,
7731-
this.tt.turnOnDescriptions,
7732-
);
7733-
}
7734-
}
7735-
77367732
if (context === 'captions' || context == 'init') {
77377733

77387734
if (this.$ccButton) {
@@ -7753,6 +7749,7 @@ if (typeof module !== "undefined" && module.exports) {
77537749
this.captionsOn,
77547750
ariaLabelOff,
77557751
ariaLabelOn,
7752+
'buttonOff',
77567753
ariaPressed
77577754
);
77587755
}
@@ -7777,14 +7774,6 @@ if (typeof module !== "undefined" && module.exports) {
77777774
if (!this.hideBigPlayButton) {
77787775
this.$bigPlayButton.show();
77797776
this.$bigPlayButton.attr('aria-hidden', 'false');
7780-
7781-
}
7782-
if (this.fullscreen) {
7783-
this.$bigPlayButton.width($(window).width());
7784-
this.$bigPlayButton.height($(window).height());
7785-
} else {
7786-
this.$bigPlayButton.width(this.$mediaContainer.width());
7787-
this.$bigPlayButton.height(this.$mediaContainer.height());
77887777
}
77897778
} else {
77907779
this.$bigPlayButton.hide();
@@ -7908,7 +7897,6 @@ if (typeof module !== "undefined" && module.exports) {
79087897
};
79097898

79107899
AblePlayer.prototype.handlePlay = function(e) {
7911-
79127900
if (this.paused) {
79137901
this.okToPlay = true;
79147902
this.playMedia();
@@ -8206,7 +8194,6 @@ if (typeof module !== "undefined" && module.exports) {
82068194
};
82078195

82088196
AblePlayer.prototype.handleTranscriptToggle = function () {
8209-
82108197
var thisObj = this;
82118198
var visible = this.$transcriptDiv.is(':visible');
82128199
if ( visible ) {
@@ -8455,22 +8442,22 @@ if (typeof module !== "undefined" && module.exports) {
84558442

84568443
AblePlayer.prototype.toggleButtonState = function($button, isOn, onLabel, offLabel, offClass = 'buttonOff', ariaPressed = false, ariaExpanded = false) {
84578444
if (isOn) {
8458-
$button.removeClass(offClass).attr('aria-label', onLabel);
8459-
$button.find('span.able-clipped').text(onLabel);
8445+
$button.addClass(offClass).attr('aria-label', offLabel);
8446+
$button.find('span.able-clipped').text(offLabel);
84608447
if ( ariaPressed ) {
8461-
$button.attr('aria-pressed', 'true');
8448+
$button.attr('aria-pressed', 'false');
84628449
}
84638450
if ( ariaExpanded ) {
8464-
$button.attr( 'aria-expanded', 'true' );
8451+
$button.attr( 'aria-expanded', 'false' );
84658452
}
84668453
} else {
8467-
$button.addClass(offClass).attr('aria-label', offLabel);
8468-
$button.find('span.able-clipped').text(offLabel);
8454+
$button.removeClass(offClass).attr('aria-label', onLabel);
8455+
$button.find('span.able-clipped').text(onLabel);
84698456
if ( ariaPressed ) {
8470-
$button.attr('aria-pressed', 'false');
8457+
$button.attr('aria-pressed', 'true');
84718458
}
84728459
if ( ariaExpanded ) {
8473-
$button.attr( 'aria-expanded', 'false' );
8460+
$button.attr( 'aria-expanded', 'true' );
84748461
}
84758462
}
84768463
};
@@ -10612,9 +10599,7 @@ if (typeof module !== "undefined" && module.exports) {
1061210599
};
1061310600

1061410601
AblePlayer.prototype.onClickPlayerButton = function (el) {
10615-
1061610602
var whichButton, prefsPopup;
10617-
1061810603
whichButton = this.getButtonNameFromClass($(el).attr('class'));
1061910604
switch ( whichButton ) {
1062010605
case 'play':
@@ -10845,17 +10830,13 @@ if (typeof module !== "undefined" && module.exports) {
1084510830
})
1084610831
.on('loadedmetadata',function() {
1084710832
thisObj.duration = thisObj.media.duration;
10848-
var x = 50.5;
10849-
var y = 51.9;
10850-
var diff = Math.abs(Math.round(x)-Math.round(y));
1085110833
})
1085210834
.on('canplay',function() {
1085310835
})
1085410836
.on('canplaythrough',function() {
10855-
thisObj.onMediaNewSourceLoad();
10837+
thisObj.onMediaNewSourceLoad();
1085610838
})
1085710839
.on('play',function() {
10858-
thisObj.refreshControls('playpause');
1085910840
})
1086010841
.on('playing',function() {
1086110842
thisObj.playing = true;
@@ -10977,7 +10958,6 @@ if (typeof module !== "undefined" && module.exports) {
1097710958
};
1097810959

1097910960
AblePlayer.prototype.addEventListeners = function () {
10980-
1098110961
var thisObj = this;
1098210962

1098310963
$(window).on('resize',function () {
@@ -11018,7 +10998,7 @@ if (typeof module !== "undefined" && module.exports) {
1101810998
if (e.button !== 0) {
1101910999
return false;
1102011000
}
11021-
if ($('.able-popup:visible').length || $('.able-volume-popup:visible')) {
11001+
if ($('.able-popup:visible').length || $('.able-volume-slider:visible').length ) {
1102211002
thisObj.closePopups();
1102311003
}
1102411004
if (e.target.tagName === 'VIDEO') {
@@ -11771,23 +11751,22 @@ if (typeof module !== "undefined" && module.exports) {
1177111751

1177211752
(function ($) {
1177311753
AblePlayer.prototype.initSignLanguage = function() {
11774-
11775-
var hasLocalSrc = ( this.$media.data('sign-src') !== undefined && this.$media.data('sign-src') !== "" );
11754+
this.hasSignLanguage = false;
11755+
var hasLocalSrc = ( this.$sources.first().attr('data-sign-src') !== undefined && this.$sources.first().attr('data-sign-src') !== "" );
1177611756
var hasRemoteSrc = ( this.$media.data('youtube-sign-src') !== undefined && this.$media.data('youtube-sign-src') !== "" );
11777-
if ( ! this.isIOS() && ( hasLocalSrc || hasRemoteSrc ) ) {
11778-
this.hasSignLanguage = true;
11757+
var hasRemoteSource = ( this.$sources.first().attr('data-youtube-sign-src') !== undefined && this.$sources.first().attr('data-youtube-sign-src') !== '' );
11758+
if ( ! this.isIOS() && ( hasLocalSrc || hasRemoteSrc || hasRemoteSource ) && ( this.player === 'html5' || this.player === 'youtube' ) ) {
11759+
let ytSignSrc = this.youTubeSignId ?? DOMPurify.sanitize( this.$sources.first().attr('data-youtube-sign-src') );
11760+
let signSrc = DOMPurify.sanitize( this.$sources.first().attr('data-sign-src') );
11761+
let signVideo = DOMPurify.sanitize( this.$media.data('youtube-sign-src') );
11762+
this.signFile = (hasLocalSrc ) ? signSrc : false;
1177911763
if ( hasRemoteSrc ) {
11780-
this.signYoutubeId = this.youTubeSignId;
11764+
this.signYoutubeId = signVideo;
11765+
} else if ( hasRemoteSource ) {
11766+
this.signYoutubeId = ytSignSrc;
1178111767
}
11782-
this.injectSignPlayerCode();
11783-
return;
11784-
}
11785-
if (this.player === 'html5') {
11786-
this.signYoutubeId = this.youTubeSignId ?? DOMPurify.sanitize( this.$sources.first().attr('data-youtube-sign-src') );
11787-
this.signFile = DOMPurify.sanitize( this.$sources.first().attr('data-sign-src') );
11788-
if (this.signFile || this.signYoutubeId) {
11768+
if ( this.signFile || this.signYoutubeId ) {
1178911769
if (this.isIOS()) {
11790-
this.hasSignLanguage = false;
1179111770
if (this.debug) {
1179211771

1179311772
}
@@ -11798,11 +11777,7 @@ if (typeof module !== "undefined" && module.exports) {
1179811777
this.hasSignLanguage = true;
1179911778
this.injectSignPlayerCode();
1180011779
}
11801-
} else {
11802-
this.hasSignLanguage = false;
1180311780
}
11804-
} else {
11805-
this.hasSignLanguage = false;
1180611781
}
1180711782
};
1180811783

@@ -13019,8 +12994,16 @@ if (typeof module !== "undefined" && module.exports) {
1301912994
})
1302012995
.fail(function() {
1302112996

13022-
thisObj.provideFallback();
13023-
deferred.fail();
12997+
translationFile = thisObj.rootPath + 'translations/' + thisObj.lang + '.js';
12998+
$.getJSON(translationFile, function(data) {
12999+
thisObj.tt = data;
13000+
deferred.resolve();
13001+
})
13002+
.fail( function() {
13003+
13004+
thisObj.provideFallback();
13005+
deferred.fail();
13006+
});
1302413007
})
1302513008
return deferred.promise();
1302613009
};

0 commit comments

Comments
 (0)