src/js/init.js
branchnew-model
changeset 910 b9f1bd52df9a
parent 909 aa0e42229784
child 917 eb8677d3a663
equal deleted inserted replaced
909:aa0e42229784 910:b9f1bd52df9a
     5     IriSP = {};
     5     IriSP = {};
     6 }
     6 }
     7 
     7 
     8 /* The Metadataplayer Object, single point of entry, replaces IriSP.init_player */
     8 /* The Metadataplayer Object, single point of entry, replaces IriSP.init_player */
     9 
     9 
    10 IriSP.Metadataplayer = function(config, video_metadata) {
    10 IriSP.Metadataplayer = function(config) {
    11     IriSP.log("IriSP.Metadataplayer constructor");
    11     IriSP.log("IriSP.Metadataplayer constructor");
    12     for (var key in IriSP.guiDefaults) {
    12     for (var key in IriSP.guiDefaults) {
    13         if (IriSP.guiDefaults.hasOwnProperty(key) && !config.gui.hasOwnProperty(key)) {
    13         if (IriSP.guiDefaults.hasOwnProperty(key) && !config.gui.hasOwnProperty(key)) {
    14             config.gui[key] = IriSP.guiDefaults[key]
    14             config.gui[key] = IriSP.guiDefaults[key]
    15         }
    15         }
    16     }
    16     }
    17     var _container = document.getElementById(config.gui.container);
    17     var _container = document.getElementById(config.gui.container);
    18     _container.innerHTML = '<h3 class="Ldt-Loader">Loading... Chargement...</h3>';
    18     _container.innerHTML = '<h3 class="Ldt-Loader">Loading... Chargement...</h3>';
    19     this.video_metadata = video_metadata;
       
    20     this.sourceManager = new IriSP.Model.Directory();
    19     this.sourceManager = new IriSP.Model.Directory();
    21     this.config = config;
    20     this.config = config;
    22     this.callbackQueue = [];
    21     this.callbackQueue = [];
    23     this.isLoaded = false;
    22     this.isLoaded = false;
    24     this.loadLibs();
    23     this.loadLibs();
    92         IriSP._ = window._.noConflict();
    91         IriSP._ = window._.noConflict();
    93     }
    92     }
    94     IriSP.loadCss(IriSP.getLib("cssjQueryUI"));
    93     IriSP.loadCss(IriSP.getLib("cssjQueryUI"));
    95     IriSP.loadCss(this.config.gui.css);
    94     IriSP.loadCss(this.config.gui.css);
    96     
    95     
    97     this.videoData = this.loadMetadata(this.video_metadata);
    96     this.videoData = this.loadMetadata(this.config.player.metadata);
    98     this.$ = IriSP.jQuery('#' + this.config.gui.container);
    97     this.$ = IriSP.jQuery('#' + this.config.gui.container);
    99     this.$.css({
    98     this.$.css({
   100         "width": this.config.gui.width,
    99         "width": this.config.gui.width,
   101         "clear": "both"
   100         "clear": "both"
   102     });
   101     });
   244             delete opts.type;
   243             delete opts.type;
   245             opts.file = opts.video;
   244             opts.file = opts.video;
   246             delete opts.video;
   245             delete opts.video;
   247 
   246 
   248             if(!opts.hasOwnProperty("flashplayer")) {
   247             if(!opts.hasOwnProperty("flashplayer")) {
   249                 opts.flashplayer = IriSP.jwplayer_swf_path;
   248                 opts.flashplayer = IriSP.getLib("jwPlayerSWF");
   250             }
   249             }
   251 
   250 
   252             if(!opts.hasOwnProperty("controlbar.position")) {
   251             if(!opts.hasOwnProperty("controlbar.position")) {
   253                 opts["controlbar.position"] = "none";
   252                 opts["controlbar.position"] = "none";
   254             }
   253             }