Giter Site home page Giter Site logo

next-js-player's Introduction

Next Js Player ๐Ÿš€

"next-js-player" is video player that supports both react and next js(i.e pages router and app router)

Demo ๐Ÿ”—

See Demo

Github

Contribut On Github

Stacks

My Skills

Installation

  1. Run the command below to install next-js-player
npm i next-js-player

or

yarn add next-js-player
  1. Run the command below to install react-icons
npm i react-icons

or

yarn add react-icons
  1. Run the command below to install tailwindcss, if not installed
npm install -D tailwindcss
npx tailwindcss init

or

yarn add -D tailwindcss
yarn tailwindcss init

Configurations

  1. Add the below css to the globals.css (for Next Js) or to the index.css/App.css (for React Js)
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 214, 219, 220;
  --background-end-rgb: 255, 255, 255;
}

.player-controls {
  bottom: -4rem !important;
}
.video-wraper:hover > .player-controls {
  bottom: -15px !important;
}
::-webkit-media-controls {
  display: none !important;
}
video::-webkit-media-controls {
  display: none !important;
}
video::-webkit-media-controls-enclosure {
  display: none !important;
}

For Next Js:

  1. Add the configs below to install tailwindcss.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
    content: [
        "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
        "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
        "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
        "./node_modules/next-js-player/**/*.{js,ts,jsx,tsx,mdx}",
    ],
    theme: {
        extend: {
            backgroundImage: {
                "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
                "gradient-conic":"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
            },
        },
    },
    plugins: [],
};

For React Js:

  1. Add the configs below to install tailwindcss.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
    content: ["./src/**/*.{js,jsx,ts,tsx}"],
    theme: { extend: {}},
    plugins: [],
};

How to use?(Example)

import Player from "next-js-player";
export default function Home() {
        return (
        <main>
            <Player source={"<source url/path>"} width={100} />
        </main>
    );
}

Properties

Pass these attributes and values to the "Player" component.

Type Attributes Values
string source or locale source of the video
number width <value in %> and by default value is 100%
boolean loop by default false

next-js-player's People

Contributors

screentechnicals avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.