Changeset 37137fd
- Timestamp:
- 06/25/11 17:40:10 (2 years ago)
- Branches:
- master, crem, crem2, dev, diadems, forma, generic, instru_search, lam, nlivemulti, production, release/1.4.4, security, social, storage, test, video
- Children:
- fe97d80
- Parents:
- 75617ad
- git-author:
- riccardo <riccardo@…> (06/25/11 17:40:10)
- git-committer:
- riccardo <riccardo@…> (06/25/11 17:40:10)
- Location:
- telemeta/htdocs/timeside/js
- Files:
-
- 2 edited
-
player.js (modified) (5 diffs)
-
timeside.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
telemeta/htdocs/timeside/js/player.js
r2c46652 r37137fd 84 84 var sound = configObject.sound; 85 85 var createSound = false; 86 if(this.$TU.fla hsFailed){87 this.soundErrorMsg = ' SoundManager error. If your browser does not support HTML5, Flash player (version '+soundManager.flashVersion+'+) must be installed.\nIf flash is installed, try to:\n - Reload the page\n - Empty the cache (see browser preferences/options/tools) and reload the page\n - Restart the browser';86 if(this.$TU.flashFailed){ 87 this.soundErrorMsg = 'soundManager error. If your browser does not support HTML5, Flash player (version '+sMan.flashVersion+'+) must be installed.\nIf flash is installed, try to:\n - Reload the page\n - Empty the cache (see browser preferences/options/tools) and reload the page\n - Restart the browser'; 88 88 }else{ 89 89 if(typeof sound !== 'string' && typeof sound !== 'object'){ 90 this.soundErrorMsg ='bad sound parameter (specify a a valid soundManager sound-object, an object with at least two properties, url and id, or URL as string)';90 this.soundErrorMsg ='bad sound parameter: specify a a valid soundManager sound-object, an object with at least two properties, url and id, or URL as string'; 91 91 }else if(typeof sound === 'string'){ 92 92 createSound = true; … … 109 109 var soundOptions = sound; 110 110 if(sMan.canPlayURL(soundOptions.url)){ //this actually checks only if the url is well formed, not if the file is there 111 //check if we specified a valid sound duration, otherwise the sound must be loaded 112 111 113 sound = sMan.createSound(soundOptions); 112 114 }else{ … … 125 127 } 126 128 var soundDurationInMsec = configObject.soundDuration; 127 if( isNaN(soundDurationInMsec)|| soundDurationInMsec<=0){129 if(typeof soundDurationInMsec !== 'number' || soundDurationInMsec<=0){ 128 130 onError('invalid soundDurationInMsec: NaN or not positive'); 129 131 return; … … 376 378 //ie, top: auto. This is however useful even if somebody specified a top property on the divs 377 379 ruler_.add(wave).add(control).css('top','auto'); 378 379 380 380 onReady(this); 381 381 }, … … 441 441 442 442 }, 443 444 soundErrorMsg: "", 443 showSoundErroMessage: function(){ 444 alert(this.soundErrorMsg); 445 }, 445 446 //given a marker at index I, specifies that a marker corss event is fired whenever the sound position (pointer) 446 447 //is in the interval ]markerCrossedOffsetMargin-I,I+markerCrossedOffsetMargin[ -
telemeta/htdocs/timeside/js/timeside.js
r85c7d5c r37137fd 666 666 667 667 }; 668 669 } 668 } 669 670 ts.player = undefined; 671 if(config.onReady && typeof config.onReady === 'function'){ 672 var oR = config.onReady; 673 config.onReady = function(player){ 674 ts.player = player; 675 oR(player); 676 }; 677 }else{ 678 config.onReady = function(player){ 679 ts.player = player; 680 }; 681 } 682 670 683 //finally,define the error function 671 684 ts.utils.loadScripts(thisScriptPath,ts_scripts, function() { 672 var p = new ts.classes.Player(config); 673 ts.player = p; 674 return false; 685 new ts.classes.Player(config); //do not assign it to any variable, we do it only onready 675 686 },config.onError); 676 687 }; … … 680 691 681 692 $J(win).ready(function(){ 682 693 var s = soundManager; 683 694 //grab the case of soundManager init errors: 684 s oundManager.onerror = function() {695 s.onerror = function() { 685 696 Timeside.utils.flashFailed = true; 686 697 //end('SoundManager error. If your browser does not support HTML5, Flash player (version '+soundManager.flashVersion+'+) must be installed.\nIf flash is installed, try to:\n - Reload the page\n - Empty the cache (see browser preferences/options/tools) and reload the page\n - Restart the browser'); 687 698 688 699 //and load all anyway: 689 700 loadAll(); … … 693 704 //onready is executed BEFORE onload, it basically queues several onload events. 694 705 //It it is executed immetiately if soundmanager has already been loaded 695 s oundManager.onready(loadAll);706 s.onready(function(){loadAll();}); 696 707 }); 697 708 };
Note: See TracChangeset
for help on using the changeset viewer.
