翻译自用,欢迎纠错、补充

原文:https://github.com/bilibili/flv.js/blob/master/docs/api.md

主要方法: flvjs.createPlayer()

function createPlayer(mediaDataSource: MediaDataSource, config?: Config): Player;

* 带?号符号的是非必选项

MediaDataSource

Field

Type Description 中文
type string Indicates media type, 'flv' or 'mp4' 类型
isLive? boolean Indicates whether the data source is a live stream 是否直播
cors? boolean Indicates whether to enable CORS for http fetching 跨域
withCredentials? boolean Indicates whether to do http fetching with cookies 是否携带COOKIES
hasAudio? boolean Indicates whether the stream has audio track 开启声音
hasVideo? boolean Indicates whether the stream has video track 开启图像
duration? number Indicates total media duration, in milliseconds 媒体时间总长度,毫秒
filesize? number Indicates total file size of media file, in bytes 文件大小
url? string Indicates media URL, can be starts with 'https(s)' or 'ws(s)' (WebSocket) 媒体网络地址
segments? Array<MediaSegment> Optional field for multipart playback, see MediaSegment 媒体列表

如果segments参数存在, 则将播放器列为多源媒体播放。

如果是多源媒体播放,则durationfilesizeurl 这三个参数将被忽略。

MediaSegment

Field Type Description 中文
duration number Required field, indicates segment duration in milliseconds 媒体时间总长度,毫秒
filesize? number Optional field, indicates segment file size in bytes 文件大小
url string

Required field, indicates segment file URL

媒体网络地址

Config

Field Type Default Description 中文
enableWorker? boolean false Enable separated thread for transmuxing (unstable for now) 多线程工作?
enableStashBuffer? boolean true Enable IO stash buffer. Set to false if you need realtime (minimal latency) for live stream playback, but may stalled if there's network jittering. 启用缓存
stashInitialSize? number 384KB Indicates IO stash buffer initial size. Default is 384KB. Indicate a suitable size can improve video load/seek time. 缓存大小
isLive? boolean false Same to isLive in MediaDataSource, ignored if has been set in MediaDataSource structure. 是否直播,会覆盖上面的配置
lazyLoad? boolean true Abort the http connection if there's enough data for playback. 懒加载,如果缓存到足够的秒数,则停止下载
lazyLoadMaxDuration? number 3 * 60 Indicates how many seconds of data to be kept for lazyLoad. 懒加载最多的秒数
lazyLoadRecoverDuration? number 30 Indicates the lazyLoad recover time boundary in seconds. 缓存剩余秒数时继续下载
deferLoadAfterSourceOpen? boolean true Do load after MediaSource sourceopen event triggered. On Chrome, tabs which be opened in background may not trigger sourceopen event until switched to that tab.  
autoCleanupSourceBuffer boolean false Do auto cleanup for SourceBuffer 自动清理缓存
autoCleanupMaxBackwardDuration number 3 * 60 When backward buffer duration exceeded this value (in seconds), do auto cleanup for SourceBuffer  
autoCleanupMinBackwardDuration number 2 * 60 Indicates the duration in seconds to reserve for backward buffer when doing auto cleanup.  
fixAudioTimestampGap boolean true Fill silent audio frames to avoid a/v unsync when detect large audio timestamp gap. 填补无音频帧
accurateSeek? boolean false Accurate seek to any frame, not limited to video IDR frame, but may a bit slower. Available on Chrome > 50FireFox and Safari. 精确寻帧到任何帧,不局限于视频IDR帧,但可能会慢一点。可在Chrome >火狐和Safari浏览器。
seekType? string 'range' 'range' use range request to seek, or 'param' add params into url to indicate request range.  
seekParamStart? string 'bstart' Indicates seek start parameter name for seekType = 'param'  
seekParamEnd? string 'bend' Indicates seek end parameter name for seekType = 'param'  
rangeLoadZeroStart? boolean false Send Range: bytes=0- for first time load if use Range seek 发送范围:Range: bytes=0- 如果使用范围查找第一次加载
customSeekHandler? object undefined Indicates a custom seek handler 指示自定义查找处理程序
reuseRedirectedURL? boolean false Reuse 301/302 redirected url for subsequence request like seek, reconnect, etc. 重用301/302重定向url,用于随后的请求,如查找、重新连接等。
referrerPolicy? string no-referrer-when-downgrade Indicates the Referrer Policy when using FetchStreamLoader 指示使用FetchStreamLoader时的引用方策略
headers? object undefined Indicates additional headers that will be added to request 添加请求头

method:

    constructor(mediaDataSource: MediaDataSource, config?: Config): Player;destroy(): void;on(event: string, listener: Function): void;off(event: string, listener: Function): void;attachMediaElement(mediaElement: HTMLMediaElement): void;detachMediaElement(): void;load(): void;unload(): void;play(): Promise<void>;pause(): void;type: string;buffered: TimeRanges;duration: number;volume: number;muted: boolean;currentTime: number;mediaInfo: Object;statisticsInfo: Object;

官方找不到方法的说明。。

自己看的,请大家指错。

flvjs api 中文相关推荐

  1. imagick API 中文说明

    下面是 imagick API 中文说明 : imagick 类 imagick::adaptiveblurimage 向图像中添加 adaptive 模糊滤镜 imagick::adaptivere ...

  2. Android API 中文 (51) —— ZoomButtonsController

    一.结构 public class ZoomButtonsController extends View implements View.OnTouchListener java.lang.Objec ...

  3. MetaWeblog API中文说明

    MetaWeblog API中文说明MetaWeblog API中文说明MetaWeblog API中文说明MetaWeblog API中文说明MetaWeblog API中文说明MetaWeblog ...

  4. Java Servlet API中文说明文档

    Java Servlet API中文说明文档 目 录 1.... Servet资料 1.1      绪言 1.2      谁需要读这份文档 1.3      Java Servlet API的组成 ...

  5. Android API 中文(77)——AdapterView.OnItemSelectedListener

    前言 本章内容是android.widget.AdapterView.OnItemSelectedListener,版本为Android 2.3 r1,翻译来自"cnmahj",欢 ...

  6. 中文手册_Etherscan API中文手册

    Etherscan API中文手册由汇智网翻译整理,访问地址: http://cw.hubwiz.com/card/c/etherscan-api/ Etherscan API Etherscan以太 ...

  7. Android API 中文(13) —— ToggleButton

    原文地址为: Android API 中文(13) -- ToggleButton 前言 关键字: Android API 中文,Android 中文 API,android sdk 中文 本章翻译的 ...

  8. UG 二次开发中文帮助文档,UFun在线帮助文档, NX API 中文帮助文档

    UG 二次开发中文帮助文档,UFun在线帮助文档, NX API 中文帮助文档 在线的中文帮助文档,不用下载,网页直接查询函数: UFun函数中文帮助文档地址:http://www.ugapi.com ...

  9. JMF API 中文指导

     JMF API 中文指导(1) JavaTM Media Framework API Guide    NO.2 High-Level Architecture Time Model Manager ...

最新文章

  1. Win10 + QT5.14.2 + Opencv4.1.1 编译环境搭建
  2. 关于解决mybase7继续使用的方法
  3. css表单发光,表单input选中后发光CSS怎么写
  4. 【算法微解读】浅谈线段树
  5. 各hadoop安装的收集
  6. Fastreport.Net用户手册:报表对象
  7. python动画精灵_Python游戏开发:pygame中的Sprite(精灵)模块和加载动画
  8. CAN总线基础知识(二)
  9. 【Android】笔记
  10. [堆] Jzoj P5861 失意
  11. Cocos2d-x 设置竖屏的方法 2.0以上版本
  12. paip.提升用户体验-----找回密码的设
  13. python网络编程基础--http
  14. python数据处理太慢_使用Python将数据写入LMDB非常慢
  15. 机房收费系统---数据库设计说明书
  16. 这10个超厉害的工具堪称神器,却很少人知道!
  17. 大反转!温莎大师实战大健康,不一样的趋势,架构讲解
  18. 用Shell脚本实现自动从NewSmth.net的MyPhoto版下载照片
  19. AAA企业信用等级证书
  20. 不用计算机怎么连接无线,电脑不用网线怎么连接无线网 不用无线网卡连接WiFi教程...

热门文章

  1. 将txt格式的模型转换为bin格式
  2. 响应式编程实现技术概述
  3. 【无人机】基于PSO-PA和Q-learning机器学习的无人驾驶飞行器 (UAV) 模拟器研究(matlab代码实现)
  4. UI设计师要求高吗?需要掌握什么技能?
  5. 对“熵”一知半解?带你揭开“熵”的神秘面纱
  6. stata面板数据单位根检验llc_在对面板数据进行回归之前是否需要进行单位根检验和协整检验?...
  7. 手把手教大家快速构建自动回复机器人
  8. caller和callee的区别
  9. windows 操作手册
  10. 欧盟推出新数字法案,会是一场“锄强扶弱”的数字监管变革吗?