Skip to content
This repository was archived by the owner on Mar 29, 2022. It is now read-only.

Commit b2041a8

Browse files
author
Jimmy Bourassa
committed
Kickstart structure
- Remove generated tests - Add jshintrc - Improve README & demo
1 parent ea224b7 commit b2041a8

10 files changed

+34
-207
lines changed

.jshintrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"esversion": 6
3+
}

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) Jimmy Bourassa <[email protected]>
1+
Copyright (c) Jimmy Bourassa <[email protected]>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

+6-58
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,17 @@
1-
# videojs-vimvim
1+
# Videojs Vimeo plugin
22

3-
Vimeojs plugin based on the Vimeo Player API
3+
Videojs Vimeo plugin using the official Vimeo Player API. This is heavily
4+
inspired by the official [VideoJS YouTube project](https://github.com/videojs/videojs-youtube).
45

56
## Installation
67

7-
```sh
8-
npm install --save videojs-vimvim
9-
```
10-
11-
The npm installation is preferred, but Bower works, too.
12-
13-
```sh
14-
bower install --save videojs-vimvim
15-
```
8+
For now, the package is not published on any package manager — download the dist file or
9+
point your package manage at this repo.
1610

1711
## Usage
1812

19-
To include videojs-vimvim on your website or web application, use any of the following methods.
20-
21-
### `<script>` Tag
22-
23-
This is the simplest case. Get the script in whatever way you prefer and include the plugin _after_ you include [video.js][videojs], so that the `videojs` global is available.
24-
25-
```html
26-
<script src="//path/to/video.min.js"></script>
27-
<script src="//path/to/videojs-vimvim.min.js"></script>
28-
<script>
29-
var player = videojs('my-video');
30-
31-
player.vimvim();
32-
</script>
33-
```
34-
35-
### Browserify
36-
37-
When using with Browserify, install videojs-vimvim via npm and `require` the plugin as you would any other module.
38-
39-
```js
40-
var videojs = require('video.js');
41-
42-
// The actual plugin function is exported by this module, but it is also
43-
// attached to the `Player.prototype`; so, there is no need to assign it
44-
// to a variable.
45-
require('videojs-vimvim');
46-
47-
var player = videojs('my-video');
48-
49-
player.vimvim();
50-
```
51-
52-
### RequireJS/AMD
53-
54-
When using with RequireJS (or another AMD library), get the script in whatever way you prefer and `require` the plugin as you normally would:
55-
56-
```js
57-
require(['video.js', 'videojs-vimvim'], function(videojs) {
58-
var player = videojs('my-video');
59-
60-
player.vimvim();
61-
});
62-
```
63-
64-
## License
13+
See [index.html](https://github.com/didacte/videojs-vimeo/blob/master/index.html)
6514

6615
MIT. Copyright (c) Jimmy Bourassa <[email protected]>;
6716

68-
6917
[videojs]: http://videojs.com/

bower.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "videojs-vimvim",
2+
"name": "videojs-vimeo",
33
"author": "Jimmy Bourassa &lt;[email protected]&gt;",
44
"license": "MIT",
55
"main": [
6-
"dist/videojs-vimvim.min.js"
6+
"dist/videojs-vimeo.min.js"
77
],
88
"keywords": [
99
"videojs",

index.html

+9-16
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,18 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>videojs-vimvim Demo</title>
5+
<title>videojs-vimeo Demo</title>
66
<link href="/node_modules/video.js/dist/video-js.css" rel="stylesheet">
77
</head>
88
<body>
9-
<video id="videojs-vimvim-player" class="video-js vjs-default-skin" controls>
10-
<source src="//vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
11-
<source src="//vjs.zencdn.net/v/oceans.webm" type='video/webm'>
12-
</video>
13-
<ul>
14-
<li><a href="/test/">Run unit tests in browser.</a></li>
15-
16-
</ul>
9+
<video
10+
id="vid1"
11+
class="video-js"
12+
width="640" height="264"
13+
data-setup='{ "techOrder": ["vimeo"], "sources": [{ "type": "video/vimeo", "src": "https://vimeo.com/184380829"}] }'
14+
>
1715
<script src="/node_modules/video.js/dist/video.js"></script>
18-
<script src="/dist/videojs-vimvim.js"></script>
19-
<script>
20-
(function(window, videojs) {
21-
var player = window.player = videojs('videojs-vimvim-player');
22-
player.vimvim();
23-
}(window, window.videojs));
24-
</script>
16+
<script src="/dist/videojs-vimeo.js"></script>
17+
</video>
2518
</body>
2619
</html>

package.json

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"name": "videojs-vimvim",
3-
"version": "0.0.0",
4-
"description": "Vimeojs plugin based on the Vimeo Player API",
2+
"name": "videojs-vimeo",
3+
"version": "0.0.1",
4+
"description": "Videojs Vimeo plugin using the official Vimeo Player API.",
55
"main": "es5/plugin.js",
66
"scripts": {
77
"prebuild": "npm run clean",
88
"build": "npm-run-all -p build:*",
99
"build:js": "npm-run-all build:js:babel build:js:browserify build:js:bannerize build:js:collapse build:js:uglify",
1010
"build:js:babel": "babel src -d es5",
11-
"build:js:bannerize": "bannerize dist/videojs-vimvim.js --banner=scripts/banner.ejs",
12-
"build:js:browserify": "browserify . -g browserify-shim -s videojs-vimvim -o dist/videojs-vimvim.js",
13-
"build:js:collapse": "bundle-collapser dist/videojs-vimvim.js -o dist/videojs-vimvim.min.js",
14-
"build:js:uglify": "uglifyjs dist/videojs-vimvim.min.js --comments --mangle --compress -o dist/videojs-vimvim.min.js",
11+
"build:js:bannerize": "bannerize dist/videojs-vimeo.js --banner=scripts/banner.ejs",
12+
"build:js:browserify": "browserify . -g browserify-shim -s videojs-vimeo -o dist/videojs-vimeo.js",
13+
"build:js:collapse": "bundle-collapser dist/videojs-vimeo.js -o dist/videojs-vimeo.min.js",
14+
"build:js:uglify": "uglifyjs dist/videojs-vimeo.min.js --comments --mangle --compress -o dist/videojs-vimeo.min.js",
1515
"build:test": "babel-node scripts/build-test.js",
1616
"clean": "rimraf dist test/dist es5 && mkdirp dist test/dist es5",
1717
"lint": "vjsstandard",
@@ -43,10 +43,10 @@
4343
"sinon": "global:sinon",
4444
"video.js": "global:videojs"
4545
},
46-
"style": "dist/videojs-vimvim.css",
46+
"style": "dist/videojs-vimeo.css",
4747
"videojs-plugin": {
48-
"style": "dist/videojs-vimvim.css",
49-
"script": "dist/videojs-vimvim.min.js"
48+
"style": "dist/videojs-vimeo.css",
49+
"script": "dist/videojs-vimeo.min.js"
5050
},
5151
"vjsstandard": {
5252
"ignore": [
@@ -66,8 +66,7 @@
6666
"es5/",
6767
"index.html",
6868
"scripts/",
69-
"src/",
70-
"test/"
69+
"src/"
7170
],
7271
"dependencies": {
7372
"browserify-versionify": "^1.0.6",
@@ -108,4 +107,4 @@
108107
"pre-push": "npm run lint"
109108
}
110109
}
111-
}
110+
}

scripts/server.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ const nameify = (str) =>
1717

1818
const srces = {
1919
js: 'src/plugin.js',
20-
tests: glob.sync('test/**/*.test.js')
2120
};
2221

2322
const dests = {
2423
js: nameify('dist/%s.js'),
25-
tests: 'test/dist/bundle.js'
2624
};
2725

2826
const tasks = {
@@ -79,7 +77,7 @@ const build = (name) => {
7977
mkdirp.sync('dist');
8078

8179
// Start the server _after_ the initial bundling is done.
82-
build(['js', 'tests']).then(() => {
80+
build(['js']).then(() => {
8381
const server = budo({
8482
port: 9999,
8583
stream: process.stdout

test/index.html

-18
This file was deleted.

test/karma.conf.js

-38
This file was deleted.

test/plugin.test.js

-58
This file was deleted.

0 commit comments

Comments
 (0)