Skip to content

Commit

Permalink
Player and video changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lfbrandao committed May 1, 2012
1 parent 2f05dac commit fd70f84
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
10 changes: 10 additions & 0 deletions web/.htaccess
Expand Up @@ -4,3 +4,13 @@
RewriteRule ^(.*)$ app_dev.php [QSA,L]
</IfModule>

# 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]
2 changes: 1 addition & 1 deletion web/js/plugins/layers/video/video.js
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion web/js/plugins/players/plyr.js
Expand Up @@ -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';
Expand Down

0 comments on commit fd70f84

Please sign in to comment.