0.1.8-fix-893scrub-bar-highlights.20220808135731 • Published 4 years ago

@collaborne/video-player v0.1.8-fix-893scrub-bar-highlights.20220808135731

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
4 years ago

@collaborne/video-player - v0.1.8 / Modules

@collaborne/video-player

A video player build in React on top of CookPete/react-player. With nice MUI theming support and stylish replacement of browser video controls (UI and PiP event). And yes, it is updated to React v18 :balloon:!

Note: At the moment we only support url from a video file! Other media not yet supported(YouTube/Vimeo/...)

Live demo

Install

npm install --save @collaborne/video-player

How to use

  • Simplified or out of the box - if you don't need to manage any states by your own, or usage of the api, you can just use VideoPlayer
import React from 'react';
import { VideoPlayer } from '@collaborne/video-player';

export const MyComponent: React.FC = () => {
	return (
		<VideoPlayer videoUrl="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4" />
	);
};
  • Composed or individual- This case recommended is when you want to control video state (playing, pausing, muting...). You need to wrap your components in VideoProvider and add VideoContainer as a children too. Then you can consume VideoContext via useVideo hook.
import React from 'react';
import { useVideo, VideoProvider, VideoContainer } from '@collaborne/video-player';

const App = () => {
  <VideoProvider
		controlsConfig={{
			alwaysShowConfig: true,
		}}
	>
    <MyComponent1/>
    <MyComponent2/>
    <VideoContainer videoUrl="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WhatCarCanYouGetForAGrand.mp4"/>
    <MyComponent3/>
    ...
  </VideoProvider>
}

const MyComponent2: React.FC = () => {
	const { api } = useVideo();
	return (
		<div>
			<p>Video is playing: {api?.getPlaying?.()}</p>
			<p>Video is muted: {api?.getMuted?.()}</p>
			<p>Video total duration: {api?.getDuration?.()}</p>
		</div>
	);
};

Image

Documentation

FAQ

  • Q: How about timing? If we need to stop a video at 1026ms?
    A: For the ReactPlayer we set a progressInterval=50ms, that means that video will stop at interval 1000-1050ms.

  • Q: Do you support Youtube, vimeo sources?
    A: At the moment, no. We support only files.

License

Apache-2.0 © Collaborne

1.1.1

3 years ago

1.1.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.7

3 years ago

0.2.6

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.1.13

4 years ago

0.1.14

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.6-5

4 years ago

0.1.6-4

4 years ago

0.1.6-1

4 years ago

0.1.6-0

4 years ago

0.1.5

4 years ago

0.1.4-4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago