Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

This is a React flv video player

License

NotificationsYou must be signed in to change notification settings

FalconIA/react-flv-player

 
 

Repository files navigation

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 alive 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 is384KB. Indicate a suitable size can improve video load/seek time.
height?px or %100%
width?px or %100%
autoPlay?booleanfalse
controls?booleantrue
controlsList?stringundefied
loop?booleanfalse
muted?booleanfalseIndicates 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

About

This is a React flv video player

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript100.0%

[8]ページ先頭

©2009-2025 Movatter.jp