Skip to content

Commit

Permalink
Removed TravisCI and added Buffering event.
Browse files Browse the repository at this point in the history
  • Loading branch information
sandroweb committed Jul 20, 2017
1 parent c3e927a commit 4a9d6e1
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PlayerTube [![Build Status](https://travis-ci.org/sandroweb/player-tube.svg?branch=master)](https://travis-ci.org/sandroweb/player-tube)
# PlayerTube


### About
Expand Down Expand Up @@ -154,6 +154,20 @@ $('.my-player').playerTube({
```


#### onBuffering
Type: `function`
Default: `undefined`

This event is dispatched when the video is loading.
```
$('.my-player').playerTube({
onBuffering: function (e) {
console.log(e.type, e);
}
});
```


#### onUpdate
Type: `function`
Default: `undefined`
Expand Down
2 changes: 1 addition & 1 deletion dist/player-tube.js

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

2 changes: 1 addition & 1 deletion dist/player-tube.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 dist/player-tube.min.js.map

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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "player-tube",
"version": "0.1.1",
"version": "0.1.2",
"keywords": [
"iframe",
"youtube",
Expand Down
2 changes: 1 addition & 1 deletion player-tube.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "player-tube",
"title": "PlayerTube",
"description": "This jQuery plugin is helpful to add a YouTube video into your application using JavaScript.",
"version": "0.1.0",
"version": "0.1.2",
"homepage": "https://github.com/sandroweb/player-tube",
"demo": "https://github.com/sandroweb/player-tube",
"docs": "https://github.com/sandroweb/player-tube/blob/master/README.md",
Expand Down
10 changes: 8 additions & 2 deletions source/player-tube.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*global jQuery, window, YT*/
/*jslint this*/
(function ($, win, doc) {

'use strict';
Expand All @@ -9,7 +10,7 @@
*/

$.fn.playerTube = function (options) {
options = (options === undefined) ? {} : options;
options = options || {};
win.playersTube = win.playersTube || {};
win.playersTube.videos = win.playersTube.videos || [];

Expand Down Expand Up @@ -100,7 +101,6 @@
}

function onStateChange(s) {
console.log('#', s);
switch (s) {
case -1:
stopUpdateCallback();
Expand All @@ -126,6 +126,12 @@
options.onPaused(getEventObject('onpaused'));
}
break;
case 3:
startUpdateCallback();
if (options.onBuffering !== undefined) {
options.onBuffering(getEventObject('onbuffering'));
}
break;
}
}

Expand Down

0 comments on commit 4a9d6e1

Please sign in to comment.