2.0.6 • Published 5 years ago
fragment-player v2.0.6
fragment-player
Play and seek through fragments of videos within a single player
Install
npm install --save fragment-player
Usage
import React from 'react'
import FragmentPlayerProvider, {FragmentPlayerContext} from 'fragment-player'
const fragments = [
{
src: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/SubaruOutbackOnStreetAndDirt.mp4',
fragmentBegin: 0,
fragmentEnd: 5,
},
{
src: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4',
fragmentBegin: 1,
fragmentEnd: 25,
},
{
src: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WeAreGoingOnBullrun.mp4',
fragmentBegin: 1,
fragmentEnd: 3,
},
]
const App = () => {
return (
<FragmentPlayerProvider fragments={fragments}>
<FragmentPlayerContext.Consumer>
{({video, seekTo, currentTime, totalLength}) => {
return (
<div style={{width: '100%'}}>
{video}
<input style={{width: '100%'}} type="range" min={0} max={totalLength} value={currentTime} onChange={(e) => seekTo(parseInt(e.target.value))}/>
</div>
)
}}
</FragmentPlayerContext.Consumer>
</FragmentPlayerProvider>
)
License
MIT © ryley-matos
2.0.6
5 years ago
2.0.5
5 years ago
2.0.4
5 years ago
2.0.3
5 years ago
2.0.2
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.2.6
5 years ago
1.2.5
5 years ago
1.2.4
5 years ago
1.2.3
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.14
5 years ago
1.0.13
5 years ago
1.0.12
5 years ago
1.0.11
5 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago