From f3e5771e2906350b4fd67eaa178e5421ecc4d7d0 Mon Sep 17 00:00:00 2001 From: Terrill Date: Thu, 21 Nov 2019 13:03:15 -0700 Subject: [PATCH 001/194] Update plugin header --- ableplayer.php | 24 +++++------------------- readme.txt | 2 +- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/ableplayer.php b/ableplayer.php index df8d178..56cae41 100644 --- a/ableplayer.php +++ b/ableplayer.php @@ -1,29 +1,15 @@ tags - * - * NOTE: This will affect ALL content on site, and may have undesirable consequences - * Therefore it's commented out by default. Test before using. - * - * -*/ -// remove_filter ('the_content', 'wpautop'); - /* * * load styles and scripts to head diff --git a/readme.txt b/readme.txt index c132cf3..8826949 100644 --- a/readme.txt +++ b/readme.txt @@ -11,7 +11,7 @@ License: MIT License URI: https://github.com/ableplayer/ableplayer-wordpress/blob/master/LICENSE -HTML5 accessible media player +Accessible HTML5 media player == Description == From 842e41421813121b4b8be3da2de9eeb6073b7c22 Mon Sep 17 00:00:00 2001 From: Terrill Date: Tue, 26 Nov 2019 12:42:42 -0800 Subject: [PATCH 002/194] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8feb3f2..06c35e8 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,12 @@ Able Player WordPress Plugin This plugin is designed to simplify the process of adding Able Player to WordPress websites. +See the [Able Player WordPress plug-in](https://wordpress.org/plugins/ableplayer/) site to download the latest stable version, rate the plugin, and report issues via the Support Forum. + +This GitHub repo is for development between stable versions. + See the main [Able Player](http://ableplayer.github.io/ableplayer) project page for more details about Able Player. - -For additional details about this WordPress plugin, see the [readme.txt](readme.txt) file. + + From 0637aeea93719faf3e18781433e25cc4ba780a14 Mon Sep 17 00:00:00 2001 From: Terrill Date: Mon, 13 Dec 2021 16:36:36 -0800 Subject: [PATCH 003/194] Upgrade Able Player to 4.4.1 --- ableplayer.php | 2 +- assets/icon-128x128.jpg | Bin 0 -> 1865 bytes assets/icon-256x256.jpg | Bin 0 -> 3913 bytes build/ableplayer.dist.js | 3931 +++++++++++--------- build/ableplayer.js | 3931 +++++++++++--------- build/ableplayer.min.css | 2 +- build/ableplayer.min.js | 6 +- button-icons/black/captions.png | Bin button-icons/black/chapters.png | Bin button-icons/black/close.png | Bin button-icons/black/descriptions.png | Bin button-icons/black/ellipsis.png | Bin button-icons/black/faster.png | Bin button-icons/black/forward.png | Bin button-icons/black/fullscreen-collapse.png | Bin button-icons/black/fullscreen-expand.png | Bin button-icons/black/help.png | Bin button-icons/black/next.png | Bin button-icons/black/pause.png | Bin button-icons/black/pipe.png | Bin button-icons/black/play.png | Bin button-icons/black/preferences.png | Bin button-icons/black/previous.png | Bin button-icons/black/restart.png | Bin button-icons/black/rewind.png | Bin button-icons/black/sign.png | Bin button-icons/black/slower.png | Bin button-icons/black/stop.png | Bin button-icons/black/transcript.png | Bin button-icons/black/volume-loud.png | Bin button-icons/black/volume-medium.png | Bin button-icons/black/volume-mute.png | Bin button-icons/black/volume-soft.png | Bin button-icons/fonts/able.eot | Bin button-icons/fonts/able.svg | 0 button-icons/fonts/able.ttf | Bin button-icons/fonts/able.woff | Bin button-icons/white/captions.png | Bin button-icons/white/chapters.png | Bin button-icons/white/close.png | Bin button-icons/white/descriptions.png | Bin button-icons/white/ellipsis.png | Bin button-icons/white/faster.png | Bin button-icons/white/forward.png | Bin button-icons/white/fullscreen-collapse.png | Bin button-icons/white/fullscreen-expand.png | Bin button-icons/white/help.png | Bin button-icons/white/next.png | Bin button-icons/white/pause.png | Bin button-icons/white/pipe.png | Bin button-icons/white/play.png | Bin button-icons/white/preferences.png | Bin button-icons/white/previous.png | Bin button-icons/white/restart.png | Bin button-icons/white/rewind.png | Bin button-icons/white/sign.png | Bin button-icons/white/slower.png | Bin button-icons/white/stop.png | Bin button-icons/white/transcript.png | Bin button-icons/white/volume-loud.png | Bin button-icons/white/volume-medium.png | Bin button-icons/white/volume-mute.png | Bin button-icons/white/volume-soft.png | Bin readme.txt | 62 +- styles/ableplayer.css | 116 +- thirdparty/js.cookie.js | 294 +- translations/ca.js | 52 +- translations/cs.js | 355 ++ translations/de.js | 356 +- translations/en.js | 52 +- translations/es.js | 52 +- translations/fr.js | 50 +- translations/he.js | 52 +- translations/id.js | 355 ++ translations/it.js | 140 +- translations/ja.js | 53 +- translations/nb.js | 52 +- translations/nl.js | 52 +- translations/pt-br.js | 80 +- translations/sv.js | 355 ++ translations/tr.js | 52 +- translations/zh-tw.js | 52 +- 82 files changed, 6515 insertions(+), 3989 deletions(-) create mode 100644 assets/icon-128x128.jpg create mode 100644 assets/icon-256x256.jpg mode change 100755 => 100644 button-icons/black/captions.png mode change 100755 => 100644 button-icons/black/chapters.png mode change 100755 => 100644 button-icons/black/close.png mode change 100755 => 100644 button-icons/black/descriptions.png mode change 100755 => 100644 button-icons/black/ellipsis.png mode change 100755 => 100644 button-icons/black/faster.png mode change 100755 => 100644 button-icons/black/forward.png mode change 100755 => 100644 button-icons/black/fullscreen-collapse.png mode change 100755 => 100644 button-icons/black/fullscreen-expand.png mode change 100755 => 100644 button-icons/black/help.png mode change 100755 => 100644 button-icons/black/next.png mode change 100755 => 100644 button-icons/black/pause.png mode change 100755 => 100644 button-icons/black/pipe.png mode change 100755 => 100644 button-icons/black/play.png mode change 100755 => 100644 button-icons/black/preferences.png mode change 100755 => 100644 button-icons/black/previous.png mode change 100755 => 100644 button-icons/black/restart.png mode change 100755 => 100644 button-icons/black/rewind.png mode change 100755 => 100644 button-icons/black/sign.png mode change 100755 => 100644 button-icons/black/slower.png mode change 100755 => 100644 button-icons/black/stop.png mode change 100755 => 100644 button-icons/black/transcript.png mode change 100755 => 100644 button-icons/black/volume-loud.png mode change 100755 => 100644 button-icons/black/volume-medium.png mode change 100755 => 100644 button-icons/black/volume-mute.png mode change 100755 => 100644 button-icons/black/volume-soft.png mode change 100755 => 100644 button-icons/fonts/able.eot mode change 100755 => 100644 button-icons/fonts/able.svg mode change 100755 => 100644 button-icons/fonts/able.ttf mode change 100755 => 100644 button-icons/fonts/able.woff mode change 100755 => 100644 button-icons/white/captions.png mode change 100755 => 100644 button-icons/white/chapters.png mode change 100755 => 100644 button-icons/white/close.png mode change 100755 => 100644 button-icons/white/descriptions.png mode change 100755 => 100644 button-icons/white/ellipsis.png mode change 100755 => 100644 button-icons/white/faster.png mode change 100755 => 100644 button-icons/white/forward.png mode change 100755 => 100644 button-icons/white/fullscreen-collapse.png mode change 100755 => 100644 button-icons/white/fullscreen-expand.png mode change 100755 => 100644 button-icons/white/help.png mode change 100755 => 100644 button-icons/white/next.png mode change 100755 => 100644 button-icons/white/pause.png mode change 100755 => 100644 button-icons/white/pipe.png mode change 100755 => 100644 button-icons/white/play.png mode change 100755 => 100644 button-icons/white/preferences.png mode change 100755 => 100644 button-icons/white/previous.png mode change 100755 => 100644 button-icons/white/restart.png mode change 100755 => 100644 button-icons/white/rewind.png mode change 100755 => 100644 button-icons/white/sign.png mode change 100755 => 100644 button-icons/white/slower.png mode change 100755 => 100644 button-icons/white/stop.png mode change 100755 => 100644 button-icons/white/transcript.png mode change 100755 => 100644 button-icons/white/volume-loud.png mode change 100755 => 100644 button-icons/white/volume-medium.png mode change 100755 => 100644 button-icons/white/volume-mute.png mode change 100755 => 100644 button-icons/white/volume-soft.png create mode 100644 translations/cs.js create mode 100644 translations/id.js create mode 100644 translations/sv.js diff --git a/ableplayer.php b/ableplayer.php index 56cae41..8e5f117 100644 --- a/ableplayer.php +++ b/ableplayer.php @@ -2,7 +2,7 @@ /* Plugin Name: Able Player Plugin URI: https://github.com/ableplayer/ableplayer-wordpress -Version: 1.0 +Version: 1.1 Author Name: Terrill Thompson Author URI: http://terrillthompson.com Contributors: terrillthompson diff --git a/assets/icon-128x128.jpg b/assets/icon-128x128.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6e7781f7f9af3486d86589093176efdbb1b91d02 GIT binary patch literal 1865 zcmb7EdsIw$9RJ;W=gw3!)t#D2l-)Zur6C%XhPzOEaQF}IKe|OmU%bxw--}#=;`M%Emem}qO&sb}02E^1L zX%IjV1O&qm7#lzUz)+MvP#EywW;o7Z;1(Fo%JgO!Fi19jbgue<< z461%H!&wM}iJ{QT``Z2~z*rAB7)&8B0s!Q_rs zSM=sI#E7THjdjlb)Y3ea$)U1762ysx{$?RUh` zJE^(bWt2Ku%#$^BRCbkbP8;Clqeom3?$~S>4=}Vcy|77}1>Pb#B_wKC1P0DPh|fG_`j1t@{_6!gtSI zsoiu~GgqDOM(EEQ?5{nt%}eMh^0VlYRDUQ8&xM&SkNqXu-lTY$ZiXUEpISM%h!ZF; z8-4@kD(~)WytXEFb@u%W5>;G=P&4{oPU0OkOnPD`$Q@GP4s7ZfA<7~1ZV0w!jqfQu zUCUnNL#m}V&xz-418GgYeDo4To|WflJ(O zAEhL(63e7E()h6FyE2zM`K+X3e!isGnD4gTzhpS8<6>BETrsw1n0JG;eB&I*j~fB+ z9Ezh%xKN)2t|pwk|BQ%=-Kj!vdVo<3!kltDQ3EQ1?jHrkYtJq zqGX-BTf)6!;u$X|kN1Fmn4S*P8WI|*@XPUMK)lJEq%}fg8$^i007R(qH|ejjIkb=_ zFCDLunso42)o7#e8~2~y5aK^K!ki z^dPBNUv$%ZLp5*K3l|P~s(GZI_6LbZsjjX6#q;6iM{m>;nMmO45!ksZ3GW**thK$} z$!o!4a)j%%!I+h%%6*K_()9K;#@Z1M;@8c}g?=kmUY+^AL^rB<{GxeVszh=1b85@A z3h9GRlTXHvom-l;W#I6mO~V$9wc#d5r8wA5=%CB)i9srwM=30064vj&9cp+D?vxZL^K~Vtl{c>IU#=i}LkHS>qDVY@K9smFU literal 0 HcmV?d00001 diff --git a/assets/icon-256x256.jpg b/assets/icon-256x256.jpg new file mode 100644 index 0000000000000000000000000000000000000000..92d60591f11a3ea8e592733c6068578d050d8abc GIT binary patch literal 3913 zcmbtWc|4SB8-Cwem|-w8#u!PBC85a@5t;1!Sd&6R8b!8AsS!dVOSXs++AN*2q@pNg zOR}7bRJKBNQk_aFLVWK#GwFPPeB1e+d44n3dp*~^JoDVY`*|0iFAf8EYjZ1e00cq6 z68Zp(1AqyDL?GY^4HPud7&ID%LJJ8B3Se+TIGnJMu&{_I5icT25ET~2lko&`l7xf= zPE3+QCQ*na2@>oCL_#(wG!~7NdNO#Yyt=v5C8!rNB|H75J>|ULH&WQvjSL{EM>WhQ-{5hrrN4rn{Bmlsg zt=TJ{@$30-qm@uyDdGVTi4cU!2+8+@Mxq2j1RzLI*IaK%#fQjhtb-~I1JxghM*MI* zIBCHyTg&lP%b+Gy@6fD&66QRsecMyR!jfe@C-I6tw6o(K^YQZT5bg6F>s1Floo?^G zRoUi;9A48hrOUbP?&0@lYs&P2N$ZK@t-B3`qpy;k1YR6C^zfjkNn$PWwQ}AYeC_)8 zt_CWwT{){lt~Pc-C&GVclSBL+Gf3vXY~(`qwn}2xC70HU$Kk1WR>35TlRVQt`P-X5 ziMp9BP!d6k^VvxD#IyW8>f*qaESdoa&ESKnL zob2>_1@GqDQRec?;_d$BKC*41!KE3H;j=Cc%2C2e4@#U^%7s!6%rt`^u)0Z1dimQV zZR(i>$vD*9-c~gsc zBt84yV^&Ujv9fhkHQW{me{C4>37+L177_#vKmb1Af2BYyDYW1c0MRHR5Q*m100Qc9 z071jhh((lD4@HZUsB-I!9i2AE;6oY}ymwYT<`;y30piDR8_d-LVgkh53Q2B~x%)i= zgB-WB{5G?T-C6ltf}eC(9^2!#>iyNJz|JqNh1oiJo+XbiC9Y~uHj*yt-DUouL*K+o zPQK~g-br`X?qb{5IV_p@&o#Aa#d~}@oD1dwQeVUy>zy7 zOVV4LAIjy`tjvtgM#{nZd&y-f0UeghvD+*n&^C1 z5W&W;mQJ%Kf3$ox|LB@j6|>5Q0MeS^O?iCLZoZUux^&**tL@iJy1mQ{H@iBGSK1YI zY!O^)j&n#)xVq%(A4Sk@!^qGOgpVU+dB|a!+Le=RKX-zZ5pA%u$_%F8q?mdYhR!jK z7Xd43M@Cfpck^^J8mU%;S!~Cc9X*$!<4^NEQ78wcuGD?__1*k~LE8eqohit!)j1qB za0IGLWvJ>9NDOov|EypTAjoPssv8=4v(8n0qQ>AeLK+`W{_H&lvhxmh9Ho^F_X)}G zk6L*&VqYE%B3xhj&15|F8VZ$6Uuy} z?%{UaRMozizwqe>cg@4lVZnZxUJT0RJZ9u;Fq~-r)x&X2fpuo-7Dck&x(Yd~-w%9% zoyYpeshnY@8=t-=5Q)(`x-rVz0?7h6scC6${7*Vc-c z5{!vP3O{*NI(7;3#Ly#^Xaqnqu10}q`3uKl_#~u>{waWDf5kkj|ML6a+%fPig#VAX z5Kp0qhu%Rz6asDtypF)_2S$#cyjkjoa5tz58Chxu_(dRVH$!-vd>cV{9ZPgf#$@RD zgzp8y-cUE|sc(Hh45n?qN`}6m4Od@$X8Xc62)V~l=a`%A`d~d{Ce3qU_SE2oGncB> zK7|!{Dks=%SOhEx29YuIv8NLfLyaZlO)oV@eCVvP47GB8tGznWtA2ls|G-M8yMlhb zp9^jnjAcET>y{4h_ayhM$jCL${AyZOUF2dRM-XprdBE9i;M#v6qBQW~q>H=}zApx8 zXXlc+qHvfdSGDnZd(^lYxiTOvKX?j`JrFvd?tO)sD_9gEzicY;mDaP-qk|Gy-{Q9P zvt3udBkt<(B6bx--`dfgYAzGZPMOdgD_xQ6^VuV+a!o+<)s`S1oK~J7ocgCeMj!i|K4+Xd}GiNqJz2! z9t`sR*q8V;Szpuc%*}gGwNl)YaCukca%GAm_%gYPoKGe9voPPK0`sIIFcfyj=;q<4 zX2ZMKQpcWLE~(`3c09H$D4}_6aIU&x_qh?!+P0^ar`@ShP!g%i~FX716yWgR9^X?%*F+p}+Tg24HM2c(}?NJjF{EBdJxO32l9VJ3b? zAj6e?+3k&sN*f*L>{NDQ{~v2d@xxjT#C&%45hLC%K9}uyyj74!=@)M=7rEY{wBOt( zzN|h>;{ytT0`^E;A9o2xsmlE^vC*zF>(AN+ozWkL0puIcV>|lh{T}JaG$9@0C_n6u zJ~9%vVClxjEJRxH4)MOElAeedrryhI3r9V#lCi~5RKs)yc665iC$~oFPXbBH)m-$C zFW<%7Qn9ahFXQs4pi=9Wkd#M}PH)_Wc8(`ln?8 literal 0 HcmV?d00001 diff --git a/build/ableplayer.dist.js b/build/ableplayer.dist.js index ab1b188..45249a0 100644 --- a/build/ableplayer.dist.js +++ b/build/ableplayer.dist.js @@ -49,13 +49,12 @@ var AblePlayerInstances = []; // YouTube player support; pass ready event to jQuery so we can catch in player. window.onYouTubeIframeAPIReady = function() { - AblePlayer.youtubeIframeAPIReady = true; - $('body').trigger('youtubeIframeAPIReady', []); + AblePlayer.youTubeIframeAPIReady = true; + $('body').trigger('youTubeIframeAPIReady', []); }; - // If there is only one player on the page, dispatch global keydown events to it // Otherwise, keydowwn events are handled locally (see event.js > handleEventListeners()) - $(window).keydown(function(e) { + $(window).on('keydown',function(e) { if (AblePlayer.nextIndex === 1) { AblePlayer.lastCreated.onPlayerKeyPress(e); } @@ -65,6 +64,10 @@ var AblePlayerInstances = []; // Parameters are: // media - jQuery selector or element identifying the media. window.AblePlayer = function(media) { + + + var thisObj = this; + // Keep track of the last player created for use with global events. AblePlayer.lastCreated = this; this.media = media; @@ -177,7 +180,7 @@ var AblePlayerInstances = []; this.exposeTextDescriptions = false; } else if ($(media).data('description-audible') !== undefined && $(media).data('description-audible') === false) { - // support both singular and plural spelling of attribute + // support both singular and plural spelling of attribute this.exposeTextDescriptions = false; } else { @@ -206,17 +209,17 @@ var AblePlayerInstances = []; // If data-include-transcript="false", there is no "popup" transcript if ($(media).data('transcript-div') !== undefined && $(media).data('transcript-div') !== "") { - this.transcriptDivLocation = $(media).data('transcript-div'); + this.transcriptDivLocation = $(media).data('transcript-div'); } else { - this.transcriptDivLocation = null; - } + this.transcriptDivLocation = null; + } if ($(media).data('include-transcript') !== undefined && $(media).data('include-transcript') === false) { - this.hideTranscriptButton = true; - } - else { - this.hideTranscriptButton = null; - } + this.hideTranscriptButton = true; + } + else { + this.hideTranscriptButton = null; + } this.transcriptType = null; if ($(media).data('transcript-src') !== undefined) { @@ -227,7 +230,7 @@ var AblePlayerInstances = []; } else if ($(media).find('track[kind="captions"], track[kind="subtitles"]').length > 0) { // required tracks are present. COULD automatically generate a transcript - if (this.transcriptDivLocation) { + if (this.transcriptDivLocation) { this.transcriptType = 'external'; } else { @@ -362,7 +365,7 @@ var AblePlayerInstances = []; // Unless specified with data-seek-interval, the default value is re-calculated in initialize.js > setSeekInterval(); // Calculation attempts to intelligently assign a reasonable interval based on media length this.defaultSeekInterval = 10; - this.useFixedSeekInterval = false; + this.useFixedSeekInterval = false; // will change to true if media has valid data-seek-interval attribute if ($(media).data('seek-interval') !== undefined && $(media).data('seek-interval') !== "") { var seekInterval = $(media).data('seek-interval'); if (/^[1-9][0-9]*$/.test(seekInterval)) { // must be a whole number greater than 0 @@ -401,23 +404,16 @@ var AblePlayerInstances = []; } // Language - this.lang = 'en'; - if ($(media).data('lang') !== undefined && $(media).data('lang') !== "") { - var lang = $(media).data('lang'); - if (lang.length == 2) { - this.lang = lang; - } - } - // Player language is determined as follows (in translation.js > getTranslationText() ): - // 1. Lang attributes on or , if a matching translation file is available - // 2. The value of this.lang, if a matching translation file is available + // Player language is determined given the following precedence: + // 1. The value of data-lang on the media element, if provided and a matching translation file is available + // 2. Lang attribute on or , if a matching translation file is available // 3. English - // To override this formula and force #2 to take precedence over #1, set data-force-lang="true" - if ($(media).data('force-lang') !== undefined && $(media).data('force-lang') !== false) { - this.forceLang = true; + // Final calculation occurs in translation.js > getTranslationText() + if ($(media).data('lang') !== undefined && $(media).data('lang') !== "") { + this.lang = $(media).data('lang').toLowerCase(); } else { - this.forceLang = false; + this.lang = null; } // Metadata Tracks @@ -430,11 +426,14 @@ var AblePlayerInstances = []; } // Search - if ($(media).data('search') !== undefined && $(media).data('search') !== "") { - // conducting a search currently requires an external div in which to write the results - if ($(media).data('search-div') !== undefined && $(media).data('search-div') !== "") { + // conducting a search requires an external div in which to write the results + if ($(media).data('search-div') !== undefined && $(media).data('search-div') !== "") { + + this.searchDiv = $(media).data('search-div'); + + // Search term (optional; could be assigned later in a JavaScript application) + if ($(media).data('search') !== undefined && $(media).data('search') !== "") { this.searchString = $(media).data('search'); - this.searchDiv = $(media).data('search-div'); } // Search Language @@ -445,6 +444,14 @@ var AblePlayerInstances = []; this.searchLang = null; // will change to final value of this.lang in translation.js > getTranslationText() } + // Search option: Ignore capitalization in search terms + if ($(media).data('search-ignore-caps') !== undefined && $(media).data('search-ignore-caps') !== false) { + this.searchIgnoreCaps = true; + } + else { + this.searchIgnoreCaps = false; + } + // conducting a search currently requires an external div in which to write the results if ($(media).data('search-div') !== undefined && $(media).data('search-div') !== "") { this.searchString = $(media).data('search'); @@ -464,6 +471,32 @@ var AblePlayerInstances = []; this.hideControlsOriginal = false; } + // Steno mode + // Enable support for Able Player keyboard shortcuts in textaarea fields + // so users can control the player while transcribing + if ($(media).data('steno-mode') !== undefined && $(media).data('steno-mode') !== false) { + this.stenoMode = true; + // Add support for stenography in an iframe via data-steno-iframe-id + if ($(media).data('steno-iframe-id') !== undefined && $(media).data('steno-iframe-id') !== "") { + this.stenoFrameId = $(media).data('steno-iframe-id'); + this.$stenoFrame = $('#' + this.stenoFrameId); + if (!(this.$stenoFrame.length)) { + // iframe not found + this.stenoFrameId = null; + this.$stenoFrame = null; + } + } + else { + this.stenoFrameId = null; + this.$stenoFrame = null; + } + } + else { + this.stenoMode = false; + this.stenoFrameId = null; + this.$stenoFrame = null; + } + // Define built-in variables that CANNOT be overridden with HTML attributes this.setDefaults(); @@ -546,10 +579,8 @@ var AblePlayerInstances = []; } }; - - - AblePlayer.youtubeIframeAPIReady = false; - AblePlayer.loadingYoutubeIframeAPI = false; + AblePlayer.youTubeIframeAPIReady = false; + AblePlayer.loadingYouTubeIframeAPI = false; })(jQuery); (function ($) { @@ -1109,7 +1140,7 @@ var AblePlayerInstances = []; } if (!this.playerCreated) { // only call these functions once - this.loadCurrentPreferences(); + this.loadCurrentPreferences(); this.injectPlayerCode(); } @@ -1119,70 +1150,86 @@ var AblePlayerInstances = []; this.initPlayer().then(function() { - thisObj.setupTracks().then(function() { + thisObj.setupTracks().then(function() { - thisObj.setupAltCaptions().then(function() { + thisObj.getBrowserVoices(); - thisObj.setupTranscript().then(function() { + thisObj.setupTranscript().then(function() { - thisObj.setFullscreen(false); + thisObj.initStenoFrame().then(function() { - if (typeof thisObj.volume === 'undefined') { - thisObj.volume = thisObj.defaultVolume; + if (thisObj.stenoMode && thisObj.$stenoFrame) { + thisObj.stenoFrameContents = thisObj.$stenoFrame.contents(); } - thisObj.setVolume(thisObj.volume); - if (thisObj.transcriptType) { - thisObj.addTranscriptAreaEvents(); - thisObj.updateTranscript(); - } - if (thisObj.mediaType === 'video') { - thisObj.initDescription(); - } - if (thisObj.captions.length) { - thisObj.initDefaultCaption(); - } + thisObj.getMediaTimes().then(function(mediaTimes) { - // setMediaAttributes() sets textTrack.mode to 'disabled' for all tracks - // This tells browsers to ignore the text tracks so Able Player can handle them - // However, timing is critical as browsers - especially Safari - tend to ignore this request - // unless it's sent late in the intialization process. - // If browsers ignore the request, the result is redundant captions - thisObj.setMediaAttributes(); - thisObj.addControls(); - thisObj.addEventListeners(); - - // inject each of the hidden forms that will be accessed from the Preferences popup menu - prefsGroups = thisObj.getPreferencesGroups(); - for (i = 0; i < prefsGroups.length; i++) { - thisObj.injectPrefsForm(prefsGroups[i]); - } - thisObj.setupPopups(); - thisObj.updateCaption(); - thisObj.injectVTS(); - if (thisObj.chaptersDivLocation) { - thisObj.populateChaptersDiv(); - } - thisObj.showSearchResults(); - - // Go ahead and load media, without user requesting it - // Ideally, we would wait until user clicks play, rather than unnecessarily consume their bandwidth - // However, the media needs to load before the 'loadedmetadata' event is fired - // and until that happens we can't get the media's duration - if (thisObj.player === 'html5') { - thisObj.$media[0].load(); - } - // refreshControls is called twice building/initializing the player - // this is the second. Best to pause a bit before executing, to be sure all prior steps are complete - setTimeout(function() { - thisObj.refreshControls('init'); - },100); - }, - function() { // initPlayer fail - thisObj.provideFallback(); - }); + thisObj.duration = mediaTimes['duration']; + thisObj.elapsed = mediaTimes['elapsed']; + + thisObj.setFullscreen(false); + + if (typeof thisObj.volume === 'undefined') { + thisObj.volume = thisObj.defaultVolume; + } + if (thisObj.volume) { + thisObj.setVolume(thisObj.volume); + } + + if (thisObj.transcriptType) { + thisObj.addTranscriptAreaEvents(); + thisObj.updateTranscript(); + } + if (thisObj.mediaType === 'video') { + thisObj.initDescription(); + } + if (thisObj.captions.length) { + thisObj.initDefaultCaption(); + } + + // setMediaAttributes() sets textTrack.mode to 'disabled' for all tracks + // This tells browsers to ignore the text tracks so Able Player can handle them + // However, timing is critical as browsers - especially Safari - tend to ignore this request + // unless it's sent late in the intialization process. + // If browsers ignore the request, the result is redundant captions + thisObj.setMediaAttributes(); + thisObj.addControls(); + + thisObj.addEventListeners(); + + // inject each of the hidden forms that will be accessed from the Preferences popup menu + prefsGroups = thisObj.getPreferencesGroups(); + for (i = 0; i < prefsGroups.length; i++) { + thisObj.injectPrefsForm(prefsGroups[i]); + } + thisObj.setupPopups(); + thisObj.updateCaption(); + thisObj.injectVTS(); + if (thisObj.chaptersDivLocation) { + thisObj.populateChaptersDiv(); + } + thisObj.showSearchResults(); + + // Go ahead and load media, without user requesting it + // Ideally, we would wait until user clicks play, rather than unnecessarily consume their bandwidth + // However, the media needs to load before the 'loadedmetadata' event is fired + // and until that happens we can't get the media's duration + if (thisObj.player === 'html5') { + thisObj.$media[0].load(); + } + // refreshControls is called twice building/initializing the player + // this is the second. Best to pause a bit before executing, to be sure all prior steps are complete + setTimeout(function() { + thisObj.refreshControls('init'); + },100); + }); + }); }); - }); + + }); + }, + function() { // initPlayer fail + thisObj.provideFallback(); }); }; @@ -1205,7 +1252,16 @@ var AblePlayerInstances = []; var promise = deferred.promise(); playerPromise.done( function () { // done/resolved - if (thisObj.useFixedSeekInterval === false) { + if (thisObj.useFixedSeekInterval) { + if (!thisObj.seekInterval) { + thisObj.seekInterval = thisObj.defaultSeekInterval; + } + else { + // fixed seekInterval was already assigned, using value of data-seek-interval attribute + } + thisObj.seekIntervalCalculated = true; + } + else { thisObj.setSeekInterval(); } deferred.resolve(); @@ -1218,6 +1274,34 @@ var AblePlayerInstances = []; return promise; }; + AblePlayer.prototype.initStenoFrame = function() { + + var thisObj, deferred, promise, $iframe; + thisObj = this; + + deferred = new $.Deferred(); + promise = deferred.promise(); + + if (this.stenoMode && this.$stenoFrame) { + + if (this.$stenoFrame[0].contentWindow,document.readyState == 'complete') { + // iframe has already loaded + deferred.resolve(); + } + else { + // iframe has not loaded. Wait for it. + this.$stenoFrame.on('load',function() { + deferred.resolve(); + }); + } + } + else { + // there is no stenoFrame to initialize + deferred.resolve(); + } + return promise; + }; + AblePlayer.prototype.setSeekInterval = function () { // this function is only called if this.useFixedSeekInterval is false @@ -1226,7 +1310,6 @@ var AblePlayerInstances = []; var thisObj, duration; thisObj = this; this.seekInterval = this.defaultSeekInterval; - if (this.useChapterTimes) { duration = this.chapterDuration; } @@ -1295,40 +1378,40 @@ var AblePlayerInstances = []; // sync all other tracks to this same languge this.syncTrackLanguages('init',this.captionLang); } - if (this.player === 'vimeo') { - if (this.usingVimeoCaptions && this.prefCaptions == 1) { - // initialize Vimeo captions to the default language - this.vimeoPlayer.enableTextTrack(this.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 - - break; - case 'InvalidTrackError': - // no track was available with the specified language and kind - - break; - default: - // some other error occurred - - break; - } - }); - } - else { - // disable Vimeo captions. - this.vimeoPlayer.disableTextTrack().then(function() { - // Vimeo captions disabled - }).catch(function(error) { - - }); - } - } - } + if (this.player === 'vimeo') { + if (this.usingVimeoCaptions && this.prefCaptions == 1) { + // initialize Vimeo captions to the default language + this.vimeoPlayer.enableTextTrack(this.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 + + break; + case 'InvalidTrackError': + // no track was available with the specified language and kind + + break; + default: + // some other error occurred + + break; + } + }); + } + else { + // disable Vimeo captions. + this.vimeoPlayer.disableTextTrack().then(function() { + // Vimeo captions disabled + }).catch(function(error) { + + }); + } + } + } }; AblePlayer.prototype.initHtml5Player = function () { @@ -1406,8 +1489,11 @@ var AblePlayerInstances = []; (function ($) { AblePlayer.prototype.setCookie = function(cookieValue) { - Cookies.set('Able-Player', cookieValue, { expires:90 }); - // set the cookie lifetime for 90 days + + Cookies.set('Able-Player', JSON.stringify(cookieValue), { + expires: 90, + sameSite: 'strict' + }); }; AblePlayer.prototype.getCookie = function() { @@ -1420,11 +1506,11 @@ var AblePlayerInstances = []; var cookie; try { - cookie = Cookies.getJSON('Able-Player'); + cookie = JSON.parse(Cookies.get('Able-Player')); } catch (err) { // Original cookie can't be parsed; update to default - Cookies.getJSON(defaultCookie); + this.setCookie(defaultCookie); cookie = defaultCookie; } if (cookie) { @@ -1495,7 +1581,18 @@ var AblePlayerInstances = []; // in the Preferences popup menu // Human-readable label for each group is defined in translation table if (this.mediaType === 'video') { - return ['captions','descriptions','keyboard','transcript']; + if (this.usingYouTubeCaptions) { + // no transcript is possible + return ['captions','descriptions','keyboard']; + } + else if (this.usingVimeoCaptions) { + // users cannot control caption appearance + // and no transcript is possible + return ['descriptions','keyboard']; + } + else { + return ['captions','descriptions','keyboard','transcript']; + } } else if (this.mediaType === 'audio') { var groups = []; @@ -1562,56 +1659,68 @@ var AblePlayerInstances = []; if (this.mediaType === 'video') { // Caption preferences + prefs.push({ 'name': 'prefCaptions', // closed captions default state 'label': null, 'group': 'captions', 'default': 1 }); -/* // not supported yet - prefs.push({ - 'name': 'prefCaptionsStyle', - 'label': this.tt.prefCaptionsStyle, - 'group': 'captions', - 'default': this.tt.captionsStylePopOn - }); -*/ - prefs.push({ - 'name': 'prefCaptionsPosition', - 'label': this.tt.prefCaptionsPosition, - 'group': 'captions', - 'default': this.defaultCaptionsPosition - }); - prefs.push({ - 'name': 'prefCaptionsFont', - 'label': this.tt.prefCaptionsFont, - 'group': 'captions', - 'default': this.tt.sans - }); + + if (!this.usingYouTubeCaptions) { + + /* // not supported yet + prefs.push({ + 'name': 'prefCaptionsStyle', + 'label': this.tt.prefCaptionsStyle, + 'group': 'captions', + 'default': this.tt.captionsStylePopOn + }); + */ + prefs.push({ + 'name': 'prefCaptionsPosition', + 'label': this.tt.prefCaptionsPosition, + 'group': 'captions', + 'default': this.defaultCaptionsPosition + }); + + prefs.push({ + 'name': 'prefCaptionsFont', + 'label': this.tt.prefCaptionsFont, + 'group': 'captions', + 'default': 'sans-serif' + }); + } + + // This is the one option that is supported by YouTube IFrame API prefs.push({ 'name': 'prefCaptionsSize', 'label': this.tt.prefCaptionsSize, 'group': 'captions', 'default': '100%' }); - prefs.push({ - 'name': 'prefCaptionsColor', - 'label': this.tt.prefCaptionsColor, - 'group': 'captions', - 'default': 'white' - }); - prefs.push({ - 'name': 'prefCaptionsBGColor', - 'label': this.tt.prefCaptionsBGColor, - 'group': 'captions', - 'default': 'black' - }); - prefs.push({ - 'name': 'prefCaptionsOpacity', - 'label': this.tt.prefCaptionsOpacity, - 'group': 'captions', - 'default': '100%' - }); + + if (!this.usingYouTubeCaptions) { + + prefs.push({ + 'name': 'prefCaptionsColor', + 'label': this.tt.prefCaptionsColor, + 'group': 'captions', + 'default': 'white' + }); + prefs.push({ + 'name': 'prefCaptionsBGColor', + 'label': this.tt.prefCaptionsBGColor, + 'group': 'captions', + 'default': 'black' + }); + prefs.push({ + 'name': 'prefCaptionsOpacity', + 'label': this.tt.prefCaptionsOpacity, + 'group': 'captions', + 'default': '100%' + }); + } // Description preferences prefs.push({ @@ -1621,22 +1730,46 @@ var AblePlayerInstances = []; 'default': 0 // off because users who don't need it might find it distracting }); prefs.push({ - 'name': 'prefDescFormat', // audio description default state + 'name': 'prefDescFormat', // audio description default format (if both 'video' and 'text' are available) 'label': null, 'group': 'descriptions', - 'default': 'video' + 'default': 'video' // video (an alternative described version) always wins + }); + prefs.push({ + 'name': 'prefDescVoice', + 'label': this.tt.prefDescVoice, + 'group': 'descriptions', + 'default': null // will be set later, in injectPrefsForm() + }); + prefs.push({ + 'name': 'prefDescPitch', + 'label': this.tt.prefDescPitch, + 'group': 'descriptions', + 'default': 1 // 0 to 2 + }); + prefs.push({ + 'name': 'prefDescRate', + 'label': this.tt.prefDescRate, + 'group': 'descriptions', + 'default': 1 // 0.1 to 10 (1 is normal speech; 2 is fast but decipherable; >2 is super fast) + }); + prefs.push({ + 'name': 'prefDescVolume', + 'label': this.tt.volume, + 'group': 'descriptions', + 'default': 1 // 0 to 1 }); prefs.push({ 'name': 'prefDescPause', // automatically pause when closed description starts 'label': this.tt.prefDescPause, 'group': 'descriptions', - 'default': 0 // off because it burdens user with restarting after every pause + 'default': 1 // on as of 4.3.16, because extended description is frequently necessary }); prefs.push({ - 'name': 'prefVisibleDesc', // visibly show closed description (if avilable and used) - 'label': this.tt.prefVisibleDesc, + 'name': 'prefDescVisible', // visibly show closed description (if avilable and used) + 'label': this.tt.prefDescVisible, 'group': 'descriptions', - 'default': 1 // on because sighted users probably want to see this cool feature in action + 'default': 0 // off as of 4.3.16, to avoid overloading the player with visible features }); // Video preferences without a category (not shown in Preferences dialogs) @@ -1653,11 +1786,10 @@ var AblePlayerInstances = []; AblePlayer.prototype.loadCurrentPreferences = function () { - // Load current/default preferences from cookie into the AblePlayer object. + // Load current/default preferences from cookie into the AblePlayer object. var available = this.getAvailablePreferences(); var cookie = this.getCookie(); - // Copy current cookie values into this object, and fill in any default values. for (var ii = 0; ii < available.length; ii++) { var prefName = available[ii]['name']; @@ -1680,7 +1812,8 @@ var AblePlayerInstances = []; // Creates a preferences form and injects it. // form is one of the supported forms (groups) defined in getPreferencesGroups() - var available, thisObj, $prefsDiv, formTitle, introText, + var thisObj, available, descLangs, + $prefsDiv, formTitle, introText, $prefsIntro,$prefsIntroP2,p3Text,$prefsIntroP3,i, j, $fieldset, fieldsetClass, fieldsetId, $descFieldset, $descLegend, $legend, @@ -1786,12 +1919,12 @@ var AblePlayerInstances = []; fieldsetId = this.mediaId + '-prefs-' + form; $fieldset.addClass(fieldsetClass).attr('id',fieldsetId); if (form === 'keyboard') { - $legend = $('' + this.tt.prefHeadingKeyboard1 + ''); + $legend = $('' + this.tt.prefHeadingKeyboard1 + ''); $fieldset.append($legend); } else if (form === 'descriptions') { - $legend = $('' + this.tt.prefHeadingTextDescription + ''); - $fieldset.append($legend); + $legend = $('' + this.tt.prefHeadingTextDescription + ''); + $fieldset.append($legend); } for (i=0; i ' + available[i]['label'] + ''); + if (thisPref === 'prefDescPause' || thisPref === 'prefDescVisible') { + // these preferences are checkboxes + $thisDiv.addClass('able-prefs-checkbox'); + $thisField = $('',{ + type: 'checkbox', + name: thisPref, + id: thisId, + value: 'true' + }); + // check current active value for this preference + if (this[thisPref] === 1) { + $thisField.prop('checked',true); + } + $thisDiv.append($thisField,$thisLabel); + } + else if (this.synth) { + // Only show these options if browser supports speech synthesis + $thisDiv.addClass('able-prefs-select'); + $thisField = $('',{ @@ -1871,7 +2092,7 @@ var AblePlayerInstances = []; } if (form === 'keyboard') { // add a change handler that updates the list of current keyboard shortcuts - $thisField.change(function() { + $thisField.on('change',function() { changedPref = $(this).attr('name'); if (changedPref === 'prefAltKey') { changedSpan = '.able-modkey-alt'; @@ -1902,7 +2123,8 @@ var AblePlayerInstances = []; if (form === 'captions') { // add a sample closed caption div to prefs dialog - if (this.mediaType === 'video') { + // do not show this for YouTube captions, since it's not an accurate reflection + if (this.mediaType === 'video' && !this.usingYouTubeCaptions) { this.$sampleCapsDiv = $('
',{ 'class': 'able-captions-sample' }).text(this.tt.sampleCaptionText); @@ -1910,6 +2132,15 @@ var AblePlayerInstances = []; this.stylizeCaptions(this.$sampleCapsDiv); } } + else if (form === 'descriptions') { + if (this.synth) { + // add a div with sample audio description text + this.$sampleDescDiv = $('
',{ + 'class': 'able-desc-sample' + }).text(this.tt.sampleDescriptionText); + $prefsDiv.append(this.$sampleDescDiv); + } + } else if (form === 'keyboard') { // add a current list of keyboard shortcuts $kbHeading = $('

',{ @@ -2036,7 +2267,7 @@ var AblePlayerInstances = []; cancelButton = $(''); saveButton.click(function () { dialog.hide(); - thisObj.savePrefsFromForm(); + thisObj.savePrefsFromForm(); }); cancelButton.click(function () { dialog.hide(); @@ -2073,13 +2304,100 @@ var AblePlayerInstances = []; }); }; + AblePlayer.prototype.rebuildDescPrefsForm = function () { + + // Called if getBrowserVoices() succeeded after an earlier failure + + var i, optionValue, optionText, $thisOption; + + this.$voiceSelectField = $('#' + this.mediaId + '_prefDescVoice'); + for (i=0; i < this.descVoices.length; i++) { + optionValue = this.descVoices[i].name; + optionText = optionValue + ' (' + this.descVoices[i].lang + ')'; + $thisOption = $('

').parent(),this.$ableDiv=this.$mediaContainer.wrap('
').parent(),this.$ableWrapper=this.$ableDiv.wrap('
').parent(),this.$ableWrapper.addClass("able-skin-"+this.skin),this.$ableWrapper.css({"max-width":this.playerMaxWidth+"px"}),this.injectOffscreenHeading(),"video"===this.mediaType&&("image"==this.iconType||"youtube"===this.player&&!this.hasPoster||this.injectBigPlayButton(),t=A("
",{class:"able-vidcap-container"}),this.$vidcapContainer=this.$mediaContainer.wrap(t).parent()),this.injectPlayerControlArea(),this.injectTextDescriptionArea(),this.injectAlert(),this.injectPlaylist()},AblePlayer.prototype.injectOffscreenHeading=function(){var t;"0"==this.playerHeadingLevel||(void 0===this.playerHeadingLevel&&(this.playerHeadingLevel=this.getNextHeadingLevel(this.$ableDiv)),t="h"+this.playerHeadingLevel.toString(),this.$headingDiv=A("<"+t+">"),this.$ableDiv.prepend(this.$headingDiv),this.$headingDiv.addClass("able-offscreen"),this.$headingDiv.text(this.tt.playerHeading))},AblePlayer.prototype.injectBigPlayButton=function(){this.$bigPlayButton=A("
')}for(var T in"video"===this.mediaType&&(void 0!==this.$captionsDiv&&this.stylizeCaptions(this.$captionsDiv),void 0!==this.$descDiv&&this.stylizeCaptions(this.$descDiv)),this.controls=[],t)t.hasOwnProperty(T)&&(this.controls=this.controls.concat(t[T]));this.refreshControls("init")},AblePlayer.prototype.useSvg=function(){var t,e,g=Object.create(null),f=function(){clearTimeout(e),e=setTimeout(t,100)},m=function(){},v="http://www.w3.org/1999/xlink";t=function(){var t,e,i,s,a,n,r,o,l,h=0;if(window.XMLHttpRequest&&(a=void 0!==(a=new XMLHttpRequest).withCredentials?XMLHttpRequest:XDomainRequest||void 0),void 0!==a){for(m(),o=document.getElementsByTagName("use"),s=0;s",{src:A(this).attr("data-src")});o.hasAttr(A(this),"data-type")&&t.attr("type",A(this).attr("data-type")),o.hasAttr(A(this),"data-desc-src")&&t.attr("data-desc-src",A(this).attr("data-desc-src")),o.hasAttr(A(this),"data-sign-src")&&t.attr("data-sign-src",A(this).attr("data-sign-src")),o.$media.append(t)}});var h=e.children("span.able-track");h.length&&h.each(function(){if(o.hasAttr(A(this),"data-src")&&o.hasAttr(A(this),"data-kind")&&o.hasAttr(A(this),"data-srclang")){var t=A("",{src:A(this).attr("data-src"),kind:A(this).attr("data-kind"),srclang:A(this).attr("data-srclang")});o.hasAttr(A(this),"data-label")&&t.attr("label",A(this).attr("data-label")),o.$media.append(t)}}),a=e.text(),this.hasAttr(e,"lang")&&(n=e.attr("lang")),this.$sources=this.$media.find("source"),this.recreatePlayer(),this.$playlist.removeClass("able-current"),this.$playlist.eq(t).addClass("able-current"),!0===this.showNowPlaying&&void 0!==this.$nowPlayingDiv&&(r=A(""),void 0!==n&&r.attr("lang",n),r.html(""+this.tt.selectedTrack+":"+a),this.$nowPlayingDiv.html(r)),this.initializing?this.swappingSrc=!1:(this.swappingSrc=!0,"html5"===this.player?this.media.load():"youtube"===this.player&&(this.okToPlay=!0))},AblePlayer.prototype.deletePlayer=function(){"youtube"==this.player&&this.$mediaContainer.find("iframe").remove();this.$media.removeAttr("poster width height"),this.$media.empty(),this.$controllerDiv.empty(),this.$elapsedTimeContainer.empty().text("0:00"),this.$durationContainer.empty(),this.$signWindow&&this.$signWindow.remove(),this.$transcriptArea&&this.$transcriptArea.remove(),A(".able-modal-dialog").remove(),this.hasCaptions=!1,this.hasChapters=!1,this.captionsPopup=null,this.chaptersPopup=null},AblePlayer.prototype.getButtonTitle=function(t){return"playpause"===t?this.tt.play:"play"===t?this.tt.play:"pause"===t?this.tt.pause:"restart"===t?this.tt.restart:"previous"===t?this.tt.prevTrack:"next"===t?this.tt.nextTrack:"rewind"===t?this.tt.rewind:"forward"===t?this.tt.forward:"captions"===t?1",{class:"able-captions"}),this.$captionsWrapper=c("
",{class:"able-captions-wrapper","aria-hidden":"true"}).hide(),"below"===this.prefCaptionsPosition?this.$captionsWrapper.addClass("able-captions-below"):this.$captionsWrapper.addClass("able-captions-overlay"),this.$captionsWrapper.append(this.$captionsDiv),this.$vidcapContainer.append(this.$captionsWrapper))),this.currentCaption=-1,1===this.prefCaptions?this.captionsOn=!0:this.captionsOn=!1,0===this.captions.length)this.captions.push({cues:s,language:e,label:i,def:t.def}),this.captionLabels.push(i);else{for(a=!1,n=0;n",{style:"display:none"})).load(s,function(t,e,i){"error"===e?(n.debug,a.fail()):a.resolve(s,t),r.remove()}),t},AblePlayer.prototype.setupAltCaptions=function(){var t=new c.Deferred,e=t.promise();return 0===this.captions.length?"youtube"===this.player&&this.usingYouTubeCaptions?this.setupYouTubeCaptions().done(function(){t.resolve()}):"vimeo"===this.player&&this.usingVimeoCaptions?this.setupVimeoCaptions().done(function(){t.resolve()}):t.resolve():t.resolve(),e}}(jQuery),function(u){AblePlayer.prototype.initYouTubePlayer=function(){var t,e,i,s;return t=this,i=(e=new u.Deferred).promise(),s=this.youTubeDescId&&this.prefDesc?this.youTubeDescId:this.youTubeId,this.activeYouTubeId=s,AblePlayer.youtubeIframeAPIReady?this.finalizeYoutubeInit().then(function(){e.resolve()}):(AblePlayer.loadingYoutubeIframeAPI||u.getScript("https://www.youtube.com/iframe_api").fail(function(){e.fail()}),u("body").on("youtubeIframeAPIReady",function(){t.finalizeYoutubeInit().then(function(){e.resolve()})})),i},AblePlayer.prototype.finalizeYoutubeInit=function(){var e,t,i,s,a,n;return t=(e=new u.Deferred).promise(),s=(i=this).mediaId+"_youtube",this.$mediaContainer.prepend(u("
").attr("id",s)),0,(a=this.getYouTubeDimensions(this.activeYouTubeId,s))?(this.ytWidth=a[0],this.ytHeight=a[1],this.aspectRatio=i.ytWidth/i.ytHeight):(this.ytWidth=null,this.ytHeight=null),n=this.okToPlay?1:0,this.youTubePlayer=new YT.Player(s,{videoId:this.activeYouTubeId,host:this.youTubeNoCookie?"https://www.youtube-nocookie.com":"https://www.youtube.com",width:this.ytWidth,height:this.ytHeight,playerVars:{autoplay:n,enablejsapi:1,disableKb:1,playsinline:this.playsInline,start:this.startTime,controls:0,cc_load_policy:0,hl:this.lang,modestbranding:1,rel:0,html5:1,iv_load_policy:3},events:{onReady:function(){i.swappingSrc&&(i.swappingSrc=!1,i.cueingPlaylistItem=!1,i.playing&&i.playMedia()),i.userClickedPlaylist&&(i.userClickedPlaylist=!1),void 0===i.aspectRatio&&i.resizeYouTubePlayer(i.activeYouTubeId,s),e.resolve()},onError:function(t){e.fail()},onStateChange:function(t){i.getPlayerState().then(function(t){"playing"===t?(i.playing=!0,i.startedPlaying=!0,i.paused=!1):"ended"==t?i.onMediaComplete():(i.playing=!1,i.paused=!0),i.stoppingYouTube&&"paused"===t&&(void 0!==i.$posterImg&&i.$posterImg.show(),i.stoppingYouTube=!1,i.seeking=!1,i.playing=!1,i.paused=!0)})},onPlaybackQualityChange:function(){},onApiChange:function(t){i.initYouTubeCaptionModule()}}}),this.injectPoster(this.$mediaContainer,"youtube"),this.hasPlaylist||this.$media.remove(),t},AblePlayer.prototype.getYouTubeDimensions=function(t){var e,i,s,a;return e=[],void 0!==this.playerMaxWidth?(e[0]=this.playerMaxWidth,void 0!==this.playerMaxHeight&&(e[1]=this.playerMaxHeight),e):void 0!==u("#"+t)&&(s=(i=u("#"+t)).width(),a=i.height(),0
"),this.playedDiv=d("
")),this.seekHead=d("
",{orientation:i,class:"able-"+l+"-head"}),"visible"===p?this.seekHead.attr("tabindex","0"):this.seekHead.attr("tabindex","-1"),this.seekHead.attr({role:"slider","aria-label":o,"aria-valuemin":a,"aria-valuemax":n}),this.timeTooltip=d("
"),this.bodyDiv.append(this.timeTooltip),this.timeTooltip.attr("role","tooltip"),this.timeTooltip.addClass("able-tooltip"),this.timeTooltip.hide(),this.bodyDiv.append(this.loadedDiv),this.bodyDiv.append(this.playedDiv),this.bodyDiv.append(this.seekHead),this.bodyDiv.wrap("
"),this.wrapperDiv=this.bodyDiv.parent(),"legacy"===this.skin&&("horizontal"===i?(this.wrapperDiv.width(s),this.loadedDiv.width(0)):(this.wrapperDiv.height(s),this.loadedDiv.height(0))),this.wrapperDiv.addClass("able-"+l+"-wrapper"),h&&(this.loadedDiv.addClass("able-"+l+"-loaded"),this.playedDiv.width(0),this.playedDiv.addClass("able-"+l+"-played"),this.setDuration(n)),this.seekHead.on("mouseenter mouseleave mousemove mousedown mouseup focus blur touchstart touchmove touchend",function(t){u=c.pointerEventToXY(t),"mouseenter"===t.type||"focus"===t.type?c.overHead=!0:"mouseleave"===t.type||"blur"===t.type?(c.overHead=!1,!c.overBody&&c.tracking&&"mouse"===c.trackDevice&&c.stopTracking(c.pageXToPosition(u.x))):"mousemove"===t.type||"touchmove"===t.type?c.tracking&&"mouse"===c.trackDevice&&c.trackHeadAtPageX(u.x):"mousedown"===t.type||"touchstart"===t.type?(c.startTracking("mouse",c.pageXToPosition(c.seekHead.offset()+c.seekHead.width()/2)),c.bodyDiv.is(":focus")||c.bodyDiv.focus(),t.preventDefault()):"mouseup"!==t.type&&"touchend"!==t.type||c.tracking&&"mouse"===c.trackDevice&&c.stopTracking(c.pageXToPosition(u.x)),"mousemove"!==t.type&&"mousedown"!==t.type&&"mouseup"!==t.type&&"touchstart"!==t.type&&"touchend"!==t.type&&c.refreshTooltip()}),this.bodyDiv.on("mouseenter mouseleave mousemove mousedown mouseup keydown keyup touchstart touchmove touchend",function(t){if(u=c.pointerEventToXY(t),"mouseenter"===t.type)c.overBody=!0;else if("mouseleave"===t.type)c.overBody=!1,c.overBodyMousePos=null,!c.overHead&&c.tracking&&"mouse"===c.trackDevice&&c.stopTracking(c.pageXToPosition(u.x));else if("mousemove"===t.type||"touchmove"===t.type)c.overBodyMousePos={x:u.x,y:u.y},c.tracking&&"mouse"===c.trackDevice&&c.trackHeadAtPageX(u.x);else if("mousedown"===t.type||"touchstart"===t.type)c.startTracking("mouse",c.pageXToPosition(u.x)),c.trackHeadAtPageX(u.x),c.seekHead.is(":focus")||c.seekHead.focus(),t.preventDefault();else if("mouseup"===t.type||"touchend"===t.type)c.tracking&&"mouse"===c.trackDevice&&c.stopTracking(c.pageXToPosition(u.x));else if("keydown"===t.type){if(36===t.which)c.trackImmediatelyTo(0);else if(35===t.which)c.trackImmediatelyTo(c.duration);else if(37===t.which||40===t.which)c.arrowKeyDown(-1);else if(39===t.which||38===t.which)c.arrowKeyDown(1);else if(33===t.which&&0",{class:"able-offscreen","aria-live":"polite"}),this.wrapperDiv.append(this.liveAriaRegion)),e&&this.liveAriaRegion.text()!==i&&this.liveAriaRegion.text(i),this.seekHead.attr("aria-valuetext",i),this.seekHead.attr("aria-valuenow",Math.floor(t).toString())},AccessibleSlider.prototype.trackImmediatelyTo=function(t){this.startTracking("keyboard",t),this.trackHeadAtPosition(t),this.keyTrackPosition=t},AccessibleSlider.prototype.refreshTooltip=function(){this.overHead?(this.timeTooltip.show(),this.tracking?this.timeTooltip.text(this.positionToStr(this.lastTrackPosition)):this.timeTooltip.text(this.positionToStr(this.position)),this.setTooltipPosition(this.seekHead.position().left+this.seekHead.width()/2)):this.overBody&&this.overBodyMousePos?(this.timeTooltip.show(),this.timeTooltip.text(this.positionToStr(this.pageXToPosition(this.overBodyMousePos.x))),this.setTooltipPosition(this.overBodyMousePos.x-this.bodyDiv.offset().left)):this.timeTooltip.hide()},AccessibleSlider.prototype.setTooltipPosition=function(t){this.timeTooltip.css({left:t-this.timeTooltip.width()/2-10,bottom:this.seekHead.height()+10})},AccessibleSlider.prototype.positionToStr=function(t){var e=Math.floor(t/3600),i=Math.floor(t/60)%60,s=Math.floor(t%60);return s<10&&(s="0"+s),0",{id:i,class:"able-volume-slider","aria-hidden":"true"}).hide(),this.$volumeSliderTooltip=r("
",{class:"able-tooltip",role:"tooltip"}).hide(),this.$volumeSliderTrack=r("
",{class:"able-volume-track"}),this.$volumeSliderTrackOn=r("
",{class:"able-volume-track able-volume-track-on"}),this.$volumeSliderHead=r("
",{class:"able-volume-head",role:"slider","aria-orientation":"vertical","aria-label":this.tt.volumeUpDown,"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":this.volume,tabindex:-1}),this.$volumeSliderTrack.append(this.$volumeSliderTrackOn,this.$volumeSliderHead),this.$volumeAlert=r("
",{class:"able-offscreen","aria-live":"assertive","aria-atomic":"true"}),n=parseInt(e.volume)/10*100,this.$volumeHelp=r("
",{id:s,class:"able-volume-help"}).text(n+"%, "+this.tt.volumeHelp),this.$volumeButton.attr({"aria-describedby":s}),this.$volumeSlider.append(this.$volumeSliderTooltip,this.$volumeSliderTrack,this.$volumeAlert,this.$volumeHelp),t.append(this.$volumeSlider),this.refreshVolumeSlider(this.volume),this.$volumeSliderHead.on("mousedown",function(t){t.preventDefault(),e.draggingVolume=!0,e.volumeHeadPositionTop=r(this).offset().top}),this.$mediaContainer.on("mouseover",function(t){"youtube"==e.player&&(e.draggingVolume=!1)}),r(document).on("mouseup",function(t){e.draggingVolume=!1}),r(document).on("mousemove",function(t){e.draggingVolume&&(t.pageX,a=t.pageY,e.moveVolumeHead(a))}),this.$volumeSliderHead.on("keydown",function(t){if(37===t.which||40===t.which)e.handleVolume("down");else if(39===t.which||38===t.which)e.handleVolume("up");else{if(27!==t.which&&13!==t.which&&9!==t.which)return;e.$volumeSlider.is(":visible")?e.hideVolumePopup():e.showVolumePopup()}t.preventDefault()})},AblePlayer.prototype.refreshVolumeSlider=function(t){var e,i,s,a,n;i=(e=t/10*100)+"%",s=t*this.volumeTickHeight,n=(a=this.volumeTrackHeight-s)-this.volumeHeadHeight,this.$volumeSliderTrackOn&&this.$volumeSliderTrackOn.css({height:s+"px",top:a+"px"}),this.$volumeSliderHead&&(this.$volumeSliderHead.attr({"aria-valuenow":t,"aria-valuetext":i}),this.$volumeSliderHead.css({top:n+"px"})),this.$volumeAlert&&this.$volumeAlert.text(e+"%")},AblePlayer.prototype.refreshVolumeButton=function(t){var e,i,s,a,n,r;e=this.getVolumeName(t),i=t/10*100,s=this.tt.volume+" "+i+"%","font"===this.iconType?(a="icon-volume-"+e,this.$volumeButton.find("span").first().removeClass().addClass(a),this.$volumeButton.find("span.able-clipped").text(s)):"image"===this.iconType?(n=this.imgPath+"volume-"+e+".png",this.$volumeButton.find("img").attr("src",n)):"svg"===this.iconType&&("mute"!==e&&(e="volume-"+e),r=this.getSvgData(e),this.$volumeButton.find("svg").attr("viewBox",r[0]),this.$volumeButton.find("path").attr("d",r[1]))},AblePlayer.prototype.moveVolumeHead=function(t){var e,i,s,a=this.volumeHeadPositionTop-t;if(Math.abs(a)>this.volumeTickHeight){if("up"==(e=0",{class:"modalCloseButton",title:h.closeButtonLabel,"aria-label":h.closeButtonLabel}).text("X");c.keydown(function(t){32===t.which&&h.hide()}).click(function(){h.hide()});var u=d("

");u.attr("id","modalTitle-"+this.baseId),u.css("text-align","center"),u.text(s),a.attr("id","modalDesc-"+this.baseId),p.attr({"aria-labelledby":"modalTitle-"+this.baseId,"aria-describedby":"modalDesc-"+this.baseId}),p.prepend(u),p.prepend(c)}p.attr({"aria-hidden":"true",role:i}),p.keydown(function(t){if(27===t.which)h.escapeHook?h.escapeHook(t,this):(h.hide(),t.preventDefault());else if(9===t.which){var e=p.find("*").filter(g).filter(":visible");if(0===e.length)return;var i=d(":focus"),s=e.index(i);t.shiftKey?0===s&&(e.get(e.length-1).focus(),t.preventDefault()):s===e.length-1&&(e.get(0).focus(),t.preventDefault())}t.stopPropagation()}),d("body > *").not(".able-modal-overlay").not(".able-modal-dialog").removeAttr("aria-hidden")},AccessibleDialog.prototype.show=function(){if(!this.overlay){var t=d("
").attr({class:"able-modal-overlay",tabindex:"-1"});this.overlay=t,d("body").append(t),t.on("mousedown.accessibleModal",function(t){t.preventDefault()})}d("body > *").not(".able-modal-overlay").not(".able-modal-dialog").attr("aria-hidden","true"),this.overlay.css("display","block"),this.modal.css("display","block"),this.modal.attr({"aria-hidden":"false",tabindex:"-1"}),0===this.modal.find("*").filter(g).filter(":visible").length&&this.focusedElementBeforeModal.blur();var e=this;setTimeout(function(){e.modal.focus()},300)},AccessibleDialog.prototype.hide=function(){this.overlay&&this.overlay.css("display","none"),this.modal.css("display","none"),this.modal.attr("aria-hidden","true"),d("body > *").not(".able-modal-overlay").not(".able-modal-dialog").removeAttr("aria-hidden"),this.focusedElementBeforeModal.focus()}}(jQuery),function(n){AblePlayer.prototype.getNextHeadingLevel=function(t){var e,i,s,a;return t.parents().each(function(){if(e=n(this).children(":header"),i=e.length)return s=e.eq(i-1).prop("tagName"),!1}),void 0===s?a=1:(a=parseInt(s[1]),6<(a+=1)&&(a=6)),a},AblePlayer.prototype.countProperties=function(t){var e,i;for(i in e=0,t)t.hasOwnProperty(i)&&++e;return e},AblePlayer.prototype.formatSecondsAsColonTime=function(t,e){var i,s,a,n,r,o,l;if(e)if(2===(n=t.toString().split(".")).length){if((r=n[1]).length<3)for(o=3-r.length,l=1;l<=o;l++)r+="0"}else r="000";return i=Math.floor(t/3600),s=Math.floor(t/60)%60,(a=Math.floor(t%60))<10&&(a="0"+a),0t){a=s;break}void 0!==a?this.currentDescription!==a&&(this.$status.removeAttr("aria-live"),n=o(i[a].components),this.exposeTextDescriptions&&void 0!==this.synth&&void 0!==this.descVoiceIndex?((r=new SpeechSynthesisUtterance).voice=this.descVoices[this.descVoiceIndex],r.voiceURI="native",r.volume=1,r.rate=1.5,r.pitch=1,r.text=n,r.lang=this.captionLang,r.onend=function(t){e.pausedForDescription&&e.playMedia()},this.synth.speak(r),this.prefVisibleDesc&&this.$descDiv.html(n).removeAttr("aria-live aria-atomic")):this.$descDiv.html(n),this.prefDescPause&&this.exposeTextDescriptions&&(this.pauseMedia(),this.pausedForDescription=!0),this.currentDescription=a):(this.$descDiv.html(""),this.currentDescription=-1,this.$status.attr("aria-live","polite"))}},jQuery,AblePlayer.prototype.getUserAgent=function(){this.userAgent={},this.userAgent.browser={},/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)?(this.userAgent.browser.name="Firefox",this.userAgent.browser.version=RegExp.$1):/MSIE (\d+\.\d+);/.test(navigator.userAgent)?(this.userAgent.browser.name="Internet Explorer",this.userAgent.browser.version=RegExp.$1):/Trident.*rv[ :]*(\d+\.\d+)/.test(navigator.userAgent)?(this.userAgent.browser.name="Internet Explorer",this.userAgent.browser.version=RegExp.$1):/Edge[\/\s](\d+\.\d+)/.test(navigator.userAgent)?(this.userAgent.browser.name="Edge",this.userAgent.browser.version=RegExp.$1):/OPR\/(\d+\.\d+)/i.test(navigator.userAgent)?(this.userAgent.browser.name="Opera",this.userAgent.browser.version=RegExp.$1):/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)?(this.userAgent.browser.name="Chrome",/Chrome[\/\s](\d+\.\d+)/.test(navigator.userAgent)&&(this.userAgent.browser.version=RegExp.$1)):/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)?(this.userAgent.browser.name="Safari",/Version[\/\s](\d+\.\d+)/.test(navigator.userAgent)&&(this.userAgent.browser.version=RegExp.$1)):(this.userAgent.browser.name="Unknown",this.userAgent.browser.version="Unknown"),-1!=window.navigator.userAgent.indexOf("Windows NT 6.2")?this.userAgent.os="Windows 8":-1!=window.navigator.userAgent.indexOf("Windows NT 6.1")?this.userAgent.os="Windows 7":-1!=window.navigator.userAgent.indexOf("Windows NT 6.0")?this.userAgent.os="Windows Vista":-1!=window.navigator.userAgent.indexOf("Windows NT 5.1")?this.userAgent.os="Windows XP":-1!=window.navigator.userAgent.indexOf("Windows NT 5.0")?this.userAgent.os="Windows 2000":-1!=window.navigator.userAgent.indexOf("Mac")?this.userAgent.os="Mac/iOS":-1!=window.navigator.userAgent.indexOf("X11")?this.userAgent.os="UNIX":-1!=window.navigator.userAgent.indexOf("Linux")&&(this.userAgent.os="Linux"),this.debug},AblePlayer.prototype.isUserAgent=function(t){var e=navigator.userAgent.toLowerCase();return this.debug,-1!==e.indexOf(t.toLowerCase())},AblePlayer.prototype.isIOS=function(t){var e;return e=navigator.userAgent.toLowerCase(),!!/ipad|iphone|ipod/.exec(e)&&(void 0===t||-1!==e.indexOf("os "+t))},AblePlayer.prototype.browserSupportsVolume=function(){var t,e;return t=navigator.userAgent.toLowerCase(),!(e=/ipad|iphone|ipod|android|blackberry|windows ce|windows phone|webos|playbook/.exec(t))||!("android"!==e[0]||!/firefox/.test(t))},AblePlayer.prototype.nativeFullscreenSupported=function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled},function(v){AblePlayer.prototype.seekTo=function(t){var e;(this.seekFromTime=this.media.currentTime,this.seekToTime=t,this.seeking=!0,this.liveUpdatePending=!0,"html5"===this.player)?(this.startTime=t,0<(e=this.media.seekable).length&&this.startTime>=e.start(0)&&this.startTime<=e.end(0)&&(this.media.currentTime=this.startTime,this.hasSignLanguage&&this.signVideo&&(this.signVideo.currentTime=this.startTime))):"youtube"===this.player?(this.youTubePlayer.seekTo(t,!0),0this.chapterDuration&&(g=this.chapterDuration),this.seekBar&&this.seekBar.setBuffered(g/this.chapterDuration)):this.seekBar&&(isNaN(g)||this.seekBar.setBuffered(g/t))):"youtube"===this.player?this.seekBar&&this.seekBar.setBuffered(this.youTubePlayer.getVideoLoadedFraction()):this.player,this.$descButton&&(this.descOn?(this.$descButton.removeClass("buttonOff").attr("aria-label",this.tt.turnOffDescriptions),this.$descButton.find("span.able-clipped").text(this.tt.turnOffDescriptions)):(this.$descButton.addClass("buttonOff").attr("aria-label",this.tt.turnOnDescriptions),this.$descButton.find("span.able-clipped").text(this.tt.turnOnDescriptions))),this.$ccButton&&(d=this.captions.length,this.captionsOn?(this.$ccButton.removeClass("buttonOff"),1===d&&(this.$ccButton.attr("aria-label",this.tt.hideCaptions),this.$ccButton.find("span.able-clipped").text(this.tt.hideCaptions))):(this.$ccButton.addClass("buttonOff"),1===d&&(this.$ccButton.attr("aria-label",this.tt.showCaptions),this.$ccButton.find("span.able-clipped").text(this.tt.showCaptions))),1s.statusMessageThreshold&&(s.$status.text(o[t]),s.statusDebounceStart=null,clearTimeout(s.statusTimeout),s.statusTimeout=null):(s.statusDebounceStart=l,s.debouncingStatus=!0,s.statusTimeout=setTimeout(function(){s.debouncingStatus=!1,s.refreshControls(e)},s.statusMessageThreshold))),s.seekBar.tracking||s.stoppingYouTube||("paused"===t||"stopped"===t||"ended"===t?(s.$playpauseButton.attr("aria-label",s.tt.play),"font"===s.iconType?(s.$playpauseButton.find("span").first().removeClass("icon-pause").addClass("icon-play"),s.$playpauseButton.find("span.able-clipped").text(s.tt.play)):"svg"===s.iconType?(m=s.getSvgData("play"),s.$playpauseButton.find("svg").attr("viewBox",m[0]),s.$playpauseButton.find("path").attr("d",m[1])):s.$playpauseButton.find("img").attr("src",s.playButtonImg)):(s.$playpauseButton.attr("aria-label",s.tt.pause),"font"===s.iconType?(s.$playpauseButton.find("span").first().removeClass("icon-play").addClass("icon-pause"),s.$playpauseButton.find("span.able-clipped").text(s.tt.pause)):"svg"===s.iconType?(m=s.getSvgData("pause"),s.$playpauseButton.find("svg").attr("viewBox",m[0]),s.$playpauseButton.find("path").attr("d",m[1])):s.$playpauseButton.find("img").attr("src",s.pauseButtonImg)))}),this.fullscreen||(this.$statusBarDiv.height()+5this.duration||t>this.currentChapter.end?t=Math.min(this.duration,this.currentChapter.end):this.duration%tthis.currentChapter.end&&(t=this.currentChapter.end):t>this.duration&&(t=this.duration),this.seekTo(t)},AblePlayer.prototype.handleRateIncrease=function(){this.changeRate(1)},AblePlayer.prototype.handleRateDecrease=function(){this.changeRate(-1)},AblePlayer.prototype.changeRate=function(t){var e,i,s,a;"html5"===this.player?this.setPlaybackRate(this.getPlaybackRate()+.25*t):"youtube"===this.player?(e=this.youTubePlayer.getAvailablePlaybackRates(),i=this.getPlaybackRate(),-1===(s=e.indexOf(i))||(s+=t)"),n=v("

",{class:"able-screenreader-alert"}).text(this.tt.fullscreen);a.append(n),this.fullscreenDialog=new AccessibleDialog(a,this.$fullscreenButton,"dialog","Fullscreen video player",n,this.tt.exitFullScreen,"100%",!0,function(){e.handleFullscreenToggle()}),v("body").append(a)}var r=this.paused;if(t){this.modalFullscreenActive=!0,this.fullscreenDialog.show(),this.$modalFullscreenPlaceholder=v('

'),this.$modalFullscreenPlaceholder.insertAfter(i),i.appendTo(this.fullscreenDialog.modal),i===this.$ableColumnLeft&&i.width("100%");var o=v(window).height()-this.$playerDiv.height();this.$descDiv.is(":hidden")||(o-=this.$descDiv.height()),this.resizePlayer(v(window).width(),o)}else this.modalFullscreenActive=!1,i===this.$ableColumnLeft&&i.width("50%"),i.insertAfter(this.$modalFullscreenPlaceholder),this.$modalFullscreenPlaceholder.remove(),this.fullscreenDialog.hide(),this.resizePlayer(this.$ableWrapper.width(),this.$ableWrapper.height());!r&&this.paused&&this.playMedia()}this.refreshControls("fullscreen")}},AblePlayer.prototype.handleFullscreenToggle=function(){var t=this.paused;this.setFullscreen(!this.fullscreen),t?this.pauseMedia():t||this.playMedia(),this.fullscreen?(this.hideControls=!0,this.playing&&(this.fadeControls("out"),this.controlsHidden=!0)):(this.hideControls=this.hideControlsOriginal,this.hideControls||(this.controlsHidden&&(this.fadeControls("in"),this.controlsHidden=!1),"active"===this.hideControlsTimeoutStatus&&(window.clearTimeout(this.hideControlsTimeout),this.hideControlsTimeoutStatus="clear")))},AblePlayer.prototype.handleTranscriptLockToggle=function(t){this.autoScrollTranscript=t,this.prefAutoScrollTranscript=+t,this.updateCookie("prefAutoScrollTranscript"),this.refreshControls("transcript")},AblePlayer.prototype.showTooltip=function(t){t.is(":animated")?t.stop(!0,!0).show().delay(4e3).fadeOut(1e3):t.stop().show().delay(4e3).fadeOut(1e3)},AblePlayer.prototype.showAlert=function(t,e){var i,s,a,n;"transcript"===e?(i=this.$transcriptAlert,s=this.$transcriptArea):"sign"===e?(i=this.$signAlert,s=this.$signWindow):i="screenreader"===e?this.$srAlertBox:this.$alertBox,i.text(t).show(),"transcript"==e||"sign"===e?(a=s.width()>i.width()?s.width()/2-i.width()/2:10,"sign"===e?n=s.height()/3*2:"transcript"===e&&(n=this.$transcriptToolbar.height()+30),i.css({top:n+"px",left:a+"px"})):"screenreader"!==e&&i.css({left:this.$playerDiv.width()/2-i.width()/2}),"screenreader"!==e&&setTimeout(function(){i.fadeOut(300)},3e3)},AblePlayer.prototype.showedAlert=function(t){return"transcript"===t?!!this.showedTranscriptAlert:"sign"===t&&!!this.showedSignAlert},AblePlayer.prototype.resizePlayer=function(t,e){var i,s,a;this.fullscreen?(void 0!==this.$vidcapContainer&&(this.$ableWrapper.css({width:t+"px","max-width":""}),this.$vidcapContainer.css({height:e+"px",width:t}),this.$media.css({height:e+"px",width:t})),void 0!==this.$transcriptArea&&this.retrieveOffscreenWindow("transcript",t,e),void 0!==this.$signWindow&&this.retrieveOffscreenWindow("sign",t,e)):this.restoringAfterFullScreen&&(t=this.preFullScreenWidth,e=this.preFullScreenHeight,this.restoringAfterFullScreen=!1,this.$ableWrapper.css({"max-width":t+"px",width:""}),void 0!==this.$vidcapContainer&&this.$vidcapContainer.css({height:"",width:""}),this.$media.css({width:"100%",height:"auto"})),"youtube"===this.player&&this.youTubePlayer&&this.youTubePlayer.setSize(t,e),void 0!==this.$captionsDiv&&(i=parseInt(this.prefCaptionsSize,10),a=(s=1e3t&&(t=parseInt(e))}),t},AblePlayer.prototype.updateZIndex=function(t){var e,i,s,a;if(8e3,7e3,this.getHighestZIndex(),void 0===this.$transcriptArea||void 0===this.$signWindow)return void 0!==this.$transcriptArea?7e3<(e=parseInt(this.$transcriptArea.css("z-index")))&&this.$transcriptArea.css("z-index",7e3):void 0!==this.$signWindow&&8e3<(i=parseInt(this.$signWindow.css("z-index")))&&this.$signWindow.css("z-index",8e3),!1;if((e=parseInt(this.$transcriptArea.css("z-index")))===(i=parseInt(this.$signWindow.css("z-index"))))s=8e3,a=7e3;else if(it){i=e;break}void 0!==i?this.currentCaption!==i&&(s=this.flattenCueForCaption(a[i]).replace("\n","
"),this.$captionsDiv.html(s),this.currentCaption=i,0===s.length?this.$captionsDiv.css("display","none"):this.$captionsDiv.css("display","inline-block")):(this.$captionsDiv.html(""),this.currentCaption=-1)},AblePlayer.prototype.flattenCueForCaption=function(t){var e=[],s=function(t){var e,i=[];if("string"===t.type)i.push(t.value);else if("v"===t.type)for(i.push("("+t.value+")"),e=0;e"),e=0;e")}else if("b"===t.type){for(i.push(""),e=0;e")}else for(e=0;e",{class:"able-chapters-heading",id:e}).text(this.chaptersTitle),this.$chaptersDiv.append(i)),this.$chaptersNav=p("
'),y=0)}),a}}(jQuery),function(c){AblePlayer.prototype.showSearchResults=function(){var i=this;if(this.searchDiv&&this.searchString&&c("#"+this.SearchDiv)){var t=this.searchFor(this.searchString);if(0",{class:"able-search-results-summary"}),s="Found "+t.length+" matching items. ";s+="Click the time associated with any item ",s+="to play the video from that point.",e.html(s);for(var a=c("
    "),n=0;n",{}),o=this.secondsToTime(t[n].start),l=c("",{class:"able-search-results-time","data-start":t[n].start,title:o.title,tabindex:"0"});l.text(o.value),l.click(function(t){var e=parseFloat(c(this).attr("data-start"));e+=.01,i.seeking=!0,i.seekTo(e)});var h=c("",{class:"able-search-result-text"});h.html("..."+t[n].caption+"..."),r.append(l,h),a.append(r)}c("#"+this.searchDiv).append(e,a)}else{var p=c("

    ").text("No results found.");c("#"+this.searchDiv).append(p)}}},AblePlayer.prototype.searchFor=function(t){var e,i,s,a,n,r,o;s=[];var l=t.split(" ");if(0'+a+"")+i.substring(n+r):''+a+""+i.substring(n+r));return i},AblePlayer.prototype.secondsToTime=function(t){t=Math.floor(t);var e=parseInt(t/3600,10)%24,i=parseInt(t/60,10)%60,s=t%60,a="",n="";0=window.innerHeight?window.innerHeight-this.$playerDiv.outerHeight():window.outerHeight,this.$descDiv.is(":hidden")||(e-=this.$descDiv.height()),this.positionCaptions("overlay")):this.restoringAfterFullScreen?(t=this.preFullScreenWidth,e=this.preFullScreenHeight):(t=this.$ableWrapper.width(),e=void 0!==this.aspectRatio?Math.round(t/this.aspectRatio):this.$ableWrapper.height(),this.positionCaptions());this.resizePlayer(t,e)},AblePlayer.prototype.addSeekbarListeners=function(){var i=this;this.seekBar.bodyDiv.on("startTracking",function(t){i.pausedBeforeTracking=i.paused,i.pauseMedia()}).on("tracking",function(t,e){i.highlightTranscript(e),i.updateCaption(e),i.showDescription(e),i.updateChapter(i.convertChapterTimeToVideoTime(e)),i.updateMeta(e),i.refreshControls("init")}).on("stopTracking",function(t,e){i.useChapterTimes?i.seekTo(i.convertChapterTimeToVideoTime(e)):i.seekTo(e),i.pausedBeforeTracking||setTimeout(function(){i.playMedia()},200)})},AblePlayer.prototype.onClickPlayerButton=function(t){var e,i;"play"===(e=s(t).attr("class").split(" ")[0].substr(20))?(this.clickedPlay=!0,this.handlePlay()):"restart"===e?(this.seekTrigger="restart",this.handleRestart()):"previous"===e?(this.seekTrigger="previous",this.buttonWithFocus="previous",this.handlePrevTrack()):"next"===e?(this.seekTrigger="next",this.buttonWithFocus="next",this.handleNextTrack()):"rewind"===e?(this.seekTrigger="rewind",this.handleRewind()):"forward"===e?(this.seekTrigger="forward",this.handleFastForward()):"mute"===e?this.handleMute():"volume"===e?this.handleVolume():"faster"===e?this.handleRateIncrease():"slower"===e?this.handleRateDecrease():"captions"===e?this.handleCaptionToggle():"chapters"===e?this.handleChapters():"descriptions"===e?this.handleDescriptionToggle():"sign"===e?this.handleSignToggle():"preferences"===e?"menu"===s(t).attr("data-prefs-popup")?this.handlePrefsClick():(this.closePopups(),"keyboard"===(i=s(t).attr("data-prefs-popup"))?this.keyboardPrefsDialog.show():"captions"===i?this.captionPrefsDialog.show():"descriptions"===i?this.descPrefsDialog.show():"transcript"===i&&this.transcriptPrefsDialog.show()):"help"===e?this.handleHelpClick():"transcript"===e?this.handleTranscriptToggle():"fullscreen"===e&&(this.clickedFullscreenButton=!0,this.handleFullscreenToggle())},AblePlayer.prototype.okToHandleKeyPress=function(){var t=AblePlayer.getActiveDOMElement();return"INPUT"!==s(t).prop("tagName")},AblePlayer.prototype.onPlayerKeyPress=function(t){if(!this.okToHandleKeyPress())return!1;var e=t.which;if(65<=e&&e<=90&&(e+=32),!(s(":focus").is("[contenteditable]")||s(":focus").is("input")||s(":focus").is("textarea")||s(":focus").is("select")||t.target.hasAttribute("contenteditable")||"INPUT"===t.target.tagName||"TEXTAREA"===t.target.tagName||"SELECT"===t.target.tagName))if(27===e)this.closePopups();else if(32===e)0===this.$ableWrapper.find(".able-controller button:focus").length&&(this.clickedPlay=!0,this.handlePlay());else if(112===e)this.usingModifierKeys(t)&&this.handlePlay();else if(115===e)this.usingModifierKeys(t)&&this.handleRestart();else if(109===e)this.usingModifierKeys(t)&&this.handleMute();else if(118===e)this.usingModifierKeys(t)&&this.handleVolume();else if(49<=e&&e<=57)this.usingModifierKeys(t)&&this.handleVolume(e);else if(99===e)this.usingModifierKeys(t)&&this.handleCaptionToggle();else if(100===e)this.usingModifierKeys(t)&&this.handleDescriptionToggle();else if(102===e)this.usingModifierKeys(t)&&this.handleFastForward();else if(114===e)this.usingModifierKeys(t)&&this.handleRewind();else if(98===e)this.usingModifierKeys(t)&&this.handlePrevTrack();else if(110===e)this.usingModifierKeys(t)&&this.handleNextTrack();else if(101===e)this.usingModifierKeys(t)&&this.handlePrefsClick();else if(13===e){var i=s(document.activeElement);"SPAN"===i.prop("tagName")?i.click():"LI"===i.prop("tagName")&&i.click()}},AblePlayer.prototype.addHtml5MediaListeners=function(){var e=this;this.$media.on("emptied",function(){}).on("loadedmetadata",function(){e.duration=e.media.duration,e.onMediaNewSourceLoad()}).on("canplay",function(){}).on("canplaythrough",function(){e.userClickedPlaylist&&(e.startedPlaying||e.playMedia(),e.userClickedPlaylist=!1),"restart"==e.seekTrigger||"chapter"==e.seekTrigger||"transcript"==e.seekTrigger?e.playMedia():e.startedPlaying?e.hasPlaylist?(e.playlistIndex!==e.$playlist.length||e.loop)&&e.playMedia():e.getPlayerState().then(function(t){!e.swappingSrc||"stopped"!==t&&"paused"!==t||(e.startedPlaying=!1,0",{class:"able-resizable"}),r=parseInt(s.css("z-index"))+100,n.css("z-index",r),s.append(n),t.on("mousedown mouseup touchstart touchend",function(t){return t.stopPropagation(),"mousedown"===t.type||"touchstart"===t.type?i.windowMenuClickRegistered||(i.windowMenuClickRegistered=!0,i.startMouseX=t.pageX,i.startMouseY=t.pageY,i.dragDevice="mouse",i.startDrag(e,s)):"mouseup"!==t.type&&"touchend"!==t.type||i.dragging&&"mouse"===i.dragDevice&&i.endDrag(e),!1}),n.on("mousedown mouseup touchstart touchend",function(t){return t.stopPropagation(),"mousedown"===t.type||"touchstart"===t.type?i.windowMenuClickRegistered||(i.windowMenuClickRegistered=!0,i.startMouseX=t.pageX,i.startMouseY=t.pageY,i.startResize(e,s)):"mouseup"!==t.type&&"touchend"!==t.type||i.resizing&&i.endResize(e),!1}),s.on("click",function(){i.windowMenuClickRegistered||i.finishingDrag||i.updateZIndex(e),i.finishingDrag=!1}),this.addWindowMenu(e,s,a)},AblePlayer.prototype.addWindowMenu=function(e,t,i){var r,s,o,a,n,l,h,p,c,u,d;(r=this).windowMenuClickRegistered=!1,this.finishingDrag=!1,(s=A('

    ')).addClass("able-alert"),s.hide(),s.appendTo(this.$activeWindow),s.css({top:t.offset().top}),d=this.mediaId+"-"+i+"-menu",o=A(""),P=A('"),w.on("click",function(){C=A("#"+n).val(),k=A("#"+r).val(),C===o&&k===l||(i.resizeObject(t,C,k),i.updateCookie(t)),T.hide(),s.hide(),a.focus()}),P.on("click",function(){T.hide(),s.hide(),a.focus()}),u.append(g,d),f.append(v,m),c.append(u,f),p.append(c,"
    ",w,P),A("body").append(p),T=new AccessibleDialog(p,a,"alert",this.tt.windowResizeHeading,c,this.tt.closeButtonLabel,"20em"),"transcript"===t?this.transcriptResizeDialog=T:"sign"===t&&(this.signResizeDialog=T)},AblePlayer.prototype.handleWindowButtonClick=function(t,e){var i,s,a,n;if(i=this,"transcript"===t?(s=this.$transcriptPopup,a=this.$transcriptPopupButton,this.$transcriptToolbar):"sign"===t&&(s=this.$signPopup,a=this.$signPopupButton,this.$signToolbar),"keydown"===e.type)if(32===e.which||13===e.which)this.windowMenuClickRegistered=!0;else{if(27!==e.which)return!1;s.hide("fast",function(){i.windowMenuClickRegistered=!1,s.find("li").removeClass("able-focus").attr("tabindex","-1"),a.focus()})}else this.windowMenuClickRegistered=!0;s.is(":visible")?(s.hide(200,"",function(){i.windowMenuClickRegistered=!1}),s.find("li").removeClass("able-focus"),a.attr("aria-expanded","false").focus()):(this.updateZIndex(t),n=a.position().top+a.outerHeight(),s.css("top",n),s.show(200,"",function(){a.attr("aria-expanded","true"),A(this).find("li").first().focus().addClass("able-focus"),i.windowMenuClickRegistered=!1}))},AblePlayer.prototype.handleMenuChoice=function(t,e,i){var s,a,n,r,o;if(s=this,"transcript"===t?(a=this.$transcriptArea,n=this.$transcriptPopup,r=this.$transcriptPopupButton,o=this.transcriptResizeDialog):"sign"===t&&(a=this.$signWindow,n=this.$signPopup,r=this.$signPopupButton,o=this.signResizeDialog),"keydown"===i.type)return 27===i.which?n.hide("fast",function(){s.windowMenuClickRegistered=!1,n.find("li").removeClass("able-focus").attr("tabindex","-1"),r.focus()}):"close"!==e&&(this.$activeWindow=a),!1;n.hide("fast",function(){s.windowMenuClickRegistered=!1,n.find("li").removeClass("able-focus").attr("tabindex","-1")}),"close"!==e&&r.focus(),"move"===e?(this.showedAlert(t)||(this.showAlert(this.tt.windowMoveAlert,t),"transcript"===t?this.showedTranscriptAlert=!0:"sign"===t&&(this.showedSignAlert=!0)),"keydown"===i.type?this.dragDevice="keyboard":this.dragDevice="mouse",this.startDrag(t,a),n.hide().parent().focus()):"resize"==e?o.show():"close"==e&&("transcript"===t?this.handleTranscriptToggle():"sign"===t&&this.handleSignToggle())},AblePlayer.prototype.startDrag=function(e,t){var i,s,a,n,r;return(i=this).$activeWindow||(this.$activeWindow=t),this.dragging=!0,"transcript"===e?s=this.$transcriptPopup:"sign"===e&&(s=this.$signPopup),this.showedAlert(e)||(this.showAlert(this.tt.windowMoveAlert,e),"transcript"===e?this.showedTranscriptAlert=!0:"sign"===e&&(this.showedSignAlert=!0)),s.is(":visible")&&s.hide(),this.updateZIndex(e),a=this.$activeWindow.position(),this.dragStartX=a.left,this.dragStartY=a.top,void 0===this.startMouseX?(this.dragDevice="keyboard",this.dragKeyX=this.dragStartX,this.dragKeyY=this.dragStartY,this.startingDrag=!0):(this.dragDevice="mouse",this.dragOffsetX=this.startMouseX-this.dragStartX,this.dragOffsetY=this.startMouseY-this.dragStartY),this.$activeWindow.addClass("able-drag").css({position:"absolute",top:this.dragStartY+"px",left:this.dragStartX+"px"}).focus(),"mouse"===this.dragDevice?A(document).on("mousemove touchmove",function(t){i.dragging&&(n=t.pageX-i.dragOffsetX,r=t.pageY-i.dragOffsetY,i.resetDraggedObject(n,r))}):"keyboard"===this.dragDevice&&this.$activeWindow.on("keydown",function(t){i.dragging&&i.dragKeys(e,t)}),!1},AblePlayer.prototype.dragKeys=function(t,e){if(this.startingDrag)return this.startingDrag=!1;switch(10,e.which){case 37:case 63234:this.dragKeyX-=10;break;case 38:case 63232:this.dragKeyY-=10;break;case 39:case 63235:this.dragKeyX+=10;break;case 40:case 63233:this.dragKeyY+=10;break;case 13:case 27:return this.endDrag(t),!1;default:return!1}return this.resetDraggedObject(this.dragKeyX,this.dragKeyY),e.preventDefault&&e.preventDefault(),!1},AblePlayer.prototype.resetDraggedObject=function(t,e){this.$activeWindow.css({left:t+"px",top:e+"px"})},AblePlayer.prototype.resizeObject=function(t,e,i){var s;this.$activeWindow.css({width:e+"px",height:i+"px"}),"transcript"===t&&(s=i-50,this.$transcriptDiv.css("height",s+"px"))},AblePlayer.prototype.endDrag=function(t){var e;"transcript"===t?(this.$transcriptPopup,e=this.$transcriptPopupButton):"sign"===t&&(this.$signPopup,e=this.$signPopupButton),A(document).off("mousemove mouseup touchmove touchup"),this.$activeWindow.off("keydown").removeClass("able-drag"),"keyboard"===this.dragDevice&&e.focus(),this.dragging=!1,this.updateCookie(t),this.startMouseX=void 0,this.startMouseY=void 0,this.windowMenuClickRegistered=!1,this.finishingDrag=!0,setTimeout(function(){this.finishingDrag=!1},100)},AblePlayer.prototype.isCloseToCorner=function(t,e,i){var s,a,n,r,o,l;return 10,a=(s=t.offset()).top,n=s.left,r=t.width(),o=a+t.height(),l=n+r,Math.abs(o-i)<=10&&Math.abs(l-e)<=10},AblePlayer.prototype.startResize=function(e,t){var i,s,a,n;return(i=this).$activeWindow=t,this.resizing=!0,"transcript"===e?s=this.$transcriptPopup:"sign"===e&&(s=this.$signPopup),s.is(":visible")&&s.hide().parent().focus(),this.$activeWindow.position(),this.dragKeyX=this.dragStartX,this.dragKeyY=this.dragStartY,this.dragStartWidth=this.$activeWindow.width(),this.dragStartHeight=this.$activeWindow.height(),A(document).on("mousemove touchmove",function(t){i.resizing&&(a=i.dragStartWidth+(t.pageX-i.startMouseX),n=i.dragStartHeight+(t.pageY-i.startMouseY),i.resizeObject(e,a,n))}),!1},AblePlayer.prototype.endResize=function(t){var e;"transcript"===t?(this.$transcriptPopup,e=this.$transcriptPopupButton):"sign"===t&&(this.$signPopup,e=this.$signPopupButton),A(document).off("mousemove mouseup touchmove touchup"),this.$activeWindow.off("keydown"),e.show().focus(),this.resizing=!1,this.$activeWindow.removeClass("able-resize"),this.updateCookie(t),this.windowMenuClickRegistered=!1,this.finishingDrag=!0,setTimeout(function(){this.finishingDrag=!1},100)}}(jQuery),function(n){AblePlayer.prototype.initSignLanguage=function(){"html5"===this.player?(this.signFile=this.$sources.first().attr("data-sign-src"),this.signFile?this.isIOS()?(this.hasSignLanguage=!1,this.debug):(this.debug,this.hasSignLanguage=!0,this.injectSignPlayerCode()):this.hasSignLanguage=!1):this.hasSignLanguage=!1},AblePlayer.prototype.injectSignPlayerCode=function(){var t,e,i,s,a;for(this.getDefaultWidth("sign"),t=this.mediaId+"-sign",this.$signVideo=n("