1.0.1 • Published 2 years ago
blaze-player v1.0.1
blaze-player
Advanced React.js Media Player
Install
npm install --save blaze-player
Basic Usage
import React from "react";
import Player from "blaze-player";
import "blaze-player/dist/index.css";
// Functional
const MyUI = () => {
return (
<>
<Player src="http://example.com/example.mp4" type="basic" />
</>
);
};
Next.js SSR Issue Workaround
import dynamic from "next/dynamic";
// Provide types
import type { AvailableBaseProps } from "blaze-player";
const Player = dynamic<AvailableBaseProps>(() => import("blaze-player"), {
ssr: false,
});
export default function MyNextJSApp() {
return (
<>
<Player src="http://example.com/example.mp4" type="basic" />
</>
);
}
Available Props
Name | Default Value | Type | Required | Description |
---|---|---|---|---|
buttons | {} | { [key in Buttons]: boolean; } | false | Hide / Show Buttons |
defaults | {playbackSpeed: 1} | {playbackSpeed?: number;} | true | Enable / Disable Video Background |
disableDynamicBackground | false | boolean | false | Enable / Disable Video Background |
disableStatsForNerds | false | boolean | ||
src | "" | string | true | Enable / Disable Video Background |
type | basic | "basic" | "hls" | "mpd" | true | Specify the type of the source |