assets/ableplayer/scripts/sign.js in wai-website-theme-1.3.1 vs assets/ableplayer/scripts/sign.js in wai-website-theme-1.4
- old
+ new
@@ -1,92 +1,96 @@
(function ($) {
- AblePlayer.prototype.initSignLanguage = function() {
- // Sign language is only currently supported in HTML5 player, not fallback or YouTube
- if (this.player === 'html5') {
- // check to see if there's a sign language video accompanying this video
- // check only the first source
- // If sign language is provided, it must be provided for all sources
- this.signFile = this.$sources.first().attr('data-sign-src');
- if (this.signFile) {
- if (this.debug) {
- console.log('This video has an accompanying sign language video: ' + this.signFile);
- }
- this.hasSignLanguage = true;
- this.injectSignPlayerCode();
- }
- else {
- this.hasSignLanguage = false;
- }
- }
- };
+ AblePlayer.prototype.initSignLanguage = function() {
- AblePlayer.prototype.injectSignPlayerCode = function() {
+ // Sign language is only currently supported in HTML5 player, not YouTube or Vimeo
+ if (this.player === 'html5') {
+ // check to see if there's a sign language video accompanying this video
+ // check only the first source
+ // If sign language is provided, it must be provided for all sources
+ this.signFile = this.$sources.first().attr('data-sign-src');
+ if (this.signFile) {
+ if (this.debug) {
+ console.log('This video has an accompanying sign language video: ' + this.signFile);
+ }
+ this.hasSignLanguage = true;
+ this.injectSignPlayerCode();
+ }
+ else {
+ this.hasSignLanguage = false;
+ }
+ }
+ else {
+ this.hasSignLanguage = false;
+ }
+ };
- // create and inject surrounding HTML structure
- // If IOS:
- // If video:
- // IOS does not support any of the player's functionality
- // - everything plays in its own player
- // Therefore, AblePlayer is not loaded & all functionality is disabled
- // (this all determined. If this is IOS && video, this function is never called)
- // If audio:
- // HTML cannot be injected as a *parent* of the <audio> element
- // It is therefore injected *after* the <audio> element
- // This is only a problem in IOS 6 and earlier,
- // & is a known bug, fixed in IOS 7
+ AblePlayer.prototype.injectSignPlayerCode = function() {
- var thisObj, signVideoId, signVideoWidth, i, signSrc, srcType, $signSource;
+ // create and inject surrounding HTML structure
+ // If IOS:
+ // If video:
+ // IOS does not support any of the player's functionality
+ // - everything plays in its own player
+ // Therefore, AblePlayer is not loaded & all functionality is disabled
+ // (this all determined. If this is IOS && video, this function is never called)
+ // If audio:
+ // HTML cannot be injected as a *parent* of the <audio> element
+ // It is therefore injected *after* the <audio> element
+ // This is only a problem in IOS 6 and earlier,
+ // & is a known bug, fixed in IOS 7
- thisObj = this;
+ var thisObj, signVideoId, signVideoWidth, i, signSrc, srcType, $signSource;
- signVideoWidth = this.getDefaultWidth('sign');
+ thisObj = this;
- signVideoId = this.mediaId + '-sign';
- this.$signVideo = $('<video>',{
- 'id' : signVideoId,
- 'tabindex' : '-1'
- });
- this.signVideo = this.$signVideo[0];
- // for each original <source>, add a <source> to the sign <video>
- for (i=0; i < this.$sources.length; i++) {
- signSrc = this.$sources[i].getAttribute('data-sign-src');
- srcType = this.$sources[i].getAttribute('type');
- if (signSrc) {
- $signSource = $('<source>',{
- 'src' : signSrc,
- 'type' : srcType
- });
- this.$signVideo.append($signSource);
- }
- else {
- // source is missing a sign language version
- // can't include sign language
- this.hasSignLanguage = false;
- break;
- }
- }
+ signVideoWidth = this.getDefaultWidth('sign');
- this.$signWindow = $('<div>',{
- 'class' : 'able-sign-window',
- 'tabindex': '-1'
- });
- this.$signToolbar = $('<div>',{
- 'class': 'able-window-toolbar able-' + this.toolbarIconColor + '-controls'
- });
+ signVideoId = this.mediaId + '-sign';
+ this.$signVideo = $('<video>',{
+ 'id' : signVideoId,
+ 'tabindex' : '-1'
+ });
+ this.signVideo = this.$signVideo[0];
+ // for each original <source>, add a <source> to the sign <video>
+ for (i=0; i < this.$sources.length; i++) {
+ signSrc = this.$sources[i].getAttribute('data-sign-src');
+ srcType = this.$sources[i].getAttribute('type');
+ if (signSrc) {
+ $signSource = $('<source>',{
+ 'src' : signSrc,
+ 'type' : srcType
+ });
+ this.$signVideo.append($signSource);
+ }
+ else {
+ // source is missing a sign language version
+ // can't include sign language
+ this.hasSignLanguage = false;
+ break;
+ }
+ }
- this.$signWindow.append(this.$signToolbar, this.$signVideo);
+ this.$signWindow = $('<div>',{
+ 'class' : 'able-sign-window',
+ 'tabindex': '-1'
+ });
+ this.$signToolbar = $('<div>',{
+ 'class': 'able-window-toolbar able-' + this.toolbarIconColor + '-controls'
+ });
- this.$ableWrapper.append(this.$signWindow);
+ this.$signWindow.append(this.$signToolbar, this.$signVideo);
- // make it draggable
- this.initDragDrop('sign');
+ this.$ableWrapper.append(this.$signWindow);
- if (this.prefSign === 1) {
- // sign window is on. Go ahead and position it and show it
- this.positionDraggableWindow('sign',this.getDefaultWidth('sign'));
- }
- else {
- this.$signWindow.hide();
- }
- };
+ // make it draggable
+ this.initDragDrop('sign');
+
+ if (this.prefSign === 1) {
+ // sign window is on. Go ahead and position it and show it
+ this.positionDraggableWindow('sign',this.getDefaultWidth('sign'));
+ }
+ else {
+ this.$signWindow.hide();
+ }
+ };
})(jQuery);