🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@afiniti/video-player-lite

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@afiniti/video-player-lite

React component for playing videos

latest
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

@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" />

Keywords

npm

FAQs

Package last updated on 12 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts