@acorbeau/react-video-seek-slider 中文文档教程

发布于 3年前 浏览 21 项目主页 更新于 3年前

@zeklouis/react-video-seek-slider forked from @yay2008

视频搜索滑块

NPMJavaScript Style Guide

1. Description

本项目使用的是:React Typescript

打包工具是: rollup

2. Installation

npm install --save @zeklouis/react-video-seek-slider

or

yarn add @zeklouis/react-video-seek-slider

3. API

ParameterDescriptionTypeDefault
fullTimeTotal timenumber
currentTimeCurrent timenumber
onChangeChange callback(time: number, offsetTime: number) => void
offsetOffsetnumber0
bufferProgress?buffernumber
hideHoverTime?Whether to enable hover display time functionboolenfalse
secondsPrefix?Second displaystring"00:"
minutesPrefix?Points displaystring"00:"
limitTimeTooltipBySides?Where to insert the three-way buttonboolean
sliderColor?Progress bar colorstring
sliderHoverColor?The color of the progress bar displayed by hoverstring
thumbColor?thumb colorstring
bufferColor?buffer colorstring

4. Usage overview

import * as React from "react";
import ToolBox from "@netless/react-tool-box";

export default class ToolBoxExample extends React.Component<{}, {}> 
  render () {
    return (
      <SeekSlider
         fullTime={player.timeDuration}
         currentTime={this.getCurrentTime(this.state.currentTime)}
         onChange={(time: number, offsetTime: number) => {
             if (this.state.player) {
                 this.setState({currentTime: time});
                this.state.player.seekToScheduleTime(time);
             }
         }}
         hideHoverTime={true}
         limitTimeTooltipBySides={true}
        />
    )
  }
}

5. Start the project

  1. 获取源码

    git clone https://github.com/zeklouis/react-video-seek-slider.git
    
  2. 进入项目并安装库文件依赖

    cd react-video-seek-slider
    yarn
    
  3. 启动库文件项目

        yarn start
    
  4. 并安装到项目examplefile dependencies

        cd example
        yarn
    
  5. 启动exampleproject

        yarn start
    

6. Project screenshot

slider

License

麻省理工学院 © zeklouis

@zeklouis/react-video-seek-slider forked from @yay2008

a video seek slider

NPMJavaScript Style Guide

1. Description

This project is using:React Typescript

Packaging tools are: rollup

2. Installation

npm install --save @zeklouis/react-video-seek-slider

or

yarn add @zeklouis/react-video-seek-slider

3. API

ParameterDescriptionTypeDefault
fullTimeTotal timenumber
currentTimeCurrent timenumber
onChangeChange callback(time: number, offsetTime: number) => void
offsetOffsetnumber0
bufferProgress?buffernumber
hideHoverTime?Whether to enable hover display time functionboolenfalse
secondsPrefix?Second displaystring"00:"
minutesPrefix?Points displaystring"00:"
limitTimeTooltipBySides?Where to insert the three-way buttonboolean
sliderColor?Progress bar colorstring
sliderHoverColor?The color of the progress bar displayed by hoverstring
thumbColor?thumb colorstring
bufferColor?buffer colorstring

4. Usage overview

import * as React from "react";
import ToolBox from "@netless/react-tool-box";

export default class ToolBoxExample extends React.Component<{}, {}> 
  render () {
    return (
      <SeekSlider
         fullTime={player.timeDuration}
         currentTime={this.getCurrentTime(this.state.currentTime)}
         onChange={(time: number, offsetTime: number) => {
             if (this.state.player) {
                 this.setState({currentTime: time});
                this.state.player.seekToScheduleTime(time);
             }
         }}
         hideHoverTime={true}
         limitTimeTooltipBySides={true}
        />
    )
  }
}

5. Start the project

  1. Get the source code

    git clone https://github.com/zeklouis/react-video-seek-slider.git
    
  2. Enter the project and install library file dependencies

    cd react-video-seek-slider
    yarn
    
  3. Start library file project

        yarn start
    
  4. And installed into the project examplefile dependencies

        cd example
        yarn
    
  5. Start exampleproject

        yarn start
    

6. Project screenshot

slider

License

MIT © zeklouis

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文