<img width=300 src="./logo.svg" alt="VHS Logo consisting of a VHS tape, the Video.js logo and the words VHS" />
# videojs-http-streaming (VHS)
[![Build Status][travis-icon]][travis-link]
[![Slack Status][slack-icon]][slack-link]
[![Greenkeeper badge][greenkeeper-icon]][greenkeeper-link]
Play HLS, DASH, and future HTTP streaming protocols with video.js, even where they're not
natively supported.
Included in video.js 7 by default! See the [video.js 7 blog post](https://blog.videojs.com/video-js-7-is-here/)
Maintenance Status: Stable
Video.js Compatibility: 6.0, 7.0
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [Installation](#installation)
- [NPM](#npm)
- [CDN](#cdn)
- [Releases](#releases)
- [Manual Build](#manual-build)
- [Contributing](#contributing)
- [Troubleshooting](#troubleshooting)
- [Talk to us](#talk-to-us)
- [Getting Started](#getting-started)
- [Compatibility](#compatibility)
- [Via MSE](#via-mse)
- [Native only](#native-only)
- [Flash Support](#flash-support)
- [DRM](#drm)
- [Documentation](#documentation)
- [Options](#options)
- [How to use](#how-to-use)
- [Initialization](#initialization)
- [Source](#source)
- [List](#list)
- [withCredentials](#withcredentials)
- [handleManifestRedirects](#handlemanifestredirects)
- [useCueTags](#usecuetags)
- [overrideNative](#overridenative)
- [blacklistDuration](#blacklistduration)
- [bandwidth](#bandwidth)
- [useBandwidthFromLocalStorage](#usebandwidthfromlocalstorage)
- [enableLowInitialPlaylist](#enablelowinitialplaylist)
- [limitRenditionByPlayerDimensions](#limitrenditionbyplayerdimensions)
- [smoothQualityChange](#smoothqualitychange)
- [allowSeeksWithinUnsafeLiveWindow](#allowseekswithinunsafelivewindow)
- [customTagParsers](#customtagparsers)
- [customTagMappers](#customtagmappers)
- [cacheEncryptionKeys](#cacheencryptionkeys)
- [Runtime Properties](#runtime-properties)
- [hls.playlists.master](#hlsplaylistsmaster)
- [hls.playlists.media](#hlsplaylistsmedia)
- [hls.systemBandwidth](#hlssystembandwidth)
- [hls.bandwidth](#hlsbandwidth)
- [hls.throughput](#hlsthroughput)
- [hls.selectPlaylist](#hlsselectplaylist)
- [hls.representations](#hlsrepresentations)
- [hls.xhr](#hlsxhr)
- [hls.stats](#hlsstats)
- [Events](#events)
- [loadedmetadata](#loadedmetadata)
- [HLS Usage Events](#hls-usage-events)
- [Presence Stats](#presence-stats)
- [Use Stats](#use-stats)
- [In-Band Metadata](#in-band-metadata)
- [Segment Metadata](#segment-metadata)
- [Hosting Considerations](#hosting-considerations)
- [Known Issues](#known-issues)
- [Fragmented MP4 Support](#fragmented-mp4-support)
- [Testing](#testing)
- [Debugging](#debugging)
- [Release History](#release-history)
- [Building](#building)
- [Development](#development)
- [Tools](#tools)
- [Commands](#commands)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Installation
### NPM
To install `videojs-http-streaming` with npm run
```bash
npm install --save @videojs/http-streaming
```
### CDN
Select a version of VHS from the [CDN](https://unpkg.com/@videojs/http-streaming/dist/)
### Releases
Download a release of [videojs-http-streaming](https://github.com/videojs/http-streaming/releases)
### Manual Build
Download a copy of this git repository and then follow the steps in [Building](#building)
## Contributing
See [CONTRIBUTING.md](/CONTRIBUTING.md)
## Troubleshooting
See [our troubleshooting guide](/docs/troubleshooting.md)
## Talk to us
Drop by our slack channel (#playback) on the [Video.js slack][slack-link].
## Getting Started
This library is included in video.js 7 by default, if you are using an older version of video.js then
get a copy of [videojs-http-streaming](#installation) and include it in your page along with video.js:
```html
<video-js id=vid1 width=600 height=300 class="vjs-default-skin" controls>
<source
src="https://example.com/index.m3u8"
type="application/x-mpegURL">
</video-js>
<script src="video.js"></script>
<script src="videojs-http-streaming.min.js"></script>
<script>
var player = videojs('vid1');
player.play();
</script>
```
Check out our [live example](https://jsbin.com/gejugat/edit?html,output) if you're having trouble.
Is it recommended to use the `<video-js>` element or load a source with `player.src(sourceObject)` in order to prevent the video element from playing the source natively where HLS is supported.
## Compatibility
### Via MSE
- Chrome
- Firefox
- Internet Explorer 11 Windows 10 or 8.1
Using the [overrideNative](#overridenative) option
- Chrome Android
- Edge
### Native only
- Mac Safari
- iOS Safari
### Flash Support
This plugin does not support Flash playback. Instead, it is recommended that users use the [videojs-flashls-source-handler](https://github.com/brightcove/videojs-flashls-source-handler) plugin as a fallback option for browsers that don't have a native
[HLS](https://caniuse.com/#feat=http-live-streaming)/[DASH](https://caniuse.com/#feat=mpeg-dash) player or support for [Media Source Extensions](http://caniuse.com/#feat=mediasource).
### DRM
DRM is supported through [videojs-contrib-eme](https://github.com/videojs/videojs-contrib-eme). In order to use DRM, include the videojs-contrib-eme plug, [initialize it](https://github.com/videojs/videojs-contrib-eme#initialization), and add options to either the [plugin](https://github.com/videojs/videojs-contrib-eme#plugin-options) or the [source](https://github.com/videojs/videojs-contrib-eme#source-options).
Detailed option information can be found in the [videojs-contrib-eme README](https://github.com/videojs/videojs-contrib-eme/blob/master/README.md).
## Documentation
[HTTP Live Streaming](https://developer.apple.com/streaming/) (HLS) has
become a de-facto standard for streaming video on mobile devices
thanks to its native support on iOS and Android. There are a number of
reasons independent of platform to recommend the format, though:
- Supports (client-driven) adaptive bitrate selection
- Delivered over standard HTTP ports
- Simple, text-based manifest format
- No proprietary streaming servers required
Unfortunately, all the major desktop browsers except for Safari are
missing HLS support. That leaves web developers in the unfortunate
position of having to maintain alternate renditions of the same video
and potentially having to forego HTML-based video entirely to provide
the best desktop viewing experience.
This project addresses that situation by providing a polyfill for HLS
on browsers that have support for [Media Source
Extensions](http://caniuse.com/#feat=mediasource).
You can deploy a single HLS stream, code against the
regular HTML5 video APIs, and create a fast, high-quality video
experience across all the big web device categories.
Check out the [full documentation](docs/README.md) for details on how HLS works
and advanced configuration. A description of the [adaptive switching
behavior](docs/bitrate-switching.md) is available, too.
videojs-http-streaming supports a bunch of HLS features. Here
are some highlights:
- video-on-demand and live playback modes
- backup or redundant streams
- mid-segment quality switching
- AES-128 segment encryption
- CEA-608 captions are automatically translated into standard HTML5
[caption text tracks][0]
- In-Manifest WebVTT subtitles are automatically translated into standard HTML5
subtitle tracks
- Timed ID3 Metadata is automatically translated into HTML5 metedata
text tracks
- Highly customizable adaptive bitrate selection
- Automatic bandwidth tracking
- Cross-domain credentials support with CORS
- Tight integration with video.js and a philosophy of exposing as much
大叔_爱编程
- 粉丝: 6005
- 资源: 3568
最新资源
- SATI3.2.zip:专业的文本分析工具
- 基于Netty 实现的 MQTT 协议移动即时通讯系统,包含服务端和客户端详细文档+全部资料.zip
- 基于netty+mqtt3.1.1+springboot+jdk8 实现的 mqtt 服务端跟客户端详细文档+全部资料.zip
- 基于netty,Reactor3的大型响应式分布式智能家电管理系统,主要技术包括: Reactor3,netty,SpringCloud,nacos,Elast
- 基于Netty+MQTT的高性能推送服务框架。支持普通Socket、MQTT、MQTT web socket协议。非常方便接入上层业务实现推送业务。详细文档+全部资料.zip
- 基于netty的UDP物联网网关程序,设备报文可转发至KAFKA或MQTT broker详细文档+全部资料.zip
- 基于netty实现mqtt协议 服务器端开发详细文档+全部资料.zip
- 基于Netty和MQTT协议的IM组件详细文档+全部资料.zip
- 基于netty实现的mqtt客户端,可用于Java、Android环境详细文档+全部资料.zip
- 基于Netty实现的MQTT客户端详细文档+全部资料.zip
- 基于RHSocketKit框架实现的MQTT协议,底层使用CocoaAsyncSocket。详细文档+全部资料.zip
- 基于QT的MQTT-client客户端详细文档+全部资料.zip
- 基于spring boot的mqtt例子,使用注解将不同的主题分派给不同的任务。支持+、#通配符详细文档+全部资料.zip
- 基于springboot-mqtt的温度、湿度、六氟化硫浓度实时监控系统详细文档+全部资料.zip
- 基于STM32+ESP8266实现MQTT客户端协议,可以远程控制开发板上的LED灯详细文档+全部资料.zip
- 基于swoole4实现的mqtt代理服务器详细文档+全部资料.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈