Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/littlstar/slant-player
Slant video player component
https://github.com/littlstar/slant-player
Last synced: about 1 month ago
JSON representation
Slant video player component
- Host: GitHub
- URL: https://github.com/littlstar/slant-player
- Owner: littlstar
- License: mit
- Created: 2014-11-10T03:03:07.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-16T18:36:47.000Z (about 10 years ago)
- Last Synced: 2023-05-29T11:01:19.174Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 16.1 MB
- Stars: 2
- Watchers: 20
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
slant-player
===========Slant video player component.
![screenshot](screenshot.png)
## install
```sh
$ component install littlstar/slant-player
```## usage
```js
var Player = require('slant-player');
var el = document.querySelector('#player');
var player = new Player(el, {src: 'video.mp4'});player.render();
```## api
### Player (parent, opts)
```js
new Player(parent, {src: 'video.mp4'});
```* `parent` - Parent DOM Element
* `opts` - Player options where an option is:
* `width` - player width
* `height` - player height
* `src` - Video source
* `controls` - [slant-controls](https://github.com/littlstar/slant-controls) options### #play
Plays the video player
```js
player.play();
```### #pause
Pauses the video player
```js
player.pause();
```### #volume(level)
Sets the video player volume level
```js
player.volume(0.8);
```### #mute
Muts the video player volume
```js
player.mute();
```### #seek(seconds)
Seek to position in seconds
```js
player.seek(34);
```### #use(fn)
Use a plugin with the player
```js
player.use(plugin());
```### #show
Shows the video player
```js
player.show();
```### #hide
Hides the video player
```js
player.hide();
```### #render
Renders the video player in the DOM
```js
player.render();
```### #destroy
Destroys the video player in view
```js
player.destroy();
```## license
MIT