Changeset 1218
- Timestamp:
- 08/18/10 11:29:45 (3 years ago)
- Location:
- trunk/js
- Files:
-
- 1 added
- 2 deleted
- 8 edited
- 2 copied
-
bin-debug/embed.html (modified) (4 diffs)
-
bin-debug/jquery.jwplayerParse.js (deleted)
-
bin-debug/jwplayer.html5.js (modified) (3 diffs)
-
bin-debug/jwplayer.js (modified) (14 diffs)
-
src/api/jwplayer.api.js (modified) (9 diffs)
-
src/embed/jwplayer.embed.js (modified) (4 diffs)
-
src/utils/jwplayer.utils.js (modified) (1 diff)
-
test/index.php (modified) (3 diffs)
-
test/jwplayer.html5.xml (added)
-
test/player-5.3.swf (copied) (copied from trunk/js/test/players/player-5.3.swf)
-
test/player-5.3.xml (copied) (copied from trunk/js/test/players/player-5.3.xml)
-
test/players (deleted)
-
test/settings.js (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/js/bin-debug/embed.html
r1200 r1218 2 2 <head> 3 3 <script type="text/javascript" src="jquery.js"></script> 4 <script type="text/javascript" src="jquery.jwplayerParse.js"></script>5 4 <script type="text/javascript" src="jwplayer.js"></script> 6 5 <script type="text/javascript" src="jwplayer.html5.js"></script> … … 8 7 var options = { 9 8 image: '../../../testing/files/bunny.jpg', 10 plugins: {11 'sharing-1': {},12 'viral-2d': {13 link: 'http://www.longtailvideo.com',14 'allowmenu': 'true'15 },16 'fbit-1': {}17 },18 9 players: [ 19 10 {type:'html5'}, 20 11 {type:'flash', src: '../../../trunk/fl5/player.swf'}, 12 ], 13 skin: '', 14 levels: [ 15 {file: '../../../testing/files/bunny.mp4'} 21 16 ] 22 17 }; 23 18 function embedPlayer(id) { 24 return $jw(id).setup(options); 19 $jw(id).setup(options); 20 $jw(id).onPlay(function() { 21 alert("Playing!"); 22 }); 25 23 } 26 24 </script> … … 30 28 <h1>JWPlayer JS Embedder Testing Page</h1> 31 29 <div id="something"> 32 <video id="div1" width=500 height=300> 33 <source src="../../../testing/files/bunny.mp4" /> 34 This is <div> 1. 35 </video> 30 <div id="div1"></div> 36 31 </div> 37 32 <div id="something_else"> … … 40 35 </div> 41 36 </div> 42 <script type="text/javascript">43 embedPlayer('div1');44 </script>45 37 <h3>Embed a player</h3> 46 <a href="#" onclick="embedPlayer('div 2'); return false;">Click here to embed player</a><br />38 <a href="#" onclick="embedPlayer('div1'); return false;">Click here to embed player</a><br /> 47 39 48 40 </body> -
trunk/js/bin-debug/jwplayer.html5.js
r1208 r1218 1178 1178 return function(evt) { 1179 1179 if (player._media === undefined) { 1180 document.location.href = jwplayer.html5.utils.getAbsolutePath(player.getPlaylist()[player.getConfig().item]. sources[0]);1180 document.location.href = jwplayer.html5.utils.getAbsolutePath(player.getPlaylist()[player.getConfig().item].levels[0]); 1181 1181 return; 1182 1182 } … … 1655 1655 vid.autoplay = player._model.config.autoplay; 1656 1656 } 1657 for (var sourceIndex in playlistItem. sources){1658 var sourceModel = playlistItem. sources[sourceIndex];1657 for (var sourceIndex in playlistItem.levels){ 1658 var sourceModel = playlistItem.levels[sourceIndex]; 1659 1659 var source = div1.ownerDocument.createElement("source"); 1660 1660 source.src = jwplayer.html5.utils.getAbsolutePath(sourceModel.file); … … 1706 1706 if (this.config.playlist && this.config.playlist.length > 0){ 1707 1707 this.playlist = this.config.playlist; 1708 delete this.config.playlist;1709 } else if (this.config.sources && this.config.sources.length > 0) {1710 this.playlist = [{"sources": this.config.sources}];1711 delete this.config.sources;1708 } else if (this.config.levels && this.config.levels.length > 0) { 1709 this.playlist = [{"levels": this.config.levels}]; 1710 } else if (this.config.file){ 1711 this.playlist = [{"levels": [{"file":this.config.file}]}]; 1712 1712 } 1713 1713 for (var index in _configurableStateVariables) { 1714 1714 var configurableStateVariable = _configurableStateVariables[index]; 1715 1715 this[configurableStateVariable] = this.config[configurableStateVariable]; 1716 } 1717 if (this.config.skin.length === 0){ 1718 this.config.skin = "1.xml"; 1716 1719 } 1717 1720 return this; -
trunk/js/bin-debug/jwplayer.js
r1217 r1218 121 121 */ 122 122 jwplayer.utils.hasFlash = function() { 123 var nav = navigator; 124 return (typeof nav.plugins != "undefined" && typeof nav.plugins['Shockwave Flash'] != "undefined"); 123 return (typeof navigator.plugins != "undefined" && typeof navigator.plugins['Shockwave Flash'] != "undefined") || (typeof window.ActiveXObject != "undefined"); 125 124 };/** 126 125 * Parser for the JW Player. … … 335 334 var _stateListeners = {}; 336 335 var _player = undefined; 336 var _playerReady = false; 337 337 338 338 var _itemMeta = {}; … … 344 344 } 345 345 _player = player; 346 for (var eventType in _listeners) {347 this.addInternalListener(_player, eventType);348 }349 346 }; 350 347 … … 359 356 360 357 function stateCallback(state) { 361 return function(newstate, oldstate) { 358 return function(args) { 359 var newstate = args['newstate'], 360 oldstate = args['oldstate']; 362 361 if (newstate == state) { 363 362 var callbacks = _stateListeners[newstate]; … … 374 373 375 374 this.addInternalListener = function(player, type) { 376 player. addEventListener(type, 'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+type+'", dat); }');375 player.jwAddEventListener(type, 'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+type+'", dat); }'); 377 376 }; 378 377 … … 380 379 if (!_listeners[type]) { 381 380 _listeners[type] = []; 382 if (_player ) {381 if (_player && _playerReady) { 383 382 this.addInternalListener(_player, type); 384 383 } … … 399 398 400 399 this.playerReady = function(obj) { 400 _playerReady = true; 401 if (!_player) { 402 this.setPlayer(document.getElementById(obj['id'])); 403 } 404 405 for (var eventType in _listeners) { 406 this.addInternalListener(_player, eventType); 407 } 408 401 409 this.eventListener('jwplayerMediaMeta', function(data) { 402 410 jwplayer.utils.extend(_itemMeta, data.metadata); … … 446 454 447 455 // Player Getters 448 getBuffer: function() { return this.callInternal(' getBuffer'); },449 getDuration: function() { return this.callInternal(' getDuration'); },450 getFullscreen: function() { return this.callInternal(' getFullscreen'); },456 getBuffer: function() { return this.callInternal('jwGetBuffer'); }, 457 getDuration: function() { return this.callInternal('jwGetDuration'); }, 458 getFullscreen: function() { return this.callInternal('jwGetFullscreen'); }, 451 459 getHeight: function() { return this.container.height; }, 452 getLockState: function() { return this.callInternal(' getLockState'); },460 getLockState: function() { return this.callInternal('jwGetLockState'); }, 453 461 getMeta: function() { return this.getItemMeta(); }, 454 getMute: function() { return this.callInternal(' getMute'); },455 getPlaylist: function() { return this.callInternal(' getPlaylist'); },462 getMute: function() { return this.callInternal('jwGetMute'); }, 463 getPlaylist: function() { return this.callInternal('jwGetPlaylist'); }, 456 464 getPlaylistItem: function(item) { 457 465 if (item == undefined) item = 0; 458 466 return this.getPlaylist()[item]; 459 467 }, 460 getPosition: function() { return this.callInternal(' getPosition'); },461 getState: function() { return this.callInternal(' getState'); },462 getVolume: function() { return this.callInternal(' getVolume'); },468 getPosition: function() { return this.callInternal('jwGetPosition'); }, 469 getState: function() { return this.callInternal('jwGetState'); }, 470 getVolume: function() { return this.callInternal('jwGetVolume'); }, 463 471 getWidth: function() { return this.container.width; }, 464 472 465 473 // Player Public Methods 466 setFullscreen: function(fullscreen) { this.callInternal(" setFullscreen", fullscreen); return this;},467 setMute: function(mute) { this.callInternal(" mute", mute); return this; },474 setFullscreen: function(fullscreen) { this.callInternal("jwSetFullscreen", fullscreen); return this;}, 475 setMute: function(mute) { this.callInternal("jwMute", mute); return this; }, 468 476 lock: function() { return this; }, 469 477 unlock: function() { return this; }, 470 load: function(toLoad) { this.callInternal(" load", toLoad); return this; },471 playlistItem: function(item) { this.callInternal(" playlistItem", item); return this; },472 playlistPrev: function() { this.callInternal(" playlistPrev"); return this; },473 playlistNext: function() { this.callInternal(" playlistNext"); return this; },478 load: function(toLoad) { this.callInternal("jwLoad", toLoad); return this; }, 479 playlistItem: function(item) { this.callInternal("jwPlaylistItem", item); return this; }, 480 playlistPrev: function() { this.callInternal("jwPlaylistPrev"); return this; }, 481 playlistNext: function() { this.callInternal("jwPlaylistNext"); return this; }, 474 482 resize: function(width, height) { 475 483 this.container.width = width; … … 495 503 case jwplayer.api.events.state.PLAYING: 496 504 case jwplayer.api.events.state.BUFFERING: 497 this.callInternal(" pause");505 this.callInternal("jwPause"); 498 506 break; 499 507 case jwplayer.api.events.state.PAUSED: 500 this.callInternal(" play");508 this.callInternal("jwPlay"); 501 509 break; 502 510 } 503 511 return this; 504 512 }, 505 stop: function() { this.callInternal(" stop"); return this; },506 seek: function(position) { this.callInternal(" seek", position); return this; },507 setVolume: function(volume) { this.callInternal(" volume", volume); return this; },513 stop: function() { this.callInternal("jwStop"); return this; }, 514 seek: function(position) { this.callInternal("jwSeek", position); return this; }, 515 setVolume: function(volume) { this.callInternal("jwVolume", volume); return this; }, 508 516 509 517 // Player Events … … 580 588 }; 581 589 590 jwplayer.api.destroyPlayer = function(playerId) { 591 var index = -1; 592 for(var p in _players) { 593 if (_players[p].container.id == playerId) { 594 index = p; 595 continue; 596 } 597 } 598 if (index >= 0) { 599 var toDestroy = _players[index]; 600 var replacement = document.createElement('div'); 601 replacement.setAttribute('id', toDestroy.id); 602 toDestroy.container.parentNode.replaceChild(replacement, toDestroy.container); 603 _players.splice(index, 1); 604 } 605 606 return null; 607 }; 608 582 609 // Can't make this a read-only getter, thanks to IE incompatibility. 583 610 jwplayer.getPlayers = function() { … … 626 653 } 627 654 var flashPlayer = jwplayer.embed.embedFlash(this.api.container, player, this.config); 655 this.api.container = flashPlayer; 628 656 this.api.setPlayer(flashPlayer); 629 657 } else { 630 658 this.players.splice(0, 1); 631 embedPlayer();659 this.embedPlayer(); 632 660 } 633 661 break; 634 662 case 'html5': 635 var html5player = jwplayer.embed.embedHTML5(this.api.container, player, this.config); 636 this.api.setPlayer(html5player); 637 //TODO: Remove this once HTML5 player calls playerReady() 638 this.api.playerReady({id:this.api.container.id}); 663 if (!jwplayer.utils.isIE()) { 664 var html5player = jwplayer.embed.embedHTML5(this.api.container, player, this.config); 665 this.api.setPlayer(html5player); 666 //TODO: Remove this once HTML5 player calls playerReady() 667 this.api.playerReady({id:this.api.container.id}); 668 } else { 669 this.players.splice(0, 1); 670 this.embedPlayer(); 671 } 639 672 break; 640 673 } 674 } else { 675 this.api.container.innerHTML = "<p>No suitable players found</p>"; 641 676 } 642 677 return this.api; … … 680 715 }; 681 716 682 jwplayer.embed.embedFlash = function( container, player,options) {683 var params = jwplayer.utils.extend({}, jwplayer.embed.defaults, options);717 jwplayer.embed.embedFlash = function(_container, _player, _options) { 718 var params = jwplayer.utils.extend({}, jwplayer.embed.defaults, _options); 684 719 685 720 var width = params.width; … … 700 735 var html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + 701 736 'width="' + width + '" height="' + height + '" ' + 702 'id="' + container.id + '" name="' +container.id +737 'id="' + _container.id + '" name="' + _container.id + 703 738 '">'; 704 html += '<param name="movie" value="' + player.src + '">';739 html += '<param name="movie" value="' + _player.src + '">'; 705 740 html += '<param name="allowfullscreen" value="true">'; 706 741 html += '<param name="allowscriptaccess" value="always">'; 707 742 html += '<param name="flashvars" value="' + jwplayer.embed.jsonToFlashvars(params) +'">'; 708 743 html += '</object>'; 709 container.outerHTML = html;710 return container;744 _container.outerHTML = html; 745 return document.getElementById(_container.id); 711 746 } else { 712 747 var obj = document.createElement('object'); 713 748 obj.setAttribute('type', 'application/x-shockwave-flash'); 714 obj.setAttribute('data', player.src);749 obj.setAttribute('data', _player.src); 715 750 obj.setAttribute('width', width); 716 751 obj.setAttribute('height', height); 717 obj.setAttribute('id', container.id);718 obj.setAttribute('name', container.id);752 obj.setAttribute('id', _container.id); 753 obj.setAttribute('name', _container.id); 719 754 jwplayer.embed.appendAttribute(obj, 'allowfullscreen', 'true'); 720 755 jwplayer.embed.appendAttribute(obj, 'allowscriptaccess', 'always'); 721 756 jwplayer.embed.appendAttribute(obj, 'flashvars', jwplayer.embed.jsonToFlashvars(params)); 722 container.parentNode.replaceChild(obj,container);757 _container.parentNode.replaceChild(obj, _container); 723 758 return obj; 724 759 } … … 771 806 }; 772 807 773 jwplayer.api.PlayerAPI.prototype.setup = function(options , player) {808 jwplayer.api.PlayerAPI.prototype.setup = function(options) { 774 809 this.config = options; 775 810 return (new jwplayer.embed.Embedder(this)).embedPlayer(); -
trunk/js/src/api/jwplayer.api.js
r1206 r1218 41 41 var _stateListeners = {}; 42 42 var _player = undefined; 43 var _playerReady = false; 43 44 44 45 var _itemMeta = {}; … … 50 51 } 51 52 _player = player; 52 for (var eventType in _listeners) {53 this.addInternalListener(_player, eventType);54 }55 53 }; 56 54 … … 65 63 66 64 function stateCallback(state) { 67 return function(newstate, oldstate) { 65 return function(args) { 66 var newstate = args['newstate'], 67 oldstate = args['oldstate']; 68 68 if (newstate == state) { 69 69 var callbacks = _stateListeners[newstate]; … … 80 80 81 81 this.addInternalListener = function(player, type) { 82 player. addEventListener(type, 'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+type+'", dat); }');82 player.jwAddEventListener(type, 'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+type+'", dat); }'); 83 83 }; 84 84 … … 86 86 if (!_listeners[type]) { 87 87 _listeners[type] = []; 88 if (_player ) {88 if (_player && _playerReady) { 89 89 this.addInternalListener(_player, type); 90 90 } … … 105 105 106 106 this.playerReady = function(obj) { 107 _playerReady = true; 108 if (!_player) { 109 this.setPlayer(document.getElementById(obj['id'])); 110 } 111 112 for (var eventType in _listeners) { 113 this.addInternalListener(_player, eventType); 114 } 115 107 116 this.eventListener('jwplayerMediaMeta', function(data) { 108 117 jwplayer.utils.extend(_itemMeta, data.metadata); … … 152 161 153 162 // Player Getters 154 getBuffer: function() { return this.callInternal(' getBuffer'); },155 getDuration: function() { return this.callInternal(' getDuration'); },156 getFullscreen: function() { return this.callInternal(' getFullscreen'); },163 getBuffer: function() { return this.callInternal('jwGetBuffer'); }, 164 getDuration: function() { return this.callInternal('jwGetDuration'); }, 165 getFullscreen: function() { return this.callInternal('jwGetFullscreen'); }, 157 166 getHeight: function() { return this.container.height; }, 158 getLockState: function() { return this.callInternal(' getLockState'); },167 getLockState: function() { return this.callInternal('jwGetLockState'); }, 159 168 getMeta: function() { return this.getItemMeta(); }, 160 getMute: function() { return this.callInternal(' getMute'); },161 getPlaylist: function() { return this.callInternal(' getPlaylist'); },169 getMute: function() { return this.callInternal('jwGetMute'); }, 170 getPlaylist: function() { return this.callInternal('jwGetPlaylist'); }, 162 171 getPlaylistItem: function(item) { 163 172 if (item == undefined) item = 0; 164 173 return this.getPlaylist()[item]; 165 174 }, 166 getPosition: function() { return this.callInternal(' getPosition'); },167 getState: function() { return this.callInternal(' getState'); },168 getVolume: function() { return this.callInternal(' getVolume'); },175 getPosition: function() { return this.callInternal('jwGetPosition'); }, 176 getState: function() { return this.callInternal('jwGetState'); }, 177 getVolume: function() { return this.callInternal('jwGetVolume'); }, 169 178 getWidth: function() { return this.container.width; }, 170 179 171 180 // Player Public Methods 172 setFullscreen: function(fullscreen) { this.callInternal(" setFullscreen", fullscreen); return this;},173 setMute: function(mute) { this.callInternal(" mute", mute); return this; },181 setFullscreen: function(fullscreen) { this.callInternal("jwSetFullscreen", fullscreen); return this;}, 182 setMute: function(mute) { this.callInternal("jwMute", mute); return this; }, 174 183 lock: function() { return this; }, 175 184 unlock: function() { return this; }, 176 load: function(toLoad) { this.callInternal(" load", toLoad); return this; },177 playlistItem: function(item) { this.callInternal(" playlistItem", item); return this; },178 playlistPrev: function() { this.callInternal(" playlistPrev"); return this; },179 playlistNext: function() { this.callInternal(" playlistNext"); return this; },185 load: function(toLoad) { this.callInternal("jwLoad", toLoad); return this; }, 186 playlistItem: function(item) { this.callInternal("jwPlaylistItem", item); return this; }, 187 playlistPrev: function() { this.callInternal("jwPlaylistPrev"); return this; }, 188 playlistNext: function() { this.callInternal("jwPlaylistNext"); return this; }, 180 189 resize: function(width, height) { 181 190 this.container.width = width; … … 201 210 case jwplayer.api.events.state.PLAYING: 202 211 case jwplayer.api.events.state.BUFFERING: 203 this.callInternal(" pause");212 this.callInternal("jwPause"); 204 213 break; 205 214 case jwplayer.api.events.state.PAUSED: 206 this.callInternal(" play");215 this.callInternal("jwPlay"); 207 216 break; 208 217 } 209 218 return this; 210 219 }, 211 stop: function() { this.callInternal(" stop"); return this; },212 seek: function(position) { this.callInternal(" seek", position); return this; },213 setVolume: function(volume) { this.callInternal(" volume", volume); return this; },220 stop: function() { this.callInternal("jwStop"); return this; }, 221 seek: function(position) { this.callInternal("jwSeek", position); return this; }, 222 setVolume: function(volume) { this.callInternal("jwVolume", volume); return this; }, 214 223 215 224 // Player Events … … 286 295 }; 287 296 297 jwplayer.api.destroyPlayer = function(playerId) { 298 var index = -1; 299 for(var p in _players) { 300 if (_players[p].container.id == playerId) { 301 index = p; 302 continue; 303 } 304 } 305 if (index >= 0) { 306 var toDestroy = _players[index]; 307 var replacement = document.createElement('div'); 308 replacement.setAttribute('id', toDestroy.id); 309 toDestroy.container.parentNode.replaceChild(replacement, toDestroy.container); 310 _players.splice(index, 1); 311 } 312 313 return null; 314 }; 315 288 316 // Can't make this a read-only getter, thanks to IE incompatibility. 289 317 jwplayer.getPlayers = function() { -
trunk/js/src/embed/jwplayer.embed.js
r1206 r1218 28 28 } 29 29 var flashPlayer = jwplayer.embed.embedFlash(this.api.container, player, this.config); 30 this.api.container = flashPlayer; 30 31 this.api.setPlayer(flashPlayer); 31 32 } else { 32 33 this.players.splice(0, 1); 33 embedPlayer();34 this.embedPlayer(); 34 35 } 35 36 break; 36 37 case 'html5': 37 var html5player = jwplayer.embed.embedHTML5(this.api.container, player, this.config); 38 this.api.setPlayer(html5player); 39 //TODO: Remove this once HTML5 player calls playerReady() 40 this.api.playerReady({id:this.api.container.id}); 38 if (!jwplayer.utils.isIE()) { 39 var html5player = jwplayer.embed.embedHTML5(this.api.container, player, this.config); 40 this.api.setPlayer(html5player); 41 //TODO: Remove this once HTML5 player calls playerReady() 42 this.api.playerReady({id:this.api.container.id}); 43 } else { 44 this.players.splice(0, 1); 45 this.embedPlayer(); 46 } 41 47 break; 42 48 } 49 } else { 50 this.api.container.innerHTML = "<p>No suitable players found</p>"; 43 51 } 44 52 return this.api; … … 82 90 }; 83 91 84 jwplayer.embed.embedFlash = function( container, player,options) {85 var params = jwplayer.utils.extend({}, jwplayer.embed.defaults, options);92 jwplayer.embed.embedFlash = function(_container, _player, _options) { 93 var params = jwplayer.utils.extend({}, jwplayer.embed.defaults, _options); 86 94 87 95 var width = params.width; … … 102 110 var html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + 103 111 'width="' + width + '" height="' + height + '" ' + 104 'id="' + container.id + '" name="' +container.id +112 'id="' + _container.id + '" name="' + _container.id + 105 113 '">'; 106 html += '<param name="movie" value="' + player.src + '">';114 html += '<param name="movie" value="' + _player.src + '">'; 107 115 html += '<param name="allowfullscreen" value="true">'; 108 116 html += '<param name="allowscriptaccess" value="always">'; 109 117 html += '<param name="flashvars" value="' + jwplayer.embed.jsonToFlashvars(params) +'">'; 110 118 html += '</object>'; 111 container.outerHTML = html;112 return container;119 _container.outerHTML = html; 120 return document.getElementById(_container.id); 113 121 } else { 114 122 var obj = document.createElement('object'); 115 123 obj.setAttribute('type', 'application/x-shockwave-flash'); 116 obj.setAttribute('data', player.src);124 obj.setAttribute('data', _player.src); 117 125 obj.setAttribute('width', width); 118 126 obj.setAttribute('height', height); 119 obj.setAttribute('id', container.id);120 obj.setAttribute('name', container.id);127 obj.setAttribute('id', _container.id); 128 obj.setAttribute('name', _container.id); 121 129 jwplayer.embed.appendAttribute(obj, 'allowfullscreen', 'true'); 122 130 jwplayer.embed.appendAttribute(obj, 'allowscriptaccess', 'always'); 123 131 jwplayer.embed.appendAttribute(obj, 'flashvars', jwplayer.embed.jsonToFlashvars(params)); 124 container.parentNode.replaceChild(obj,container);132 _container.parentNode.replaceChild(obj, _container); 125 133 return obj; 126 134 } … … 173 181 }; 174 182 175 jwplayer.api.PlayerAPI.prototype.setup = function(options , player) {183 jwplayer.api.PlayerAPI.prototype.setup = function(options) { 176 184 this.config = options; 177 185 return (new jwplayer.embed.Embedder(this)).embedPlayer(); -
trunk/js/src/utils/jwplayer.utils.js
r1217 r1218 117 117 */ 118 118 jwplayer.utils.hasFlash = function() { 119 var nav = navigator; 120 return (typeof nav.plugins != "undefined" && typeof nav.plugins['Shockwave Flash'] != "undefined"); 119 return (typeof navigator.plugins != "undefined" && typeof navigator.plugins['Shockwave Flash'] != "undefined") || (typeof window.ActiveXObject != "undefined"); 121 120 }; -
trunk/js/test/index.php
r1208 r1218 101 101 prefilled = {plugins:'',player:'',skin:''}; 102 102 var swf = settings.players[$("#players").val()][0]['src']; 103 var xml = swf.substr(0,swf.length-4) + '.xml'; 104 parsePlayerXML(xml); 103 if (swf) { 104 var xml = swf.substr(0,swf.length-4) + '.xml'; 105 parsePlayerXML(xml); 106 } else { 107 parsePlayerXML("jwplayer.html5.xml"); 108 } 105 109 var str = $("#plugins").val(); 106 110 if(str != null) { … … 280 284 281 285 $('#preview').css('height',vrs['height']); 282 $('#preview').html('<div id="container"></div>'); 286 if ($('#container').length) { 287 // This is necessary for IE when calling setup on top of an existing flash player 288 // jwplayer.api.destroyPlayer('container'); 289 } else { 290 $('#preview').html('<div id="container"></div>'); 291 } 283 292 284 293 for (var v in vrs){ … … 443 452 444 453 <?php 445 $selectedScript = ' swfobject';454 $selectedScript = 'jwembed'; 446 455 if (isset($_GET['scripts'])){ 447 456 $selectedScript = $_GET['scripts']; -
trunk/js/test/settings.js
r1206 r1218 15 15 /** Player versions to test. **/ 16 16 "players": { 17 "flash-5.3":[{"type":"flash","src":"players/player-5.3.swf"}], 18 "flash-5.2":[{"type":"flash","src":"players/player-5.2.swf"}], 19 "flash-5.1":[{"type":"flash","src":"players/player-5.1.swf"}], 20 "flash-5.0":[{"type":"flash","src":"players/player-5.0.swf"}], 21 "flash-4.7":[{"type":"flash","src":"players/player-4.7.swf"}], 22 "flash-4.6":[{"type":"flash","src":"players/player-4.6.swf"}], 23 "flash-4.5":[{"type":"flash","src":"players/player-4.5.swf"}], 24 "flash-4.4":[{"type":"flash","src":"players/player-4.4.swf"}], 25 "flash-4.3":[{"type":"flash","src":"players/player-4.3.swf"}], 26 "flash-4.2":[{"type":"flash","src":"players/player-4.2.swf"}], 27 "flash-4.1":[{"type":"flash","src":"players/player-4.1.swf"}] 17 "flash-html5-fallback":[{"type":"flash","src":"player-5.3.swf"},{"type":"html5"}], 18 "html5-flash-fallback":[{"type":"html5"},{"type":"flash","src":"player-5.3.swf"}], 19 "flash-only":[{"type":"flash","src":"player-5.3.swf"}], 20 "html5-only":[{"type":"html5"}] 28 21 }, 29 22 /** Available plugins to test. **/ … … 60 53 " ": {}, 61 54 "FLV video": { 62 "file":" ../files/bunny.flv",55 "file":"files/bunny.flv", 63 56 "image":"files/bunny.jpg", 64 57 "height":240, … … 67 60 }, 68 61 "MP4 video": { 69 "file":" ../files/bunny.mp4",62 "file":"files/bunny.mp4", 70 63 "image":"files/bunny.jpg", 71 64 "height":240, … … 78 71 }, 79 72 "AAC audio":{ 80 "file":" ../files/bunny.m4a",73 "file":"files/bunny.m4a", 81 74 "image":"files/bunny.jpg", 82 75 "height":240, … … 199 192 " ": {}, 200 193 "Agegate plugin": { 201 "file":" ../files/corrie.flv",194 "file":"files/corrie.flv", 202 195 "height":240, 203 196 "width":500, … … 206 199 }, 207 200 "Audiodescription and captions plugins": { 208 "file":" ../files/corrie.flv",201 "file":"files/corrie.flv", 209 202 "height":240, 210 203 "width":500, … … 228 221 }, 229 222 "HD plugin": { 230 "file":" ../files/bunny.flv",223 "file":"files/bunny.flv", 231 224 "height":240, 232 225 "width":500, 233 226 "plugins":"hd", 234 227 "dock":"true", 235 "hd.file":" ../files/bunny.mp4"228 "hd.file":"files/bunny.mp4" 236 229 }, 237 230 "Searchbar plugin": { … … 245 238 "Sharing plugin": { 246 239 "dock":true, 247 "file":" ../files/bunny.flv",240 "file":"files/bunny.flv", 248 241 "height":260, 249 242 "width":460,
Note: See TracChangeset
for help on using the changeset viewer.
