Changeset 923


Ignore:
Timestamp:
04/07/10 18:01:00 (3 years ago)
Author:
zach
Message:
  • Logger handles instances with no console
  • Parser ignores null / empty string elements
  • Multiple source files now use first file for failover
Location:
trunk/html5
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/html5/index.html

    r920 r923  
    4949 
    5050 
     51<h4>Test 3: Using multiple sources</h4> 
     52<video 
     53        id="player1" 
     54        class="jwplayer" 
     55        width="480" 
     56        height="270" 
     57        poster="http://developer.longtailvideo.com/player/testing/files/bunny.jpg" 
     58> 
     59<source src='http://developer.longtailvideo.com/player/testing/files/bunny.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> 
     60<source src='http://developer.longtailvideo.com/player/testing/files/bunny.ogv' type='video/ogg; codecs="theora, vorbis"'> 
     61</video> 
     62 
    5163 
    5264</body> 
  • trunk/html5/src/jquery.jwplayerUtils.js

    r921 r923  
    107107 
    108108 
    109 $.fn.log = function (msg) { 
    110         console.log("%s: %o", msg, this); 
     109$.fn.log = function (msg, obj) { 
     110        try { 
     111                console.log("%s: %o", msg, obj); 
     112        } catch (err) { 
     113        } 
    111114        return this; 
    112115}; 
  • trunk/html5/src/jquery.jwplayerUtilsParsersDOMElementParser.js

    r921 r923  
    3232                for (var attribute in attributes) { 
    3333                        if (attribute != "length") { 
    34                                 configuration[attributes[attribute]] = $(domElement).attr(attribute); 
     34                                var value = $(domElement).attr(attribute); 
     35                                if (!(value == "" || value == undefined)) { 
     36                                        configuration[attributes[attribute]] = $(domElement).attr(attribute); 
     37                                } 
    3538                        } 
    3639                } 
  • trunk/html5/src/jquery.jwplayerUtilsParsersDOMMediaElementParser.js

    r921 r923  
    2626        var sources = []; 
    2727        $("source",domElement).each(function() { 
    28                 sources[sources.length] = $.fn.jwplayerUtilsParsersDOMSourceElementParser.parse(domElement); 
     28                sources[sources.length] = $.fn.jwplayerUtilsParsersDOMSourceElementParser.parse(this); 
    2929        }); 
    3030        var configuration = $.fn.jwplayerUtilsParsersDOMElementParser.parse(domElement, attributes); 
     31        if (configuration['file'] != undefined) { 
     32                sources[0] = {'file':configuration['file']}; 
     33        } 
    3134        configuration['sources'] = sources; 
    3235        return configuration; 
  • trunk/html5/src/jquery.jwplayerView.js

    r921 r923  
    1313/** Embeds a Flash Player at the specified location in the DOM. **/ 
    1414$.fn.jwplayerView.embedFlash = function(domElement, model) { 
    15         $.fn.log($.fn.jwplayerUtils.dump(model)); 
    1615        if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { 
    1716                $(domElement).replaceWith("<embed " +  
     
    2423                        "allowfullscreen='true' " +  
    2524                        "allowscriptaccess='always' " +  
    26                         "flashvars='file=" + model.file + "&image=" + model.image + "' " +  
     25                        "flashvars='file=" + model.sources[0].file + "&image=" + model.image + "' " +  
    2726                        "/>" 
    2827                ); 
     
    3332                        "<param name='allowscriptaccess' value='always'>" +  
    3433                        "<param name='wmode' value='transparent'>" +  
    35                         "<param name='flashvars' value='file=" + model.file + "&image=" + model.image + "'>" +  
     34                        "<param name='flashvars' value='file=" + model.sources[0].file + "&image=" + model.image + "'>" +  
    3635                        "</object>" 
    3736                ); 
Note: See TracChangeset for help on using the changeset viewer.