@oplayer/plugins
TypeScript icon, indicating that this package has built-in type declarations

1.0.14 • Public • Published

Pluings

npm i @oplayer/plugins
import { Playlist, Chromecast, AirPlay, ad, vttThumbnails } from '@oplayer/plugins'
<!-- All plugins -->
<script src="https://cdn.jsdelivr.net/npm/@oplayer/plugins@latest/dist/index.min.js"></script>

<!-- Playlist -->
<script src="https://cdn.jsdelivr.net/npm/@oplayer/plugins@latest/dist/playlist.min.js"></script>

<!-- VTT Thumbnails -->
<script src="https://cdn.jsdelivr.net/npm/@oplayer/plugins@latest/dist/vttThumbnails.min.js"></script>

<!-- Chromecast -->
<script src="https://cdn.jsdelivr.net/npm/@oplayer/plugins@latest/dist/chromecast.min.js"></script>

<!-- AirPlay -->
<script src="https://cdn.jsdelivr.net/npm/@oplayer/plugins@latest/dist/airplay.min.js"></script>

<!-- AD -->
<script src="https://cdn.jsdelivr.net/npm/@oplayer/plugins@latest/dist/ad.min.js"></script>

Playlist

Player.make('#oplayer')
  .use([
    new Playlist({
      initialIndex: 0, // default
      autoNext: true, // default
      autoHide: true, // default
      sources: [
        {
          title: '君の名は - MP4',
          src: 'https://oplayer.vercel.app/君の名は.mp4',
          poster: 'https://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/poster.png',
          duration: '01:32',
          thumbnails: {
            src: 'https://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/thumbnails.jpg',
            number: 100
          },
          subtitles: [
            {
              name: 'Default',
              default: true,
              src: 'https://oplayer.vercel.app/君の名は.srt',
              offset: 2
            }
          ]
        },
        {
          title: 'Big Buck Bunny - HLS',
          src: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
          duration: '10:34'
        },
        {
          title: 'DASH',
          src: 'https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd',
          duration: '10:34'
        },
        {
          title: 'FLV',
          src: 'https://cdn.jsdelivr.net/gh/shiyiya/QI-ABSL@master/o/weathering-with-you.flv',
          duration: '02:02'
        }
      ]
    })
  ])
  .create()

player.context.playlist.next() // play next
player.context.playlist.previous() // play previous
player.context.playlist.showUI() // show list UI
player.context.playlist.hideUI() // hide list UI
player.context.playlist.changeSourceList([]) //change playlist sources

VTT Thumbnails

Player.make('#oplayer')
  .use([vttThumbnails({ src: 'your-file-path' })])
  .create()

Chromecast

Player.make('#oplayer').use([new Chromecast()]).create()

AirPlay

Player.make('#oplayer').use([new AirPlay()]).create()

AD

Package Sidebar

Install

npm i @oplayer/plugins

Weekly Downloads

61

Version

1.0.14

License

MIT

Unpacked Size

539 kB

Total Files

39

Last publish

Collaborators

  • isbailin