Skip to content

ElsiddigAhmed/react-video-stream

Repository files navigation

react-video-stream

A React Library For Video And Audio Streaming With Custom Http Headers

NPM JavaScript Style Guide

About

One of the most painful things is video streaming, and the painful part of video streaming is authenticated and protected video or audio. I worked on a system that requires authenticated videos on video playlist for authenticated students, so I have made this library as a small API inside of my react application, then I separated it into library, now you can call just one video class from the library and pass the options as shown bellow.

Install

npm install --save react-video-stream

Usage

import React from 'react'
import { Video } from 'react-video-stream'
const url = 'http://example.com/manifest.mpd'

const options = {
  requestHeader: 'Authorization',
  requestToken: 'access_token'
}
const App = () => {
  return (
    <div>
      <Video
        className='video-class'
        controls={true}
        autoPlay={true}
        options={options}
        remoteUrl={url}
      />
    </div>
  )
}

export default App

License

MIT © AlsiddigAhmed

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages