0.1.2 • Published 2 years ago

@afiniti/video-player-lite v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@afiniti/video-player-lite

Description

Lightweight React video player module built for vimeo, this is a wrapper on plyr.io with added funtionality.

Installation

npm i @afiniti/video-player-lite

Features

  • Floating Player
  • Fullscreen video
  • Video Modal
  • Poster
  • Related Videos
  • Play/pause/mute full control over the player

Props

NameTypeDescription
posterstringposter url given in a string
vimeoIdstringvimeo video id
videoSlugstringvideo slug
videoTitlestringtitle to display on video
isFloatingboolShow floating video on scroll or not. Defaults to true
playFullScreenboolPlay video full screen or not. Defaults to false
openInModalboolPlay video in a modal append in root. Defaults to false
playCallbackmethodAction to perform on video play button
closeCallbackmethodAction to perform on video close button
openRelatedVideosboolShow related videos or not. Defaults to false
apiUrlstringApi url from where to fetch the related videos

Example Usage

The package can be integrated inside a react component as follows:

install plyr 3.6.8 in your project

import React from 'react';
// @dependencies
import PlayerComponent from 'js/VideoPlayerLite';
// @import styles
import styles from './index.module.scss';

const Home = () => {
  return (
    <div className={styles.homeContainer}>
      <PlayerComponent
         vimeoId="546196101"
        isFloating={false}
        openInModal={true}
        playFullScreen={false}
        openRelatedVideos={true}
        videoSlug="anthony-tuggle-testimonial"
        videoTitle="THE NUANCE OF AFINITI'S TECHNOLOGY"
        poster="http://media.graphcms.com/m2Mm6haVT3iKaT2VUZJQ"
        apiUrl="https://api-us-east-1.graphcms.com/v2/ckui8cam7108201xpc9tg32du/master"
      />
    </div>
  );
};

export default Home;

add cdn link in server.js or index.html

<link rel="stylesheet" href="https://cdn.plyr.io/3.6.8/plyr.css" />
0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago