Skip to content

Commit

Permalink
Fix issues with translationPath
Browse files Browse the repository at this point in the history
  • Loading branch information
terrill committed Mar 11, 2015
1 parent a74f952 commit 7a5d276
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.DS_Store
test.html
thirdparty/jwplayer.*
thirdparty/jquery-*.js
node_modules/
translations/???.js
17 changes: 15 additions & 2 deletions build/ableplayer.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@

// Debug - set to true to write messages to console; otherwise false
this.debug = false;

// Path to root directory of referring website
this.rootPath = this.getRootWebSitePath();

// Volume range is 0 to 1. Don't crank it to avoid overpowering screen readers
this.defaultVolume = 0.5;
Expand Down Expand Up @@ -304,15 +307,15 @@
this.fallback = 'jw';

// fallback path - specify path to fallback player files
this.fallbackPath = '../thirdparty/';
this.fallbackPath = this.rootPath + '/thirdparty/';

// testFallback - set to true to force browser to use the fallback player (for testing)
// Note: JW Player does not support offline playback (a Flash restriction)
// Therefore testing must be performed on a web server
this.testFallback = false;

// translationPath - specify path to translation files
this.translationPath = '../translations/';
this.translationPath = this.rootPath + '/translations/';

// lang - default language of the player
this.lang = 'en';
Expand Down Expand Up @@ -344,6 +347,16 @@
this.setButtonImages();
};

AblePlayer.prototype.getRootWebSitePath = function() {

var _location = document.location.toString();
var domainNameIndex = _location.indexOf('/', _location.indexOf('://') + 3);
var domainName = _location.substring(0, domainNameIndex) + '/';
var webFolderIndex = _location.indexOf('/', _location.indexOf(domainName) + domainName.length);
var webFolderFullPath = _location.substring(0, webFolderIndex);
return webFolderFullPath;
};

AblePlayer.prototype.setButtonImages = function() {

var imgPath = '../images/' + this.iconColor + '/';
Expand Down
17 changes: 15 additions & 2 deletions build/ableplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@

// Debug - set to true to write messages to console; otherwise false
this.debug = false;

// Path to root directory of referring website
this.rootPath = this.getRootWebSitePath();

// Volume range is 0 to 1. Don't crank it to avoid overpowering screen readers
this.defaultVolume = 0.5;
Expand Down Expand Up @@ -304,15 +307,15 @@
this.fallback = 'jw';

// fallback path - specify path to fallback player files
this.fallbackPath = '../thirdparty/';
this.fallbackPath = this.rootPath + '/thirdparty/';

// testFallback - set to true to force browser to use the fallback player (for testing)
// Note: JW Player does not support offline playback (a Flash restriction)
// Therefore testing must be performed on a web server
this.testFallback = false;

// translationPath - specify path to translation files
this.translationPath = '../translations/';
this.translationPath = this.rootPath + '/translations/';

// lang - default language of the player
this.lang = 'en';
Expand Down Expand Up @@ -344,6 +347,16 @@
this.setButtonImages();
};

AblePlayer.prototype.getRootWebSitePath = function() {

var _location = document.location.toString();
var domainNameIndex = _location.indexOf('/', _location.indexOf('://') + 3);
var domainName = _location.substring(0, domainNameIndex) + '/';
var webFolderIndex = _location.indexOf('/', _location.indexOf(domainName) + domainName.length);
var webFolderFullPath = _location.substring(0, webFolderIndex);
return webFolderFullPath;
};

AblePlayer.prototype.setButtonImages = function() {

var imgPath = '../images/' + this.iconColor + '/';
Expand Down
4 changes: 2 additions & 2 deletions build/ableplayer.min.js

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions scripts/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

// Debug - set to true to write messages to console; otherwise false
this.debug = false;

// Path to root directory of referring website
this.rootPath = this.getRootWebSitePath();

// Volume range is 0 to 1. Don't crank it to avoid overpowering screen readers
this.defaultVolume = 0.5;
Expand Down Expand Up @@ -57,15 +60,15 @@
this.fallback = 'jw';

// fallback path - specify path to fallback player files
this.fallbackPath = '../thirdparty/';
this.fallbackPath = this.rootPath + '/thirdparty/';

// testFallback - set to true to force browser to use the fallback player (for testing)
// Note: JW Player does not support offline playback (a Flash restriction)
// Therefore testing must be performed on a web server
this.testFallback = false;

// translationPath - specify path to translation files
this.translationPath = '../translations/';
this.translationPath = this.rootPath + '/translations/';

// lang - default language of the player
this.lang = 'en';
Expand Down Expand Up @@ -97,6 +100,16 @@
this.setButtonImages();
};

AblePlayer.prototype.getRootWebSitePath = function() {

var _location = document.location.toString();
var domainNameIndex = _location.indexOf('/', _location.indexOf('://') + 3);
var domainName = _location.substring(0, domainNameIndex) + '/';
var webFolderIndex = _location.indexOf('/', _location.indexOf(domainName) + domainName.length);
var webFolderFullPath = _location.substring(0, webFolderIndex);
return webFolderFullPath;
};

AblePlayer.prototype.setButtonImages = function() {

var imgPath = '../images/' + this.iconColor + '/';
Expand Down

0 comments on commit 7a5d276

Please sign in to comment.