From fd70f8429fce6f1955889ed2d8a820990a219ce1 Mon Sep 17 00:00:00 2001 From: "Luis Brandao @ alpha1" Date: Tue, 1 May 2012 18:48:09 +0000 Subject: [PATCH] Player and video changes --- web/.htaccess | 10 ++++++++++ web/js/plugins/layers/video/video.js | 2 +- web/js/plugins/players/plyr.js | 6 +++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/web/.htaccess b/web/.htaccess index 27db7adc8..451a55c3b 100644 --- a/web/.htaccess +++ b/web/.htaccess @@ -4,3 +4,13 @@ RewriteRule ^(.*)$ app_dev.php [QSA,L] +# Maintenance redirect - needs to be adjusted with the correct root folder and ip +#Options +FollowSymlinks +# RewriteEngine on + # redirect all requests except these +# RewriteCond %{REQUEST_URI} !/maintenance.html$ +# RewriteCond %{REQUEST_URI} !/images/zeegaAlpha.png$ + # don't redirect requests from this IP address +# RewriteCond %{REMOTE_HOST} !^67.186.132.2 + +# RewriteRule $ /maintenance.html [R=302,L] diff --git a/web/js/plugins/layers/video/video.js b/web/js/plugins/layers/video/video.js index d74baebda..2a6687cdc 100644 --- a/web/js/plugins/layers/video/video.js +++ b/web/js/plugins/layers/video/video.js @@ -26,9 +26,9 @@ { console.log(this.get('attr')); console.log(this); - //if( _.isUndefined(this.get('attr').attribution_uri)) this.set({attribution_uri:this.get('attribution_url')}); this.video = new Plyr2({ url : this.get('attr').attribution_uri, + url_dep : this.get('attr').attribution_url, uri : this.get('attr').uri, id : this.id, cue_in : this.get('attr').cue_in, diff --git a/web/js/plugins/players/plyr.js b/web/js/plugins/players/plyr.js index 96d8494e1..9dbbf1e03 100644 --- a/web/js/plugins/players/plyr.js +++ b/web/js/plugins/players/plyr.js @@ -97,13 +97,17 @@ var Plyr2 = Backbone.Model.extend({ //set video format type this.set(options); console.log(this); - this.set( 'format', this.getFormat(this.get('url')) ); + var url =this.get('url'); + if(!_.isUndefined(url))this.set( 'format', this.getFormat(this.get('url')) ); + else this.set( 'format', this.getFormat(this.get('url_dep')) ); }, getFormat : function(url) { //separated to make it easier to isolate and update this list var format = ''; + + if( url.match(/^http:\/\/(?:www\.)?youtube.com\/watch\?(?=.*v=\w+)(?:\S+)?$/) ) format = 'youtube' else if ( url.match(/^http:\/\/(?:www\.)?vimeo.com\/(.*)/) ) format = 'vimeo' else format = 'html5';