0.5.2 • Published 9 months ago

@kinescope/react-kinescope-player v0.5.2

Weekly downloads
101
License
MIT
Repository
github
Last release
9 months ago

License

Installation

Using npm:

npm install @kinescope/react-kinescope-player --save

Using yarn:

yarn add @kinescope/react-kinescope-player

Getting Started

Basic usage

import React from 'react'
import KinescopePlayer from '@kinescope/react-kinescope-player';

function Player() {
  return (
    <KinescopePlayer videoId="00000000" />
  )
}

export default Player;

Events

functions onTimeUpdate({currentTime}){
    ...
}

<KinescopePlayer videoId="00000000" onTimeUpdate={onTimeUpdate} />

Methods

let playerRef = React.createRef();

<KinescopePlayer ref={playerRef} videoId="00000000" />

functions handleMuteClick(){
    playerRef.current.mute();
}

<button onClick={handleMuteClick}>Mute</button>

Next.js

import dynamic from 'next/dynamic'
const KinescopePlayer = dynamic(import('@kinescope/react-kinescope-player'), { ssr: false });

function Player() {
	return (
		<KinescopePlayer videoId="00000000" />
	)
}

export default Player;

Props

Chapter
type Chapter = {
	position: number;
	title: string;
};
LocalStorage
type LocalStorage = boolean | {
	quality?: 'item' | 'global' | boolean;
	time?: boolean;
	textTrack?: 'item' | 'global' | boolean;
};
vtt
type Vtt = {
	label: string;
	src: string;
	srcLang: string;
};
CallToAction
type CallToAction = {
	id: string;
	title: string;
	description?: string;
	skipable?: boolean;
	buttonStyle?: object;
	trigger: {
		percentages: number[];
		timePoints: number[];
		pause: boolean;
	};
};
Bookmark
type Bookmark = {
	id: string;
	time: number;
	title?: string;
};
Watermark
type Watermark =
	| string
	| {
	text: string;
	mode?: WatermarkModeTypes;
	scale?: number;
	displayTimeout?: number | { visible: number; hidden: number };
};
Theme
type Theme = {
	subtitles?: {
		/** Base font size in em. */
		textSize: number;
		textAlign: 'left' | 'center';
		textLength: 'auto' | number;
	};
};

Events

Methods

0.5.2

9 months ago

0.4.7

9 months ago

0.4.6

11 months ago

0.4.5

1 year ago

0.4.4

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.2.19

3 years ago

0.3.0

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.16

3 years ago

0.2.15

4 years ago

0.2.14

4 years ago

0.2.13

4 years ago

0.2.12

4 years ago

0.2.11

4 years ago

0.2.10

4 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.13

5 years ago