Changeset 920


Ignore:
Timestamp:
04/07/10 16:14:03 (3 years ago)
Author:
zach
Message:
  • Adding Build + YUI Compression
  • Adding DOM parser
Location:
trunk/html5
Files:
44 added
1 edited
5 moved

Legend:

Unmodified
Added
Removed
  • trunk/html5/index.html

    r918 r920  
    1212</style> 
    1313 
    14 <script type="text/javascript" src="libs/jquery.js"></script> 
    15 <script type="text/javascript" src="src/jquery.jwplayer.core.js"></script> 
    16 <script type="text/javascript" src="src/jquery.jwplayer.utils.js"></script> 
     14<script type="text/javascript" src="lib/jquery.js"></script> 
     15<script type="text/javascript" src="build/jquery.jwplayer-0.1alpha.js"></script> 
    1716 
    1817</head> 
  • trunk/html5/src/jquery.jwplayerCore.js

    r918 r920  
    1313$.fn.jwplayer = function(options) { 
    1414        return this.each(function() { 
    15                 var config = $.extend({},$.fn.jwplayer.defaults,options); 
    16                 if ($.fn.jwplayer.utils.supportsFlash){ 
    17                         $.fn.jwplayer.utils.embedFlash(this, config); 
     15                var domConfig = $.fn.jwplayerUtilsParsersDOMElementParser.parse(this); 
     16                var model = $.extend(true, {}, $.fn.jwplayer.defaults, options, domConfig); 
     17                if ($.fn.jwplayerUtils.supportsFlash){ 
     18                        $.fn.jwplayerView.embedFlash(this, model); 
    1819                } 
    1920                // loadSkin(options); 
    2021        }); 
    21 }; 
    22  
     22} 
    2323 
    2424/** Map with all players on the page. **/ 
  • trunk/html5/src/jquery.jwplayerUtils.js

    r918 r920  
    99(function($){ 
    1010 
    11 $.fn.jwplayer.utils = function(ops) { 
     11$.fn.jwplayerUtils = function(){ 
    1212        return this.each(function() { 
    1313        }); 
    14 }; 
     14} 
    1515 
    1616/** Check if this client supports Flash player 9.0.115+ (FLV/H264). **/ 
    17 $.fn.jwplayer.utils.supportsFlash = function() { 
     17$.fn.jwplayerUtils.supportsFlash = function() { 
    1818        var version = '0,0,0,0'; 
    1919        try { 
     
    4242 
    4343/** check if this client supports HTML5 H.264 playback. **/ 
    44 $.fn.jwplayer.utils.supportsH264 = function() { 
     44$.fn.jwplayerUtils.supportsH264 = function() { 
    4545        try {  
    4646                return !!document.createElement('video').canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'); 
     
    5252 
    5353/** check if this client supports HTML5 OGG playback. **/ 
    54 $.fn.jwplayer.utils.supportsOgg = function() { 
     54$.fn.jwplayerUtils.supportsOgg = function() { 
    5555        try { 
    5656                return !!document.createElement('video').canPlayType('video/ogg; codecs="theora, vorbis"'); 
     
    6262 
    6363/** Embeds a Flash Player at the specified location in the DOM. **/ 
    64 $.fn.jwplayer.utils.embedFlash = function(object, options) { 
     64$.fn.jwplayerUtils.embedFlash = function(object, options) { 
    6565        object = $(object); 
    6666        var flashvars = ""; 
     
    9595}; 
    9696 
     97$.fn.jwplayerUtils.dump = function(object, depth) { 
     98                if (object == null) { 
     99                        return 'null'; 
     100                } else if ($.fn.jwplayerUtils.typeOf(object) != 'object') { 
     101                        if ($.fn.jwplayerUtils.typeOf(object) == 'string'){ 
     102                                return"\""+object+"\""; 
     103                        } 
     104                        return object; 
     105                } 
     106                 
     107                var type = $.fn.jwplayerUtils.typeOf(object); 
     108                 
     109                (depth == undefined) ? depth = 1 : depth++; 
     110                var indent = ""; 
     111                for (var i = 0; i < depth; i++) { indent += "\t"; } 
     112 
     113                var result = (type == "array") ? "[" : "{"; 
     114                result += "\n"+indent; 
     115         
     116                for (var i in object) { 
     117                        if (type == "object") { result += "\""+i+"\": "}; 
     118                        result += $.fn.jwplayerUtils.dump(object[i], depth)+",\n"+indent; 
     119                } 
     120                 
     121                result = result.substring(0, result.length-2-depth)+"\n"; 
     122 
     123                result  += indent.substring(0, indent.length-1); 
     124                result  += (type == "array") ? "]" : "}"; 
     125         
     126                return result; 
     127        } 
     128         
     129$.fn.jwplayerUtils.typeOf = function(value) { 
     130                var s = typeof value; 
     131                if (s === 'object') { 
     132                        if (value) { 
     133                                if (value instanceof Array) { 
     134                                        s = 'array'; 
     135                                } 
     136                        } else { 
     137                                s = 'null'; 
     138                        } 
     139                } 
     140                return s; 
     141        } 
     142 
    97143 
    98144})(jQuery); 
Note: See TracChangeset for help on using the changeset viewer.