# HG changeset patch # User veltr # Date 1340816617 -7200 # Node ID 096c06aea8b52356920e7539900cdd1475702960 # Parent d4dc652bf05023b12e2e6b736854cc0d69ab774b Minor changes diff -r d4dc652bf050 -r 096c06aea8b5 src/js/init.js --- a/src/js/init.js Wed Jun 27 19:03:18 2012 +0200 +++ b/src/js/init.js Wed Jun 27 19:03:37 2012 +0200 @@ -129,6 +129,9 @@ } IriSP.Metadataplayer.prototype.onVideoDataLoaded = function() { + + /* Getting video URL from metadata if it's not in the player config options */ + if (typeof this.videoData !== "undefined" && typeof this.config.player.video === "undefined") { var _media; @@ -164,7 +167,129 @@ } } - this.configurePopcorn(); + + if (typeof this.config.player.video === "string" && this.config.player.url_transform === "function") { + this.config.player.video = this.config.player.url_transform(this.config.player.video); + } + + var _pop, + _divs = this.layoutDivs("video",this.config.player.height || undefined), + containerDiv = _divs[0], + spacerDiv = _divs[1], + _this = this, + _types = { + "html5" : /\.(ogg|ogv|webm)$/, + "youtube" : /^(https?:\/\/)?(www\.)?youtube\.com/, + "dailymotion" : /^(https?:\/\/)?(www\.)?dailymotion\.com/ + }; + + if (this.config.player.type === "auto") { + this.config.player.type = "jwplayer"; + IriSP._(_types).each(function(_v, _k) { + if (_v.test(_this.config.player.video)) { + _this.config.player.type = _k + } + }); + } + + switch(this.config.player.type) { + case "html5": + var _tmpId = Popcorn.guid("video"), + _videoEl = IriSP.jQuery('