|
443 | 443 | AblePlayer.nextIndex = 0; |
444 | 444 |
|
445 | 445 | AblePlayer.prototype.setup = function() { |
446 | | - |
447 | 446 | var thisObj = this; |
448 | 447 | this.reinitialize().then(function () { |
449 | 448 | if (!thisObj.player) { |
|
1009 | 1008 |
|
1010 | 1009 | // Creates the appropriate player for the current source. |
1011 | 1010 | AblePlayer.prototype.recreatePlayer = function () { |
1012 | | - |
1013 | 1011 | var thisObj, prefsGroups, i; |
1014 | 1012 | thisObj = this; |
1015 | 1013 |
|
|
1028 | 1026 | this.injectPlayerCode(); |
1029 | 1027 | this.initSignLanguage(); |
1030 | 1028 | this.setupTracks().then(function() { |
1031 | | - |
1032 | 1029 | // moved this here; in its original location was not working in Safari 10 |
1033 | 1030 | thisObj.setMediaAttributes(); |
1034 | 1031 |
|
|
1047 | 1044 |
|
1048 | 1045 | thisObj.initPlayer().then(function() { // initPlayer success |
1049 | 1046 | thisObj.initializing = false; |
1050 | | - |
1051 | 1047 | // inject each of the hidden forms that will be accessed from the Preferences popup menu |
1052 | 1048 | prefsGroups = thisObj.getPreferencesGroups(); |
1053 | 1049 | for (i = 0; i < prefsGroups.length; i++) { |
|
1103 | 1099 | thisObj.setVolume(thisObj.defaultVolume); |
1104 | 1100 | thisObj.refreshControls(); |
1105 | 1101 |
|
1106 | | - // After done messing with the player, this is necessary to fix playback on iOS |
1107 | | - if (thisObj.player === 'html5' && thisObj.isIOS()) { |
| 1102 | + // Go ahead and load media, without user requesting it |
| 1103 | + // Normally, we wait until user clicks play, rather than unnecessarily consume their bandwidth |
| 1104 | + // Exceptions are if the video is intended to autostart or if running on iOS (a workaround for iOS issues) |
| 1105 | + // TODO: Confirm that this is still necessary with iOS (this would added early, & I don't remember what the issues were) |
| 1106 | + if (thisObj.player === 'html5' && (thisObj.isIOS() || thisObj.startTime > 0 || thisObj.autoplay)) { |
1108 | 1107 | thisObj.$media[0].load(); |
1109 | 1108 | } |
1110 | 1109 | deferred.resolve(); |
|
0 commit comments