Skip to content

jim-junior/reactjs-media

Repository files navigation

Reactjs Media

License: MIT Npm package total downloads version Sponsor On Patreon

The reactjs media is a react package with awesome HTMLMediaElements that are recreated into react components with a good looking UI and fast UX.

It includes currently only has a video and audio component.

Available components:

  • Image
  • Video
  • Audio

Installation

To install go to your terminal and run this script

# npm
$ npm install reactjs-media
# yarn
$ yarn add reacttjs-media

If your see no error then is is Installed.

Setup

In here we shall show a small demo on how to setup a simple video component. We shall create the default component.

Using new player in version 2

import React from 'react';
import { Video } from 'reactjs-media';

const App = () => {
    return (
        <div>
            <MyVideo />
        </div>
    )
}

const MyVideo = () => {
    return (
        <>
        <div>
            <Video
                src='https://www.example.com/myvideo.mp4'
                poster='/poster.png'
            />
        <div/>
        </>
    )
}

Using old player in version 1

import React from 'react';
import { ReactVideo } from 'reactjs-media';

const App = () => {
    return (
        <div>
            <MyVideo />
        </div>
    )
}

const MyVideo = () => {
    return (
        <>
        <div>
            <ReactVideo
                src='https://www.example.com/myvideo.mp4'
                poster='/poster.png'
            />
        <div/>
        </>
    )
}

If you want to learn more, Checkout the offical Documentation


The source code can be found on Github.