Simm Player - techbasejs/techbase GitHub Wiki

Install

npm install simm-player
import firebaseChat from 'simm-player';

const PlayerOptions = {
  layout: 'basic', // basic | liveui
  target: '#inputFile',
  sources: [{ src: 'blob://newvideo.mp4', type: 'video/mp4' }]
  disabled: false,
  autoplay: true, // true | false | muted
  controls: true, // Determines whether or not the player has controls that the user can interact with. Without controls the only way to start the video playing is with the autoplay attribute or through the Player API.
  fluid: true, // 
  width: '100%',
  height: '100%', // '16:9' | '4:3'
  aspectRatio: undefined,
  poster: undefined, A URL to an image that displays before the video begins playing. This is often a frame of the video or a custom title screen. As soon as the user hits "play" the image will go away.
  preload: , // Suggests to the browser whether or not the video data should begin downloading as soon as the <video> element is loaded. Supported values are: 'auto' | 'none' | 'metadata',
  loop: true, // Causes the video to start over as soon as it ends.
  muted: false, // Will silence any audio by default.
  playsinline: true, // Indicates to the browser that non-fullscreen playback is preferred when fullscreen playback is the native default, such as in iOS Safari.
  fullscreen: false, // Setting this to true will change fullscreen behaviour on devices
  playbackRates: [0.5, 1, 1.5, 2] // An array of numbers strictly greater than 0, where 1 means regular speed (100%), 0.5 means half-speed (50%), 2 means double-speed (200%)
  hotkeys: {
    play: 88, // keycode
    pause: xx,
    muted: xx,
    openFullScreen: xx,
    closeFullScreen: xx,
  },
  hooks: {
    onPlay: () => {},  
    onPause: () => {},
    onSkip: (type: 'forward' | 'backward', seconds: number) => {},
    onMuted: () => {},
    onEnded: () => {},
    onClick: () => {},
    onDoubleClick: () => {},
    onOpenFullScreen: () => {},
    onCloseFullScreen: () => {},
  }
};

class SimmUploader {
  constructor(private options: PlayerOptions) {}
  render() {} // handle logic render layout
  play() {}
  pause() {}
  openFullScreen() {}
  closeFullScreen() {}
  muted() {}
  volume(type: 'up' | 'down' , percent: number) {}
  skip(type: 'forward' | 'backward', seconds: number) {}
  speedControl(rate: number) {} // [0.5, 1, 1.5, 2]
}
⚠️ **GitHub.com Fallback** ⚠️