Skip to content

Commit

Permalink
Release version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
OriginalEXE committed Mar 13, 2017
2 parents 551ede9 + 41e2be5 commit 9fc1fe5
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 31 deletions.
57 changes: 41 additions & 16 deletions dist/vidim.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* vidim v1.0.0
* 2016-11-04T00:33:53.043Z
* vidim v1.0.1
* 2017-03-13T17:00:04.439Z
* https://github.com/OriginalEXE/vidim
*
* Made by Ante Sepic
Expand All @@ -20,7 +20,7 @@ var index$1 = createCommonjsModule(function (module) {
* Expose `Emitter`.
*/

if (typeof module !== 'undefined') {
{
module.exports = Emitter;
}

Expand Down Expand Up @@ -761,6 +761,33 @@ var YouTubeProvider = function (vidim) {
}

_this2.emit('ready');

if (_this2._options.loop) {

var loopInterval = void 0;

_this2.on('play', function () {

loopInterval = setInterval(function () {

if (_this2.getTime() === 0 || _this2.getTime() + 0.15 > _this2.getDuration()) {

_this2.setTime(0);
_this2.play();
}
}, 100);
});

_this2.on('pause', function () {

clearInterval(loopInterval);
});

_this2.on('destroy', function () {

clearInterval(loopInterval);
});
}
},
'onStateChange': function onStateChange(e) {

Expand Down Expand Up @@ -789,8 +816,8 @@ var YouTubeProvider = function (vidim) {

if (this._options.loop) {

playerParams.playlist = this.videoID;
playerParams.loop = 1;
playerParams.playerVars.playlist = this.videoID;
playerParams.playerVars.loop = 1;
}

this.player = new YT.Player(toBeReplaced, playerParams);
Expand Down Expand Up @@ -1104,24 +1131,22 @@ if ('undefined' === typeof window.onYouTubeIframeAPIReady) {
window.dispatchEvent(event);
};
} else {
(function () {

var oldOnYouTubeIframeAPIReady = window.onYouTubeIframeAPIReady;
var oldOnYouTubeIframeAPIReady = window.onYouTubeIframeAPIReady;

window.onYouTubeIframeAPIReady = function () {
window.onYouTubeIframeAPIReady = function () {

oldOnYouTubeIframeAPIReady();
oldOnYouTubeIframeAPIReady();

window.vidimYouTubeAPIReady = true;
window.vidimYouTubeAPIReady = true;

isAPIReady = true;
isAPIReady = true;

window.dispatchEvent(event);
};
})();
window.dispatchEvent(event);
};
}

var index = (function factory(global) {
var index = ((function factory(global) {

if ('undefined' === typeof global.document) {

Expand Down Expand Up @@ -1527,7 +1552,7 @@ var index = (function factory(global) {
ready(scanDOM);

return vidim;
})('undefined' !== typeof window ? window : undefined);
}))('undefined' !== typeof window ? window : undefined);

return index;

Expand Down
6 changes: 3 additions & 3 deletions dist/vidim.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ <h5>buffering</h5>
</section>

<script type="text/javascript" src="js/modernizr.js"></script>
<script type="text/javascript" src="https://s3-eu-west-1.amazonaws.com/originalexe/vidim/release/1.0.0/vidim.min.js"></script>
<script type="text/javascript" src="https://s3-eu-west-1.amazonaws.com/originalexe/vidim/release/1.0.1/vidim.min.js"></script>
<script type="text/javascript" src="js/demo.js"></script>

</body>
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vidim",
"version": "1.0.0",
"version": "1.0.1",
"description": "Background videos made easy. Supports both YouTube and self hosted videos.",
"author": {
"name": "Ante Sepic",
Expand All @@ -24,24 +24,24 @@
},
"license": "MIT",
"devDependencies": {
"babel-core": "^6.18.2",
"babel-preset-es2015": "^6.18.0",
"babel-preset-stage-2": "^6.18.0",
"babel-core": "^6.24.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-stage-2": "^6.22.0",
"component-emitter": "^1.2.1",
"del": "^2.2.2",
"gulp": "github:gulpjs/gulp#4.0",
"gulp-autoprefixer": "^3.1.1",
"gulp-sass": "^2.3.2",
"karma": "^1.3.0",
"gulp-sass": "^3.1.0",
"karma": "^1.5.0",
"karma-chrome-launcher": "^2.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-firefox-launcher": "^1.0.1",
"karma-ie-launcher": "^1.0.0",
"karma-qunit": "^1.2.1",
"karma-safari-launcher": "^1.0.0",
"qunitjs": "^2.0.1",
"rollup": "^0.36.3",
"rollup-plugin-babel": "^2.6.1",
"rollup-plugin-commonjs": "^5.0.5",
"qunitjs": "^2.2.0",
"rollup": "^0.41.5",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-eslint": "^3.0.0",
"rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-uglify": "^1.0.1"
Expand Down
36 changes: 36 additions & 0 deletions src/providers/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,42 @@ export default function( vidim ) {

this.emit( 'ready' );

if ( this._options.loop ) {

let loopInterval;

this.on( 'play', () => {

loopInterval = setInterval( () => {

if (
this.getTime() === 0 ||
this.getTime() + 0.15 > this.getDuration()
) {

this.setTime( 0 );
this.play();

}

}, 100 );

});

this.on( 'pause', () => {

clearInterval( loopInterval );

});

this.on( 'destroy', () => {

clearInterval( loopInterval );

});

}

},
'onStateChange': ( e ) => {

Expand Down

0 comments on commit 9fc1fe5

Please sign in to comment.