Skip to content

Commit

Permalink
Release v0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vodkabears committed Mar 30, 2015
1 parent 8e70257 commit daaea1e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 28 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "vide",
"version": "0.3.1",
"version": "0.3.2",
"homepage": "http://vodkabears.github.io/vide/",
"authors": [
"Ilya Makarov <dfrost.00@gmail.com>"
Expand Down
42 changes: 18 additions & 24 deletions dist/jquery.vide.js
@@ -1,5 +1,5 @@
/*
* Vide - v0.3.1
* Vide - v0.3.2
* Easy as hell jQuery plugin for video backgrounds.
* http://vodkabears.github.io/vide/
*
Expand Down Expand Up @@ -66,9 +66,10 @@
option = arr[i];

// Ignore urls and a string without colon delimiters
if (option.search(/^(http|https|ftp):\/\//) !== -1 ||
option.search(':') === -1)
{
if (
option.search(/^(http|https|ftp):\/\//) !== -1 ||
option.search(':') === -1
) {
break;
}

Expand Down Expand Up @@ -166,21 +167,6 @@
$('<img src="' + path + '.png">').load(onLoad);
}

/**
* Refresh current settings
* @private
* @param {Vide} vide
*/
function refreshSettings(vide) {
vide.$video.prop({
autoplay: vide.settings.autoplay,
loop: vide.settings.loop,
volume: vide.settings.volume,
muted: vide.settings.muted,
playbackRate: vide.settings.playbackRate
});
}

/**
* Vide constructor
* @param {HTMLElement} element
Expand Down Expand Up @@ -287,9 +273,11 @@
if (vide.path.mp4) {
sources += '<source src="' + vide.path.mp4 + '.mp4" type="video/mp4">';
}

if (vide.path.webm) {
sources += '<source src="' + vide.path.webm + '.webm" type="video/webm">';
}

if (vide.path.ogv) {
sources += '<source src="' + vide.path.ogv + '.ogv" type="video/ogv">';
}
Expand All @@ -307,7 +295,15 @@
vide.$video.css('visibility', 'hidden');

// Set video properties
refreshSettings(vide);
vide.$video.prop({
autoplay: vide.settings.autoplay,
loop: vide.settings.loop,
volume: vide.settings.volume,
muted: vide.settings.muted,
defaultMuted: vide.settings.muted,
playbackRate: vide.settings.playbackRate,
defaultPlaybackRate: vide.settings.playbackRate
});

// Append a video
vide.$wrapper.append(vide.$video);
Expand All @@ -321,18 +317,16 @@
left: position.x,
'-webkit-transform': 'translate(-' + position.x + ', -' + position.y + ')',
'-ms-transform': 'translate(-' + position.x + ', -' + position.y + ')',
'-moz-transform': 'translate(-' + position.x + ', -' + position.y + ')',
transform: 'translate(-' + position.x + ', -' + position.y + ')'
});

// Resize a video, when it's loaded
vide.$video.on('canplaythrough.' + pluginName, function() {
vide.$video.css('visibility', 'visible');

// https://github.com/VodkaBears/Vide/pull/48
refreshSettings(vide);

// Force to play, important for Safari
vide.settings.autoplay && vide.$video[0].play();
vide.$video.prop('autoplay') && vide.$video[0].play();

vide.resize();
vide.$wrapper.css('background-image', 'none');
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.vide.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "vide",
"version": "0.3.1",
"version": "0.3.2",
"description": "Easy as hell jQuery plugin for video backgrounds.",
"keywords": [
"jquery-plugin",
Expand Down

0 comments on commit daaea1e

Please sign in to comment.