🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-flv-player

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-flv-player

A React Component to play flv video

1.0.9
latest
Source
npm
Version published
Weekly downloads
358
-7.49%
Maintainers
1
Weekly downloads
 
Created
Source

react-flv-player

A React component to play flv streaming video.

Installation

npm i react-flv-player

Usage

import React, { Component } from 'react';
import {ReactFlvPlayer} from 'react-flv-player'

class Index extends Component {

  render() {
    return (
      <div>
        <ReactFlvPlayer
          url = "http://xxx/xxx/xxx.flv"
          heigh = "800px"
          width = "800px"
          isMuted={true}
        />
      </div>
    );
  }
}

export default Index;

image

Props

FieldTypeDefaultDescription
typestringflvIndicates media type, 'flv' or 'mp4'
isLive?booleantrueIndicates whether the data source is a live stream
hasAudio?booleantrueIndicates whether the stream has audio track
hasVideo?booleantrueIndicates whether the stream has video track
url?stringurlIndicates media URL, can be starts with 'https(s)' or 'ws(s)' (WebSocket)
enableStashBuffer?booleantrueEnable IO stash buffer. Set to false if you need realtime (minimal latency) for live stream
stashInitialSize?number128 (KB)Indicates IO stash buffer initial size. Default is 384KB. Indicate a suitable size can improve video load/seek time.
height?px or %100%
width?px or %100%
isMuted?booleanrequiredIndicates audio output when init the video
handleError?function(err)=>{console.log(err)}Handle errors, error type is enum
enableWarning?booleanfalseEnable Warnings in Console
enableError?booleanfalseEnable errors in Console

Errors

<ReactFlvPlayer
  url={videoUrl}
  isMuted
  handleError={(err) => {
  switch (err) {
    case 'NetworkError':
      // todo
      console.log('network error');
    break;
    case 'MediaError':
      console.log('network error');
    break;
    default:
      console.log('other error');
  }
}}
/>
ErrorDescription
NETWORK_ERRORErrors related to the network
MEDIA_ERRORErrors related to the media (format error, decode issue, etc)
OTHER_ERRORAny other unspecified error

Keywords

react

FAQs

Package last updated on 08 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts