Changeset 976


Ignore:
Timestamp:
04/30/10 07:32:41 (3 years ago)
Author:
jeroen
Message:

fixed html5 testing tool with IE6 (I hope)

Location:
trunk/html5/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/html5/test/files/style.css

    r966 r976  
    99        color: #58C; 
    1010} 
    11 object, video { 
     11object { 
    1212        display: block; 
    1313        margin: 0 auto; 
  • trunk/html5/test/index.html

    r966 r976  
    6666 
    6767        /** The complete list with all current flashvars. **/ 
    68         var variables = {width:500,height:260}; 
     68        var variables = {width:500,height:260,skin:'five'}; 
    6969        /** When jQuery is loaded, we initialize everything. **/ 
    70         $().ready(function() {  
    71                 loadSettings();  
    72                 setAPI(); 
    73         }); 
     70        $().ready(function() { loadSettings(); }); 
    7471        /** Load the settings and querystring. **/ 
    7572        function loadSettings() { 
     
    8986                        variables[decodeURIComponent(arguments[1])] = decodeURIComponent(arguments[2]); 
    9087                }); 
     88                // Set the handlers on the API calls 
     89                $("#variablesform").submit(function(evt) { getVariable(evt); }); 
     90                $("#sendeventform").submit(function(evt) { sendEvent(evt); }); 
     91                $("#listenersform").submit(function(evt) { setListener(evt); }); 
    9192                // set the value and handler on player, skin and plugins. 
    9293                if(variables['player']) { $('#players').val(variables['player']); } 
    9394                $("#players").change(function(evt) { reloadFieldsets(evt); }); 
    9495                if(variables['skin']) { $('#skins').val(variables['skin']); } 
    95                 $("#skins").change(function(evt) { insertPlayer(evt); }); 
     96                $("#skins").change(function(evt) { reloadPage(evt); }); 
    9697                //if(variables['plugins']) { $('#plugins').val(variables['plugins'].split(',')); } 
    9798                $("#plugins").change(function(evt) { reloadFieldsets(evt); }); 
    9899                // set the handler on the flashvars and load the whole bunch. 
    99                 $("#flashvarsform").submit(function(evt) { insertPlayer(evt); }); 
     100                $("#flashvarsform").submit(function(evt) { reloadPage(evt); }); 
    100101                reloadFieldsets(); 
    101102        }; 
     
    214215 
    215216        /** Print the player on the page. **/ 
    216         function insertPlayer(evt) { 
     217        function insertPlayer() { 
     218                variables['skin'] = settings.skins[variables['skin']]; 
     219                var lnk = 'http://developer.longtailvideo.com/player/trunk/html5/test/'; 
     220                $("#permalink").val(lnk+'?'+$.param(variables)); 
     221                $('#container').attr('src',variables['file']); 
     222                $('#container').jwplayer(variables); 
     223        }; 
     224        /** Change the page URL. **/ 
     225        function reloadPage(evt) { 
    217226                if(evt) { evt.preventDefault(); } 
    218                 var vrs = {}; 
    219227                variables = {} 
    220228                if($("#skins").val() != 'none') { 
    221                         vrs['skin'] = settings.skins[$("#skins").val()]; 
    222229                        variables['skin'] = $("#skins").val(); 
    223                 } 
    224                 if($("#plugins").val() != null) { 
    225                         var plg = []; 
    226                         var arr = $("#plugins").val(); 
    227                         for(var i=0; i<arr.length; i++) { 
    228                                 plg.push(settings[settings.plugin_api+'_plugins'][arr[i]]); 
    229                         } 
    230                         vrs['plugins'] = plg.join(','); 
    231                         variables['plugins'] = arr.join(','); 
    232230                } 
    233231                var arr = $("#flashvarsform").find('input'); 
    234232                for(var i=0; i<arr.length; i++) { 
    235233                        if($(arr[i]).val()) { 
    236                                 vrs[$(arr[i]).attr('name')] = $(arr[i]).val(); 
    237234                                variables[$(arr[i]).attr('name')] = $(arr[i]).val(); 
    238235                        } 
    239236                } 
    240                 var ply = settings.players[$('#players').val()]; 
    241                 $('#preview').html('<video id="container" src="'+vrs['file']+'" width="'+vrs['width']+'" height="'+vrs['height']+'">Your browser supports neither HTML5 nor Flash</video>'); 
    242                 $('#container').jwplayer(vrs); 
    243                 var lnk = 'http://developer.longtailvideo.com/player/trunk/html5/test/'; 
    244                 $("#permalink").val(lnk+'?'+$.param(variables)); 
     237                window.top.location.href = window.top.location.pathname+'?'+$.param(variables); 
    245238        }; 
    246239 
     
    252245        **/ 
    253246 
    254         /** When the player is ready and the API forms can be shown, display them. **/ 
    255         function setAPI(obj) { 
    256                 $("#variablesform").submit(function(evt) { getVariable(evt); }); 
    257                 $("#sendeventform").submit(function(evt) { sendEvent(evt); }); 
    258                 $("#listenersform").submit(function(evt) { setListener(evt); }); 
    259         }; 
    260247        /** Get a variable from the player. **/ 
    261248        function getVariable(evt) { 
     
    263250                var typ = $('#vartype').val().toString(); 
    264251                var prp = $.jwplayer()[typ](); 
     252                alert(prp); 
    265253        }; 
    266254        /** Send an event to the player. **/ 
     
    269257                var typ = $('#sendevent').val(); 
    270258                var pr1 = $('#sendeventdata1').val(); 
     259                if(pr1 == 'true') { pr1 = true } else if (pr1 == 'false') { pr1 = false; } 
    271260                var pr2 = $('#sendeventdata2').val(); 
    272261                if(pr2) { 
     
    329318                                <option>height</option> 
    330319                                <option>mute</option> 
     320                                <option>position</option> 
    331321                                <option>state</option> 
    332                                 <option>time</option> 
    333322                                <option>volume</option> 
    334323                                <option>width</option> 
     
    382371 
    383372<div id="preview"> 
    384 <p>Testing is simple: choose an example, change the flashvars and see if it works.</p> 
     373        <video id="container" width="400" height="200"> 
     374                Your browser supports neither video nor flash. 
     375        </video> 
    385376</div> 
    386377 
Note: See TracChangeset for help on using the changeset viewer.