A React Library For Video And Audio Streaming With Custom Http Headers
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.
npm install --save react-video-streamimport 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 AppMIT © AlsiddigAhmed