1.0.0 • Published 3 years ago

wassplayers v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

WassPlayer

WassPlayer is a simple, lightweight and customizable video player that supports modern browsers.

Installation

npm i wassplayer --save

HTML5 Video

<video id="WassPlayer" controls data-poster="/path/to/poster.jpg">
  <source src="video.mp4" type="video/mp4" />
  <source src="video.webm" type="video/webm" />

  <!-- Optional -->
  <track kind="captions" label="English captions" src="/path/to/captions.vtt" srclang="en" default />
</video>

JavaScript

You can use WassPlayer as an ES6-ES9 module as follows:

import WassPlayer from 'wassplayer';

const player = new WassPlayer('#WassPlayer');

CDN

JS

You can use our CDN

<script src="http://code4stack.com/wassplayer.js"></script>

CSS

<link rel="stylesheet" href="http://code4stack.com/wassplayer.css" />

Video Playlist and Quality control

This allows changing the player source and type on the fly.

Video example:

player.source = {
  type: 'video',
  title: 'title',
  sources: [
    {
      src: '/path/movie.mp4',
      type: 'video/mp4',
      size: 720,
    },
    {
      src: '/path/movie.webm',
      type: 'video/webm',
      size: 1080,
    },
  ],
  poster: '/path/poster.jpg',
  previewThumbnails: {
    src: '/path/thumbnails.vtt',
  },
  tracks: [
    {
      kind: 'captions',
      label: 'English',
      src: '/path/to/captions.en.vtt',
      default: true,
    },
    {
      kind: 'captions',
      label: 'Hindi',
      src: '/path/to/captions.hn.vtt',
    },
  ],
};

Browser support

WassPlayer supports the most modern browsers.

BrowserSupported
Chrome
Edge
Firefox
IE11
IE10
Mobile Safari
Opera
Safari

Author

WassPlayer is developed by (https://www.webappssoft.com/).

Copyright and License

The MIT license