Détail du package

@videojs/http-streaming

videojs2.4mApache-2.03.15.0

Play back HLS and DASH with Video.js, even where it's not natively supported

videojs, videojs-plugin

readme

VHS Logo consisting of a VHS tape, the Video.js logo and the words VHS

videojs-http-streaming (VHS)

Build Status Slack Status Greenkeeper badge

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

Maintenance Status: Stable

Video.js Compatibility: 7.x, 8.x

Installation

In most cases it is not necessary to separately install http-streaming, as it has been included in the default build of Video.js since version 7.

Only install if you need a specifc combination of video.js and http-streaming versions. If installing separately, use the "core" version of Video.js without the bundled version of http-streaming.

NPM

To install videojs-http-streaming with npm, run

npm install --save @videojs/http-streaming

CDN

Select a version of VHS from the CDN

Releases

Download a release of videojs-http-streaming

Manual Build

Download a copy of this git repository and then follow the steps in Building

Contributing

See CONTRIBUTING.md

Troubleshooting

See our troubleshooting guide

Talk to us

Drop by the Video.js slack.

Getting Started

This library is included in Video.js 7 by default.

Only if need a specific combination of versions of Video.js and VHS you can get a copy of videojs-http-streaming and include it in your page along with video.js. In this case, you should use the "core" build of Video.js, without a bundled VHS:

<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>
<!-- "core" version of Video.js -->
<script src="video.core.min.js"></script>
<script src="videojs-http-streaming.min.js"></script>
<script>
var player = videojs('vid1');
player.play();
</script>

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

The Media Source Extensions API is required for http-streaming to play HLS or MPEG-DASH.

Browsers which support MSE

  • Chrome
  • Firefox
  • Internet Explorer 11 Windows 10 or 8.1

These browsers have some level of native HLS support, however by default the overrideNative option is set to true except on Safari, so MSE playback is used:

  • Chrome Android
  • Firefox Android
  • Edge

Native only

  • Mac Safari
  • iOS Safari

Mac and iPad Safari do have MSE support, but native HLS is recommended

DRM

DRM is supported through videojs-contrib-eme. In order to use DRM, include the videojs-contrib-eme plug, initialize it, and add options to either the plugin or the source.

Detailed option information can be found in the videojs-contrib-eme README.

Documentation

HTTP Live 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. 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 for details on how HLS works and advanced configuration. A description of the adaptive switching behavior 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
  • 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 as possible with standard HTML APIs
  • Stream with multiple audio tracks and switching to those audio tracks (see the docs folder) for info
  • Media content in fragmented MP4s instead of the MPEG2-TS container format.

For a more complete list of supported and missing features, refer to this doc.

Options

How to use

Initialization

You may pass in an options object to the hls source handler at player initialization. You can pass in options just like you would for other parts of video.js:

// html5 for html hls
videojs(video, {
  html5: {
    vhs: {
      withCredentials: true
    }
  }
});
Source

Some options, such as withCredentials can be passed in to vhs during player.src


var player = videojs('some-video-id');

player.src({
  src: 'https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8',
  type: 'application/x-mpegURL',
  withCredentials: true
});

List

withCredentials
  • Type: boolean
  • can be used as a source option
  • can be used as an initialization option

When the withCredentials property is set to true, all XHR requests for manifests and segments would have withCredentials set to true as well. This enables storing and passing cookies from the server that the manifests and segments live on. This has some implications on CORS because when set, the Access-Control-Allow-Origin header cannot be set to *, also, the response headers require the addition of Access-Control-Allow-Credentials header which is set to true. See html5rocks's article for more info.

useCueTags
  • Type: boolean
  • can be used as an initialization option

When the useCueTags property is set to true, a text track is created with label 'ad-cues' and kind 'metadata'. The track is then added to player.textTracks(). Changes in active cue may be tracked by following the Video.js cue points API for text tracks. For example:

let textTracks = player.textTracks();
let cuesTrack;

for (let i = 0; i < textTracks.length; i++) {
  if (textTracks[i].label === 'ad-cues') {
    cuesTrack = textTracks[i];
  }
}

cuesTrack.addEventListener('cuechange', function() {
  let activeCues = cuesTrack.activeCues;

  for (let i = 0; i < activeCues.length; i++) {
    let activeCue = activeCues[i];

    console.log('Cue runs from ' + activeCue.startTime +
                ' to ' + activeCue.endTime);
  }
});
parse708captions
  • Type: boolean
  • Default: true
  • can be used as an initialization option

When set to false, 708 captions in the stream are not parsed and will not show up in text track lists or the captions menu.

overrideNative
  • Type: boolean
  • can be used as an initialization option

Try to use videojs-http-streaming even on platforms that provide some level of HLS support natively. There are a number of platforms that technically play back HLS content but aren't very reliable or are missing features like CEA-608 captions support. When overrideNative is true, if the platform supports Media Source Extensions videojs-http-streaming will take over HLS playback to provide a more consistent experience.

// via the constructor
var player = videojs('playerId', {
  html5: {
    vhs: {
      overrideNative: true
    },
    nativeAudioTracks: false,
    nativeVideoTracks: false
  }
});

Since MSE playback may be desirable on all browsers with some native support other than Safari, overrideNative: !videojs.browser.IS_SAFARI could be used.

experimentalUseMMS
  • Type: boolean
  • can be used as an initialization option

Use ManagedMediaSource when available. If both ManagedMediaSource and MediaSource are present, ManagedMediaSource would be used. This will only be effective if ovrerideNative is true, because currently the only browsers that implement ManagedMediaSource also have native support. Safari on iPhone 17.1 has ManagedMediaSource, as does Safari 17 on desktop and iPad.

Currently, using this option will disable AirPlay.

playlistExclusionDuration
  • Type: number
  • can be used as an initialization option

When the playlistExclusionDuration property is set to a time duration in seconds, if a playlist is excluded, it will be excluded for a period of that customized duration. This enables the exclusion duration to be configured by the user.

maxPlaylistRetries
  • Type: number
  • Default: Infinity
  • can be used as an initialization option

The max number of times that a playlist will retry loading following an error before being indefinitely excluded from the rendition selection algorithm. Note: the number of retry attempts needs to exceed this value before a playlist will be excluded.

bandwidth
  • Type: number
  • can be used as an initialization option

When the bandwidth property is set (bits per second), it will be used in the calculation for initial playlist selection, before more bandwidth information is seen by the player.

useBandwidthFromLocalStorage
  • Type: boolean
  • can be used as an initialization option

If true, bandwidth and throughput values are stored in and retrieved from local storage on startup (for initial rendition selection). This setting is false by default.

enableLowInitialPlaylist
  • Type: boolean
  • can be used as an initialization option

When enableLowInitialPlaylist is set to true, it will be used to select the lowest bitrate playlist initially. This helps to decrease playback start time. This setting is false by default.

limitRenditionByPlayerDimensions
  • Type: boolean
  • can be used as an initialization option

When limitRenditionByPlayerDimensions is set to true, rendition selection logic will take into account the player size and rendition resolutions when making a decision. This setting is true by default.

useDevicePixelRatio
  • Type: boolean
  • can be used as an initialization option.

If true, this will take the device pixel ratio into account when doing rendition switching. This means that if you have a player with the width of 540px in a high density display with a device pixel ratio of 2, a rendition of 1080p will be allowed. This setting is false by default.

customPixelRatio
  • Type: number
  • can be used as an initialization option.

If set, this will take the initial player dimensions and multiply it by a custom ratio when the player automatically selects renditions. This means that if you have a player where the dimension is 540p, with a custom pixel ratio of 2, a rendition of 1080p or a lower rendition closest to this value will be chosen. Additionally, if you have a player where the dimension is 540p, with a custom pixel ratio of 0.5, a rendition of 270p or a lower rendition closest to this value will be chosen. When the custom pixel ratio is 0, the lowest available rendition will be selected.

It is worth noting that if the player dimension multiplied by the custom pixel ratio is greater than any available rendition resolution, a rendition will be selected based on bandwidth, and the player dimension will be disregarded.

limitRenditionByPlayerDimensions must be true in order for this feature to be enabled. This is the default value.

If useDevicePixelRatio is set to true, the custom pixel ratio will be prioritized and overwrite any previous pixel ratio.

allowSeeksWithinUnsafeLiveWindow
  • Type: boolean
  • can be used as a source option

When allowSeeksWithinUnsafeLiveWindow is set to true, if the active playlist is live and a seek is made to a time between the safe live point (end of manifest minus three times the target duration, see the hls spec for details) and the end of the playlist, the seek is allowed, rather than corrected to the safe live point.

This option can help in instances where the live stream's target duration is greater than the segment durations, playback ends up in the unsafe live window, and there are gaps in the content. In this case the player will attempt to seek past the gaps but end up seeking inside of the unsafe range, leading to a correction and seek back into a previously played content.

The property defaults to false.

customTagParsers
  • Type: Array
  • can be used as a source option

With customTagParsers you can pass an array of custom m3u8 tag parser objects. See https://github.com/videojs/m3u8-parser#custom-parsers

customTagMappers
  • Type: Array
  • can be used as a source option

Similar to customTagParsers, with customTagMappers you can pass an array of custom m3u8 tag mapper objects. See https://github.com/videojs/m3u8-parser#custom-parsers

cacheEncryptionKeys
  • Type: boolean
  • can be used as a source option
  • can be used as an initialization option

This option forces the player to cache AES-128 encryption keys internally instead of requesting the key alongside every segment request. This option defaults to false.

handlePartialData
  • Type: boolean,
  • Default: false
  • Use partial appends in the transmuxer and segment loader
liveRangeSafeTimeDelta
  • Type: number,
  • Default: SAFE_TIME_DELTA
  • Allow to re-define length (in seconds) of time delta when you compare current time and the end of the buffered range.
useNetworkInformationApi
  • Type: boolean,
  • Default: false
  • Use window.networkInformation.downlink to estimate the network's bandwidth. Per mdn, The value is never greater than 10 Mbps, as a non-standard anti-fingerprinting measure. Given this, if bandwidth estimates from both the player and networkInfo are >= 10 Mbps, the player will use the larger of the two values as its bandwidth estimate.
useDtsForTimestampOffset
  • Type: boolean,
  • Default: false
  • Use Decode Timestamp instead of Presentation Timestamp for timestampOffset calculation. This option was introduced to align with DTS-based browsers. This option affects only transmuxed data (eg: transport stream). For more info please check the following issue.
useForcedSubtitles
  • Type: boolean
  • Default: false
  • can be used as a source option
  • can be used as an initialization option

If true, this option allows the player to display forced subtitles. When available, forced subtitles allow to translate foreign language dialogues or images containing foreign language characters.

captionServices
  • Type: object
  • Default: undefined
  • Provide extra information, like a label or a language, for instream (608 and 708) captions.

The captionServices options object has properties that map to the caption services. Each property is an object itself that includes several properties, like a label or language.

For 608 captions, the service names are CC1, CC2, CC3, and CC4. For 708 captions, the service names are SERVICEn where n is a digit between 1 and 63.

For 708 caption services, you may additionally provide an encoding value that will be used by the transmuxer to decode the captions using an instance of TextDecoder. This is to permit and is required for legacy multi-byte encodings. Please review the TextDecoder documentation for accepted encoding labels.

Format
{
  vhs: {
    captionServices: {
      [serviceName]: {
        language: String, // optional
        label: String, // optional
        default: boolean, // optional,
        encoding: String // optional, 708 services only
      }
    }
  }
}
Example
{
  vhs: {
    captionServices: {
      CC1: {
        language: 'en',
        label: 'English'
      },
      SERVICE1: {
        langauge: 'kr',
        label: 'Korean',
        encoding: 'euc-kr'
        default: true,
      }
    }
  }
}

Runtime Properties

Runtime properties are attached to the tech object when HLS is in use. You can get a reference to the VHS source handler like this:

var vhs = player.tech().vhs;

If you were thinking about modifying runtime properties in a video.js plugin, we'd recommend you avoid it. Your plugin won't work with videos that don't use videojs-http-streaming and the best plugins work across all the media types that video.js supports. If you're deploying videojs-http-streaming on your own website and want to make a couple tweaks though, go for it!

vhs.playlists.main

Type: object

An object representing the parsed main playlist. If a media playlist is loaded directly, a main playlist with only one entry will be created.

vhs.playlists.media

Type: function

A function that can be used to retrieve or modify the currently active media playlist. The active media playlist is referred to when additional video data needs to be downloaded. Calling this function with no arguments returns the parsed playlist object for the active media playlist. Calling this function with a playlist object from the main playlist or a URI string as specified in the main playlist will kick off an asynchronous load of the specified media playlist. Once it has been retreived, it will become the active media playlist.

vhs.systemBandwidth

Type: number

systemBandwidth is a combination of two serial processes' bitrates. The first is the network bitrate provided by bandwidth and the second is the bitrate of the entire process after that (decryption, transmuxing, and appending) provided by throughput. This value is used by the default implementation of selectPlaylist to select an appropriate bitrate to play.

Since the two process are serial, the overall system bandwidth is given by: systemBandwidth = 1 / (1 / bandwidth + 1 / throughput)

vhs.bandwidth

Type: number

The number of bits downloaded per second in the last segment download.

Before the first video segment has been downloaded, it's hard to estimate bandwidth accurately. The HLS tech uses a starting value of 4194304 or 0.5 MB/s. If you have a more accurate source of bandwidth information, you can override this value as soon as the HLS tech has loaded to provide an initial bandwidth estimate.

vhs.throughput

Type: number

The number of bits decrypted, transmuxed, and appended per second as a cumulative average across active processing time.

vhs.selectPlaylist

Type: function

A function that returns the media playlist object to use to download the next segment. It is invoked by the tech immediately before a new segment is downloaded. You can override this function to provide your adaptive streaming logic. You must, however, be sure to return a valid media playlist object that is present in player.tech().vhs.main.

Overridding this function with your own is very powerful but is overkill for many purposes. Most of the time, you should use the much simpler function below to selectively enable or disable a playlist from the adaptive streaming logic.

vhs.representations

Type: function

It is recommended to include the videojs-contrib-quality-levels plugin to your page so that videojs-http-streaming will automatically populate the QualityLevelList exposed on the player by the plugin. You can access this list by calling player.qualityLevels(). See the videojs-contrib-quality-levels project page for more information on how to use the api.

Example, only enabling representations with a width greater than or equal to 720:

var qualityLevels = player.qualityLevels();

for (var i = 0; i < qualityLevels.length; i++) {
  var quality = qualityLevels[i];
  if (quality.width >= 720) {
    quality.enabled = true;
  } else {
    quality.enabled = false;
  }
}

If including videojs-contrib-quality-levels is not an option, you can use the representations api. To get all of the available representations, call the representations() method on player.tech().vhs. This will return a list of plain objects, each with width, height, bandwidth, and id properties, and an enabled() method.

player.tech().vhs.representations();

To see whether the representation is enabled or disabled, call its enabled() method with no arguments. To set whether it is enabled/disabled, call its enabled() method and pass in a boolean value. Calling <representation>.enabled(true) will allow the adaptive bitrate algorithm to select the representation while calling <representation>.enabled(false) will disallow any selection of that representation.

Example, only enabling representations with a width greater than or equal to 720:

player.tech().vhs.representations().forEach(function(rep) {
  if (rep.width >= 720) {
    rep.enabled(true);
  } else {
    rep.enabled(false);
  }
});

vhs.xhr

Type: function

The xhr function that is used by VHS internally is exposed on the per- player vhs object. While it is possible, we do not recommend replacing the function with your own implementation. Instead, xhr provides the ability to specify onRequest and onResponse hooks which each take a callback function as a parameter, as well as offRequest and offResponse functions which can remove a callback function from the onRequest or onResponse Set. An xhr-hooks-ready event is fired from a player when per-player hooks are ready to be added or removed. This will ensure player specific hooks are set prior to any manifest or segment requests.

The onRequest(callback) function takes a callback function that will pass an xhr options Object to that callback. These callbacks are called synchronously, in the order registered and act as pre-request hooks for modifying the xhr options Object prior to making a request.

Note: This callback MUST return an options Object as the xhr wrapper and each onRequest hook receives the returned options as a parameter.

Example:

player.on('xhr-hooks-ready', () => {
  const playerRequestHook = (options) => {
    return {
      uri: 'https://new.options.uri'
    };
  };
  player.tech().vhs.xhr.onRequest(playerRequestHook);
});

If access to the xhr Object is required prior to the xhr.send call, an options.beforeSend callback can be set within an onRequest callback function that will pass the xhr Object as a parameter and will be called immediately prior to xhr.send.

Example:

player.on('xhr-hooks-ready', () => {
  const playerXhrRequestHook = (options) => {
    options.beforeSend = (xhr) => {
      xhr.setRequestHeader('foo', 'bar');
    };
    return options;
  };
  player.tech().vhs.xhr.onRequest(playerXhrRequestHook);
});

The onResponse(callback) function takes a callback function that will pass the xhr request, error, and response Objects to that callback. These callbacks are called in the order registered and act as post-request hooks for gathering data from the xhr request, error and response Objects. onResponse callbacks do not require a return value, the parameters are passed to each subsequent callback by reference.

Example:

player.on('xhr-hooks-ready', () => {
  const playerResponseHook = (request, error, response) => {
    const bar = response.headers.foo;
  };
  player.tech().vhs.xhr.onResponse(playerResponseHook);
});

The offRequest function takes a callback function, and will remove that function from the collection of onRequest hooks if it exists.

Example:

player.on('xhr-hooks-ready', () => {
  player.tech().vhs.xhr.offRequest(playerRequestHook);
});

The offResponse function takes a callback function, and will remove that function from the collection of offResponse hooks if it exists.

Example:

player.on('xhr-hooks-ready', () => {
  player.tech().vhs.xhr.offResponse(playerResponseHook);
});

The global videojs.Vhs also exposes an xhr property. Adding onRequest and/or onResponse hooks will allow you to intercept the request options and xhr Object as well as request, error, and response data for all requests in every player on a page. For consistency across browsers the video source should be set at runtime once the video player is ready.

Example:

// Global request callback, will affect every player.
const globalRequestHook = (options) => {
  return {
    uri: 'https://new.options.global.uri'
  };
};
videojs.Vhs.xhr.onRequest(globalRequestHook);
// Global request callback defining beforeSend function, will affect every player.
const globalXhrRequestHook = (options) => {
  options.beforeSend = (xhr) => {
    xhr.setRequestHeader('foo', 'bar');
  };
  return options;
};
videojs.Vhs.xhr.onRequest(globalXhrRequestHook);
// Global response hook callback, will affect every player.
const globalResponseHook = (request, error, response) => {
  const bar = response.headers.foo
};

videojs.Vhs.xhr.onResponse(globalResponseHook);
// Remove a global onRequest callback.
videojs.Vhs.xhr.offRequest(globalRequestHook);
// Remove a global onResponse callback.
videojs.Vhs.xhr.offResponse(globalResponseHook);

For information on the type of options that you can modify see the documentation at https://github.com/Raynos/xhr.

vhs.stats

Type: object

This object contains a summary of HLS and player related stats.

Property Name Type Description
bandwidth number Rate of the last segment download in bits/second
mediaRequests number Total number of media segment requests
mediaRequestsAborted number Total number of aborted media segment requests
mediaRequestsTimedout number Total number of timedout media segment requests
mediaRequestsErrored number Total number of errored media segment requests
mediaTransferDuration number Total time spent downloading media segments in milliseconds
mediaBytesTransferred number Total number of content bytes downloaded
mediaSecondsLoaded number Total number of content seconds downloaded
buffered array List of time ranges of content that are in the SourceBuffer
currentTime number The current position of the player
currentSource object The source object. Has the structure {src: 'url', type: 'mimetype'}
currentTech string The name of the tech in use
duration number Duration of the video in seconds
main object The main playlist object
playerDimensions object Contains the width and height of the player
seekable array List of time ranges that the player can seek to
timestamp number Timestamp of when vhs.stats was accessed
videoPlaybackQuality object Media playback quality metrics as specified by the W3C's Media Playback Quality API

Events

Standard HTML video events are handled by video.js automatically and are triggered on the player object.

loadedmetadata

Fired after the first segment is downloaded for a playlist. This will not happen until playback if video.js's metadata setting is none

xhr-hooks-ready

Fired when the player xhr object is ready to set onRequest and onResponse hooks, as well as remove hooks with offRequest and offResponse.

VHS Usage Events

Usage tracking events are fired when we detect a certain HLS feature, encoding setting, or API is used. These can be helpful for analytics, and to pinpoint the cause of HLS errors. For instance, if errors are being fired in tandem with a usage event indicating that the player was playing an AES encrypted stream, then we have a possible avenue to explore when debugging the error.

Note that although these usage events are listed below, they may change at any time without a major version change.

VHS usage events are triggered on the tech with the exception of the 3 vhs-reload-error events, which are triggered on the player.

To listen for usage events triggered on the tech, listen for the event type of 'usage':

player.on('ready', () => {
  player.tech().on('usage', (e) => {
    console.log(e.name);
  });
});

Note that these events are triggered as soon as a case is encountered, and often only once. For example, the vhs-demuxed usage event will be triggered as soon as the main manifest is downloaded and parsed, and will not be triggered again.

Presence Stats

Each of the following usage events are fired once per source if (and when) detected:

Name Description
vhs-webvtt main manifest has at least one segmented WebVTT playlist
vhs-aes a playlist is AES encrypted
vhs-fmp4 a playlist used fMP4 segments
vhs-demuxed audio and video are demuxed by default
vhs-alternate-audio alternate audio available in the main manifest
vhs-playlist-cue-tags a playlist used cue tags (see useCueTags(#usecuetags) for details)
vhs-bandwidth-from-local-storage starting bandwidth was retrieved from local storage (see useBandwidthFromLocalStorage(#useBandwidthFromLocalStorage) for details)
vhs-throughput-from-local-storage starting throughput was retrieved from local storage (see useBandwidthFromLocalStorage(#useBandwidthFromLocalStorage) for details)

Use Stats

Each of the following usage events are fired per use:

Name Description
vhs-gap-skip player skipped a gap in the buffer
vhs-player-access player.vhs was accessed
vhs-audio-change a user selected an alternate audio stream
vhs-rendition-disabled a rendition was disabled
vhs-rendition-enabled a rendition was enabled
vhs-rendition-excluded a rendition was excluded
vhs-timestamp-offset a timestamp offset was set in HLS (can identify discontinuities)
vhs-unknown-waiting the player stopped for an unknown reason and we seeked to current time try to address it
vhs-live-resync playback fell off the back of a live playlist and we resynced to the live point
vhs-video-underflow we seeked to current time to address video underflow
vhs-error-reload-initialized the reloadSourceOnError plugin was initialized
vhs-error-reload the reloadSourceOnError plugin reloaded a source
vhs-error-reload-canceled an error occurred too soon after the last reload, so we didn't reload again (to prevent error loops)

In-Band Metadata

The HLS tech supports timed metadata embedded as ID3 tags. When a stream is encountered with embedded metadata, an in-band metadata text track will automatically be created and populated with cues as they are encountered in the stream. UTF-8 encoded TXXX and WXXX ID3 frames are mapped to cue points and their values set as the cue text. Cues are created for all other frame types and the data is attached to the generated cue:

cue.value.data

There are lots of guides and references to using text tracks around the web.

Segment Metadata

You can get metadata about the segments currently in the buffer by using the segment-metadata text track. You can get the metadata of the currently rendered segment by looking at the track's activeCues array. The metadata will be attached to the cue.value property and will have this structure

cue.value = {
  byteLength, // The size of the segment in bytes
  bandwidth, // The peak bitrate reported by the segment's playlist
  resolution, // The resolution reported by the segment's playlist
  codecs, // The codecs reported by the segment's playlist
  uri, // The Segment uri
  timeline, // Timeline of the segment for detecting discontinuities
  playlist, // The Playlist uri
  start, // Segment start time
  end // Segment end time
};

Example: Detect when a change in quality is rendered on screen

let tracks = player.textTracks();
let segmentMetadataTrack;

for (let i = 0; i < tracks.length; i++) {
  if (tracks[i].label === 'segment-metadata') {
    segmentMetadataTrack = tracks[i];
  }
}

let previousPlaylist;

if (segmentMetadataTrack) {
  segmentMetadataTrack.on('cuechange', function() {
    let activeCue = segmentMetadataTrack.activeCues[0];

    if (activeCue) {
      if (previousPlaylist !== activeCue.value.playlist) {
        console.log('Switched from rendition ' + previousPlaylist +
                    ' to rendition ' + activeCue.value.playlist);
      }
      previousPlaylist = activeCue.value.playlist;
    }
  });
}

Object as Source

Note that this is an advanced use-case, and may be more fragile for production environments, as the schema for a VHS object and how it's used internally are not set in stone and may change in future releases.

In normal use, VHS accepts a URL as the source of the video. But VHS also has the ability to accept a JSON object as the source.

Passing a JSON object as the source has many uses. A couple of examples include:

  • The manifest has already been downloaded, so there's no need to make another request
  • You want to change some aspect of the manifest, e.g., add a segment, without modifying the manifest itself

In order to pass a JSON object as the source, provide a parsed manifest object in via a data URI, and using the "vnd.videojs.vhs+json" media type when setting the source type. For instance:

var player = videojs('some-video-id');
const parser = new M3u8Parser();

parser.push(manifestString);
parser.end();

player.src({
  src: `data:application/vnd.videojs.vhs+json,${JSON.stringify(parser.manifest)}`,
  type: 'application/vnd.videojs.vhs+json'
});

The manifest object should follow the "VHS manifest object schema" (a somewhat flexible and informally documented structure) provided in the README of m3u8-parser and mpd-parser. This may be referred to in the project as vhs-json.

Hosting Considerations

Unlike a native HLS implementation, the HLS tech has to comply with the browser's security policies. That means that all the files that make up the stream must be served from the same domain as the page hosting the video player or from a server that has appropriate CORS headers configured. Easy instructions are available for popular webservers and most CDNs should have no trouble turning CORS on for your account.

Known Issues and Workarounds

Issues that are currenty known. If you want to help find a solution that would be appreciated!

Fragmented MP4 Support

Edge has native support for HLS but only in the MPEG2-TS container. If you attempt to play an HLS stream with fragmented MP4 segments (without overriding native playback), Edge will stall. Fragmented MP4s are only supported on browsers that have Media Source Extensions available.

Assets with an Audio-Only Rate Get Stuck in Audio-Only

Some assets which have an audio-only rate and the lowest-bandwidth audio + video rate isn't that low get stuck in audio-only mode. This is because the initial bandwidth calculation thinks it there's insufficient bandwidth for selecting the lowest-quality audio+video playlist, so it picks the only-audio one, which unfortunately locks it to being audio-only forever, preventing a switch to the audio+video playlist when it gets a better estimation of bandwidth.

Until we've implemented a full fix, it is recommended to set the enableLowInitialPlaylist option for any assets that include an audio-only rate; it should always select the lowest-bandwidth audio+video playlist for its first playlist.

It's also worth mentioning that Apple no longer requires having an audio-only rate; instead, they require a 192kbps audio+video rate (see Apple's current HLS Authoring Specification). Removing the audio-only rate would of course eliminate this problem since there would be only audio+video playlists to choose from.

Follow progress on this in issue #175.

DASH Assets with $Time Interpolation and SegmentTimelines with No t

DASH assets which use $Time in a SegmentTemplate, and also have a SegmentTimeline where only the first S has a t and the rest only have a d, do not load currently.

There is currently no workaround for this, but you can track progress on this in issue #256.

Testing

For testing, you run npm run test. You will need Chrome and Firefox for running the tests.

videojs-http-streaming uses BrowserStack for compatibility testing.

Debugging

videojs-http-streaming makes use of videojs.log for debug logging. You can enable these logs by setting the log level to debug using videojs.log.level('debug'). You can access a complete history of the logs using videojs.log.history(). This history is maintained even when the log level is not set to debug.

vhs.stats can also be helpful when debugging. Accessing this object will give you a snapshot summary of various HLS and player stats. See vhs.stats for details about what this object contains.

NOTE: The debug level is only available in video.js v6.6.0+. With earlier versions of video.js, no debug messages will be logged to console.

Release History

Check out the changelog for a summary of each release.

Building

To build a copy of videojs-http-streaming run the following commands

git clone https://github.com/videojs/http-streaming
cd http-streaming
npm i
npm run build

videojs-http-streaming will have created all of the files for using it in a dist folder

Development

Tools

Commands

All commands for development are listed in the package.json file and are run using

npm run <command>

changelog

3.15.0 (2024-10-10)

Features

  • Add Airplay support when overriding native HLS in Safari/iOS (#1543) (bfc17b4)
  • Add support for ManagedMediaSource 'startstreaming' and 'endstream' event handling (#1542) (ae1ae70)

Chores

3.14.2 (2024-09-17)

Bug Fixes

3.14.1 (2024-09-09)

Bug Fixes

3.14.0 (2024-08-23)

Features

Bug Fixes

  • audio segment on incorrect timeline (#1530) (876ed8c)
  • bad timeline changes (#1526) (7c63f4e)
  • changeType on full codec change only (#1474) (4e51778)
  • enableFunction not passing playlist to fastQualityChange (#1502) (e50ecb1)
  • fastQualitySwitch stability (#1525) (28cb9fd)
  • fix repeated segments (#1489) (ed8f6bd)
  • llHLS does not need forcedTimestampOffset (#1501) (f5d1209)
  • remove extra abort call (#1528) (7ec606f)
  • requestId init tag (#1518) (a542ec8)
  • Resolve issue where live dash manifests without audio would hang (#1524) (1ecf115)
  • use paren media sequence sync for audio and vtt, since they are opt-in features and can be enabled after main init (#1505) (bdfe0e0)
  • videoTimestampOffset in sourceUpdater (#1519) (d6851cc)

Chores

Documentation

Reverts

  • "fix: fix repeated segments issue during bandwidth update (#1477)" (#1488) (75f7b1a)

3.13.3 (2024-08-12)

Bug Fixes

3.13.2 (2024-07-22)

Bug Fixes

Chores

3.13.1 (2024-06-12)

Bug Fixes

3.13.0 (2024-05-21)

Features

Chores

3.12.2 (2024-04-22)

Bug Fixes

  • use paren media sequence sync for audio and vtt, since they are opt-in features and can be enabled after main init (#1505) (bdfe0e0)

3.12.1 (2024-04-16)

Bug Fixes

  • enableFunction not passing playlist to fastQualityChange (#1502) (e50ecb1)
  • llHLS does not need forcedTimestampOffset (#1501) (f5d1209)

Documentation

3.12.0 (2024-03-12)

Features

Chores

3.11.3 (2024-02-28)

Bug Fixes

3.11.2 (2024-02-21)

Reverts

  • "fix: fix repeated segments issue during bandwidth update (#1477)" (#1488) (75f7b1a)

3.11.1 (2024-02-12)

Bug Fixes

Chores

3.11.0 (2024-01-25)

Features

Bug Fixes

  • fix repeated segments issue during bandwidth update (#1477) (823f072)

3.10.0 (2024-01-17)

Features

Bug Fixes

3.9.1 (2024-01-02)

Bug Fixes

  • Account for difference between duration info in the playlist and the actual duration (#1470) (455b020)
  • keyId filtering loadedplaylist listener and improvements (#1468) (f12c197)
  • select next if we are at the of the current segment (#1467) (7debc17)
  • toLowerCase keyIds from manifest and use fastQualityChange (#1466) (88a5671)

3.9.0 (2023-12-14)

Features

  • enable playlists with 'usable' keystatus (#1460) (7d7c639)

Chores

3.8.0 (2023-12-04)

Features

Bug Fixes

  • Always use VOD sync-point for VOD streams (#1456) (a5579b0)
  • check for transmuxer for vtt-segment-loader (#1452) (b4dd748)
  • content steering bug fixes and tests (#1430) (532aa4d)
  • Do not call load after mediachange for hls playlist loader (#1447) (28413f8)
  • fix several issues with calculate timestamp offset for each segment (#1451) (3bbc6ef)
  • prevent wrapping in resetMainLoaderReplaceSegments (#1439) (719b7f4)
  • replaceSegmentsUntil flag resetting too early (#1444) (af39ba5)
  • use startTime instead of 0 for finiteDuration (#1448) (dc78d78)
  • wrap onwarn values in a message object (#1428) (beccfa1)

Chores

Documentation

3.7.0 (2023-10-12)

Features

Bug Fixes

Chores

3.6.0 (2023-09-25)

Features

  • Add feature flag to calculate timestampOffset for each segment to handle streams with corrupted pts or dts timestamps (#1426) (2355ddc)
  • content steering demo page tab (#1425) (04451d4)
  • request Content Steering manifest (#1419) (86d5327)

Chores

3.5.3 (2023-08-14)

Bug Fixes

3.5.2 (2023-08-07)

Bug Fixes

  • restore dateTimeObject and dateTimeString usage (#1412) (5e425c0)

3.5.1 (2023-07-26)

Bug Fixes

3.5.0 (2023-07-25)

Features

Bug Fixes

  • live: only reset playlist loader for LLHLS (#1410) (0d8a7a3)

Chores

  • update m3u8-parser version and fix tests (#1407) (fe25a04)

Code Refactoring

  • add dateTimeObject and dateTimeString to Cues for backward compatibility (#1409) (2079454)

3.4.0 (2023-06-01)

Features

Bug Fixes

Chores

3.3.1 (2023-05-15)

Bug Fixes

Chores

3.3.0 (2023-05-03)

Features

3.2.0 (2023-04-04)

Features

Bug Fixes

Chores

Code Refactoring

  • remove nested loop from removeDuplicateCuesFromTrack function (#1381) (12acbdd)

3.1.0 (2023-03-07)

Features

Chores

3.0.2 (2023-02-27)

Bug Fixes

  • CMAF HLS. Source buffer change type is called with wrong codecs sometimes when append segment without init data because of a race condition. (#1375) (7c3e08e)

Chores

3.0.1 (2023-01-24)

Bug Fixes

3.0.0 (2022-11-21)

Features

  • add compatibility layer for video.js 7 and 8 (#1322) (b9d26e5)
  • add frameRate property to the representation class. (#1289) (fd2898f)
  • enable LLHLS support by default and remove experimental prefix on options (#1301) (02c3c77)
  • remove handleManifestRedirects and always use XHR.responseURL if available (#1226) (3ad3120)
  • rename many things to main (#1309) (54cbab3)
  • Skip gaps immediately (#1267) (f85c153)
  • update tooling to remove ie 11 transpiling, update tests (#1306) (206f099)

Bug Fixes

  • add Video.js 8 to the dep version range (#1307) (325a98e)
  • cache aes keys for text tracks (#973) (#1228) (66a5b17)
  • output-restricted event handling for unplayable streams (#1305) (1c62a98)
  • remove deprecation hls options, properties, and events; add migration guide (#1229) (43fce26)
  • Restart mainPlaylistLoader after media change (#1339) (cf340f2)
  • resume loading on segment timeout for bufferBasedABR (#1333) (969589e)

Chores

Code Refactoring

Tests

  • change source for live DASH playback test to fix test failures (#1303) (128b3d7)
  • fix IE11 encrypted VTT tests by using an actual encrypted VTT segment (#1291) (57c0e72)

BREAKING CHANGES

  • package: manifests with tags lacking colons (:) are no longer supported
  • package: This updates bundled libraries to no longer be transpiled to ES5, which means IE will no longer be supported.
  • This changes the arguments for the PlaylistController#excludePlaylist method to take a single object instead of multiple arguments.
  • This renames four experimental options to no longer be experimental and enables Low Latency HLS support by default (llhls: false will still disable it, if desired).
  • rename PlaylistController
  • rename HAVE_MASTER to HAVE_MAIN_MANIFEST
  • playlist loaders updateMain and .main prop rename
  • manifest.js exports mainForMedia and addPropertiesToMain
  • rename media groups prop to isMainPlaylist
  • rename property to mainPlaylistLoader_
  • rename to PlaylistController#main()
  • This removes support entirely for IE11 (and older) as well as any other platforms that do not support ES6.
  • remove ^6 from the dependency version ranges.
  • Skips detected gaps immediately instead of waiting the duration of the gap before skipping
  • Removes deprecated smoothQualityChange option
  • remove deprecated options, properties, events.
  • remove handleManifestRedirects option. Now XHR.responseURL will always be used when available.

3.0.0-2 (2022-09-30)

3.0.0-1 (2022-09-30)

Features

  • add compatibility layer for video.js 7 and 8 (#1322) (b9d26e5)
  • add frameRate property to the representation class. (#1289) (fd2898f)

Chores

BREAKING CHANGES

  • package: manifests with tags lacking colons (:) are no longer supported

3.0.0-0 (2022-08-19)

Features

  • enable LLHLS support by default and remove experimental prefix on options (#1301) (02c3c77)
  • remove handleManifestRedirects and always use XHR.responseURL if available (#1226) (3ad3120)
  • rename many things to main (#1309) (54cbab3)
  • Skip gaps immediately (#1267) (f85c153)
  • update tooling to remove ie 11 transpiling, update tests (#1306) (206f099)

Bug Fixes

  • add Video.js 8 to the dep version range (#1307) (325a98e)
  • cache aes keys for text tracks (#973) (#1228) (66a5b17)
  • output-restricted event handling for unplayable streams (#1305) (1c62a98)
  • remove deprecation hls options, properties, and events; add migration guide (#1229) (43fce26)

Chores

  • docs: Remove outdated information in collaborators' guide (#1271) (6100750)
  • package: update dependencies to use new ES6 builds (#1320) (9ae6695)
  • remove old-index since IE is no longer supported (#1308) (5ba3a77)
  • update karma-config to 8 to drop ie11 and older browsers (#1227) (44c12ea)
  • update package-lock.json (#1319) (c7aa9c1)

Code Refactoring

Tests

  • change source for live DASH playback test to fix test failures (#1303) (128b3d7)
  • fix IE11 encrypted VTT tests by using an actual encrypted VTT segment (#1291) (57c0e72)

BREAKING CHANGES

  • package: This updates bundled libraries to no longer be transpiled to ES5, which means IE will no longer be supported.
  • This changes the arguments for the PlaylistController#excludePlaylist method to take a single object instead of multiple arguments.
  • This renames four experimental options to no longer be experimental and enables Low Latency HLS support by default (llhls: false will still disable it, if desired).
  • rename PlaylistController
  • rename HAVE_MASTER to HAVE_MAIN_MANIFEST
  • playlist loaders updateMain and .main prop rename
  • manifest.js exports mainForMedia and addPropertiesToMain
  • rename media groups prop to isMainPlaylist
  • rename property to mainPlaylistLoader_
  • rename to PlaylistController#main()
  • This removes support entirely for IE11 (and older) as well as any other platforms that do not support ES6.
  • remove ^6 from the dependency version ranges.
  • Skips detected gaps immediately instead of waiting the duration of the gap before skipping
  • Removes deprecated smoothQualityChange option
  • remove deprecated options, properties, events.
  • remove handleManifestRedirects option. Now XHR.responseURL will always be used when available.

2.14.2 (2022-04-13)

Bug Fixes

  • retain playlist attributes when refreshing live media playlists (#1270) (5fbac16)

2.14.1 (2022-04-06)

Bug Fixes

2.14.0 (2022-03-14)

Features

  • add dts-based timestamp offset calculation with feature toggle (#1251) (450eb2d)

Bug Fixes

Documentation

2.13.1 (2021-12-20)

Bug Fixes

2.13.0 (2021-12-20)

Features

  • set up required key sessions on waitingforkey event (#1232) (3ed24a4)
  • use new mpd-parser API for handling live DASH refreshes (#1231) (f109078)

Tests

  • fix failing IE11 test due to late initialize of EME keys (#1241) (159545c)

2.12.1 (2021-12-10)

Bug Fixes

  • fix seekable not updating after the first change for live streams (#1233) (3d8755c)
  • mp4 sources that use bigint numbers (#1217) (bfd0ad0)
  • support legacy hls option for overrideNative (#1222) (4f9ce7a)

Tests

  • add a test to verify that seekable updates with a live stream (#1234) (7495ead), closes #1233
  • playack: make live dash test take 5 seconds (#1235) (b66e124)

2.12.0 (2021-11-08)

Features

  • Add an option to use the NetworkInformation API, when available (#1218) (061cf3c)

Tests

  • Don't run networkInfo tests against ie11 (#1221) (aaedde3)

2.11.2 (2021-10-27)

Bug Fixes

  • Various fixes for llhls so that we start closer to live, and stay closer to live (#1201) (bf4a458)

2.11.1 (2021-10-14)

Bug Fixes

  • package: update mpd-parser to 0.19.2 (#1211) (7420296)
  • package: update mux.js to 5.14.1 (#1215) (d7f6b63)
  • reset transmuxer in resetEverything to fix seeking backwards in some cases (#1213) (a83ea37)

Chores

2.11.0 (2021-09-22)

Features

  • Add ability to pass encoding value for 708 captions via captionServices (#1194) (e2b46e7)

Bug Fixes

  • do not try to save expired segment information for gaps greater than 86400 (#1204) (0dc0b61)
  • mark global/window/document as external globals (#1205) (324af10)
  • Only check/fix bad seeks after seeking, without seeked, and an append (#1195) (9d6505a)
  • use URL to add searchParams for LLHLS (#1199) (a8d3c1a)

Chores

Tests

2.10.3 (2021-09-03)

Bug Fixes

2.10.3 (2021-09-03)

Bug Fixes

2.10.2 (2021-08-24)

Bug Fixes

  • update mpd-parser and mux.js to fix an xmldom vulnerability (#1190) (37b4b04)

2.10.2 (2021-08-24)

Bug Fixes

  • update mpd-parser and mux.js to fix an xmldom vulnerability (#1190) (37b4b04)

2.10.1 (2021-08-17)

Bug Fixes

  • keep media update timeout alive so live playlists can recover from network issues (#1176) (8b3533c)

Chores

  • add a github-release action to automate github releases on version tags (#1182) (e8230a9)
  • consistent source selection on demo start (#1185) (ff34277)
  • update the demo page (#1184) (55f0bde)
  • various demo page fixes and enhancements (#1186) (eef29d4)

2.10.1 (2021-08-17)

Bug Fixes

  • keep media update timeout alive so live playlists can recover from network issues (#1176) (8b3533c)

Chores

  • add a github-release action to automate github releases on version tags (#1182) (e8230a9)
  • consistent source selection on demo start (#1185) (ff34277)
  • update the demo page (#1184) (55f0bde)
  • various demo page fixes and enhancements (#1186) (eef29d4)

2.10.0 (2021-07-28)

Features

  • add experimental pixel diff selector behind a flag defaulted off (#786) (a0c0359)
  • Add experimentalExactManifestTimings which forgoes TIME_FUDGE_FACTOR during segment choice (#1165) (67a1201)

Bug Fixes

  • exclude playlists on DRM key status of output-restricted (#1171) (de5baa7)
  • Generate the correct number of segments for segment template multi period dash (#1175) (413fee3)
  • update vhs-utils to correctly detect mp4 starting with moof/moov (#1173) (464a365)

Chores

  • add tests/sources for manifest object urls (#1168) (5f60612)

Tests

  • refactor tests so that players/blob urls/ and media elements are cleaned up (#1174) (b3d1ec0)

2.10.0 (2021-07-28)

Features

  • add experimental pixel diff selector behind a flag defaulted off (#786) (a0c0359)
  • Add experimentalExactManifestTimings which forgoes TIME_FUDGE_FACTOR during segment choice (#1165) (67a1201)

Bug Fixes

  • exclude playlists on DRM key status of output-restricted (#1171) (de5baa7)
  • Generate the correct number of segments for segment template multi period dash (#1175) (413fee3)
  • update vhs-utils to correctly detect mp4 starting with moof/moov (#1173) (464a365)

Chores

  • add tests/sources for manifest object urls (#1168) (5f60612)

Tests

  • refactor tests so that players/blob urls/ and media elements are cleaned up (#1174) (b3d1ec0)

2.9.3 (2021-07-19)

Bug Fixes

  • Prevent audio groups without a playlist from being requested. (#1167) (8c10733)

2.9.2 (2021-07-14)

Bug Fixes

  • Default to using segmentInfo.trackInfo over this.currentMediaInfo_ to get segment track info. (#1162) (1d6bb55)
  • encode correct video width/height in transmuxed mp4 (#1166) (d32801a)
  • include all master playlists in default audio group (#1149) (297e2c7)
  • Prevent skipping frames in adts data via mux.js 5.11.3 (#1153) (253849a)

Chores

  • log transmuxer log events via segment loader (#1155) (1e2f7a4)
  • prevent debugger statement removal and soucemap updating via rollup-plugin-strip (#1147) (62f9c1c)
  • skip playback tests in forks (#1148) (063e163)
  • update utils/stats (#1146) (c504b0d)
  • use the new npm cache option when setting up node (#1157) (b7942ff)

Documentation

  • update maxPlaylistRetries outline level (93b293a)

Tests

2.9.1 (2021-06-22)

Bug Fixes

  • actually default maxPlaylistRetries to Infinity (#1142) (4428e3a), closes #1098
  • don't decay average bandwidth value if system bandwidth did not change (#1137) (c22749b)
  • ts segments that don't define all streams in the first pmt (#1144) (36a8be4)

Tests

2.9.0 (2021-06-11)

Features

Bug Fixes

  • add part level sync points, fix LL hls sync issues, add part timing info (#1125) (ee5841d)
  • Append valid syncRequests, better sync request choice, less getMediaInfoForTime rounding (#1127) (ce03f66)

Chores

2.8.2 (2021-05-20)

Bug Fixes

  • add tests for data uri, fix data uri in demo page (#1133) (0be51eb)

2.8.1 (2021-05-19)

Bug Fixes

  • add master referenced id/uri for audio playlists. Add playlists to hls media groups (#1124) (740d2ee)
  • m3u8-parser/eme updates (#1131) (29ece75)
  • only append/request init segments when they change (#1128) (a4af004)
  • set audio status on loaders when setting up media groups (#1126) (a44f984)

Chores

2.8.0 (2021-04-28)

Features

  • add initialBandwidth option at the tech level (#1122) (2071008)

Bug Fixes

  • don't clear DASH minimum update period timeout on pause of a media loader (#1118) (82ff4f5)
  • null check sidx on sidxmapping, check that end > start on remove (#1121) (92f1333)

Code Refactoring

  • drop support for the partial muxer and handlePartial (#1119) (ab305f8)
  • offload mp4/ts probe to the web worker (#1117) (3c9f721)
  • segment/part choice and add more logging around the choice (#1097) (b8a5aa5)

2.7.1 (2021-04-09)

Bug Fixes

  • experimentalLLHLS option should always be passed (#1114) (684fd08)

Chores

2.7.0 (2021-04-06)

Features

  • Add EXT-X-PART support behind a flag for LL-HLS (#1055) (b33e109)
  • mark Video.js as a peer dependency (#1111) (99480d5)
  • support serverControl and preloadSegment behind experimentalLLHLS flag (#1078) (fa1b6b5)
  • usage and logging on rendition change with reasons (#1088) (1b990f1)

Bug Fixes

  • audio only media group playlists, audio group playlists, and audio switches for audio only (#1100) (6d83de3)
  • better time to first frame for live playlists (#1105) (1e94680)
  • catch remove errors, remove all data on QUOTA_EXCEEDED (#1101) (86f77fe)
  • Only add sidxMapping on successful sidx request and parse. (#1099) (de0b55b), closes #1107
  • support automatic configuration of audio and video only DRM sources (#1090) (9b116ce)

Chores

2.6.4 (2021-03-12)

Bug Fixes

  • Monitor playback for stalls due to gaps in the beginning of stream when a new source is loaded (#1087) (64a1f35)
  • retry appends on QUOTA_EXCEEDED_ERR (#1093) (008aeaf)

Chores

2.6.3 (2021-03-05)

Bug Fixes

  • playback-watcher: Skip over playback gaps that occur in the beginning of streams (#1085) (ccd9352)
  • Add exclude reason and skip duplicate playlist-unchanged (#1082) (0dceb5b)
  • prevent changing undefined baseStartTime to NaN (#1086) (43aa69a)
  • update to mux.js 5.10.0 (#1089) (1cfdab6)

Chores

2.6.2 (2021-02-24)

Bug Fixes

Tests

2.6.1 (2021-02-19)

Bug Fixes

  • allow buffer removes when there's no current media info in loader (#1070) (97ab712)
  • live dash segment changes should be considered a playlist update (#1065) (1ce7838)
  • sometimes subtitlesTrack_.cues is null (#1073) (6778ca1)
  • unbreak the minified build by updating rollup-plugin-worker-factory (#1072) (e583b26)

Chores

  • mirror player.src on the demo page using sourceset (#1071) (fee7309)

Documentation

  • README: fix useBandwidthFromLocalStorage and limitRenditionByPlayerDimensions (#1075) (cf2efcb)

2.6.0 (2021-02-11)

Features

  • allow xhr override globally, for super advanced use cases only (#1059) (6279675)
  • expose m3u8-parser logging in debug log (#1048) (0e8bd4b)

Bug Fixes

  • do not request manifests until play when preload is none (#1060) (49249d5), closes #126
  • store transmuxQueue and currentTransmux on transmuxer instead of globally (#1045) (a34b4da)
  • use a separate ProgramDateTime mapping to player time per timeline (#1063) (5e9b4f1)
  • wait for endedtimeline event from transmuxer when reaching the end of a timeline (#1058) (b01ab72)

Chores

Documentation

  • sample-aes encryption isn't currently supported (#923) (30f9b14)

Tests

  • for IE11, add colon to timezone in Date strings of PDT mapping tests (#1068) (f81c5a9)

2.5.0 (2021-01-20)

Features

Chores

Tests

  • clear segment transmuxer in media segment request tests (#1043) (83057a8)
  • don't show QUnit UI in regular test runs (#1044) (25c7f64)

2.4.2 (2021-01-07)

Bug Fixes

  • handle rollover and don't set wrong timing info for segments with high PTS/DTS values (#1040) (9919b85)

2.4.1 (2020-12-22)

Bug Fixes

  • if a playlist was last requested less than half target duration, delay retry (#1038) (2e237ee)
  • programmatically create Config getters/setters (8454da5)

Chores

2.4.0 (2020-12-07)

Features

Bug Fixes

  • abort all loaders on earlyabort (#965) (e7cb63a)
  • don't save bandwidth and throughput for really small segments (#1024) (a29e241)
  • filter out unsupported subtitles for dash (#962) (124834a)
  • keep running the minimumUpdatePeriod unless cancelled or changed (#1016) (f7b528c)
  • prevent double source buffer ready on IE11 (#1015) (b1c2969)
  • remove duplicate cues with same time interval and text (#1005) (6db2b6a)
  • support tracks with id 0 for fmp4 playlists (#1018) (bf63692)
  • Wait for EME initialization before appending content (#1002) (93132b7)
  • when changing renditions over a discontinuity, don't use buffered end as segment start (#1023) (40caa45)
  • experimentalBufferBasedABR: start ABR timer on main playlist load (#1026) (27de9a5), closes #1025

Chores

Code Refactoring

  • Add a better distinction between master and child dash loaders (#992) (56592bc)
  • add sidx segments to playlist object instead of re-parsing xml (#994) (e41f856)
  • unify sidx/master/error request logic (#998) (fe57e60)

Tests

2.3.0 (2020-11-05)

Features

Bug Fixes

  • appendsdone abort and handle multiple id3 sections. (#971) (329d50a)
  • check tech error before pause loaders (#969) (0c7b2cb)
  • inline json version (#967) (326ce1c)
  • experimentalBufferBasedABR: call selectPlaylist and change media on an interval (#978) (200c87b), closes #886 #966 #964
  • only prevent audio group creation if no other playlists are using it (#981) (645e979)
  • playback-watcher: ignore subtitles (#980) (ca7655e)

Chores

  • package: update aes-decrypter, m3u8 and mpd parser for vhs-utils (#988) (c31dee2)

Tests

2.2.0 (2020-09-25)

Features

Bug Fixes

  • audio groups with the same uri as media do not count (#952) (3927c0c)
  • dash manifest not refreshed if only some playlists are updated (#949) (31d3441)
  • detect demuxed video underflow gaps (#948) (d0ef298)
  • MPD not refreshed if minimumUpdatePeriod is 0 (#954) (3a0682f), closes #942
  • noop vtt segment loader handle data (#959) (d1dcd7b)
  • report the correct buffered regardless of playlist change (#950) (043ccc6)
  • Throw a player error when trying to play DRM content without eme (#938) (ce4d6fd)
  • use playlist NAME when available as its ID (#929) (2269464)
  • use TIME_FUDGE_FACTOR rather than rounding by decimal digits (#881) (7eb112d)

Chores

  • package: remove engine check in pkcs7 (#947) (89392fa)
  • mark angel one dash subs as broken (#956) (56a0970)
  • mediaConfig -> staringMediaInfo, startingMedia -> currentMediaInfo (#953) (8801d1c)
  • playlist selector logging (#921) (ccdbaef)
  • update m3u8-parser to v4.4.3 (#928) (af5b4ee)

Reverts

2.1.0 (2020-07-28)

Features

  • Easier manual playlist switching, add codecs to renditions (#850) (f60fa1f)
  • exclude all incompatable browser/muxer codecs (#903) (2d0f0d7)
  • expose canChangeType on the VHS property (#911) (a4ab285)
  • let back buffer be configurable (8c96e6c)
  • Support codecs switching when possible via sourceBuffer.changeType (#841) (267cc34)

Bug Fixes

  • always append init segment after trackinfo change (#913) (ea3650a)
  • cleanup mediasource listeners on dispose (#871) (e50f4c9)
  • do not try to use unsupported audio (#896) (7711b26)
  • do not use remove source buffer on ie 11 (#904) (1ab0f07)
  • do not wait for audio appends for muxed segments (#894) (406cbcd)
  • Fixed issue with MPEG-Dash MPD Playlist Finalisation during Live Play. (#874) (c807930)
  • handle null return value from CaptionParser.parse (#890) (7b8fff2), closes #863
  • have reloadSourceOnError get src from player (#893) (1e50bc5), closes videojs/video.js#6744
  • initialize EME for all playlists and PSSH values (#872) (e0e497f)
  • more conservative stalled download check, better logging (#884) (615e77f)
  • pause/abort loaders before an exclude, preventing bad appends (#902) (c9126e1)
  • stop alt loaders on main mediachanging to prevent append race (#895) (8690c78)
  • Support aac data with or without id3 tags by using mux.js@5.6.6 (#899) (9c742ce)
  • Use revokeObjectURL dispose for created MSE blob urls (#849) (ca73cac)
  • Wait for sourceBuffer creation so drm setup uses valid codecs (#878) (f879563)

Chores

  • Add vhs & mpc (vhs.masterPlaylistController_) to window of index.html (#875) (bab61d6)
  • demo: add a representations selector to the demo page (#901) (0a54ae2)
  • fix tears of steal playready on the demo page (#915) (29a10d0)
  • keep window vhs/mpc up to date on source switch (#883) (3ba85fd)
  • update DASH stream urls (#918) (902c2a5)
  • update local video.js (#876) (c2cc9aa)
  • use playready license server (#916) (6728837)

Code Refactoring

  • remove duplicate bufferIntersection code in util/buffer.js (#880) (0ca43bd)
  • simplify setupEmeOptions and add tests (#869) (e3921ed)

2.0.0 (2020-06-16)

Features

  • add external vhs properties and deprecate hls and dash references (#859) (22af0b2)
  • Use VHS playback on any non-Safari browser (#843) (225d127)

Chores

  • fix demo page on firefox, always use vhs on safari (#851) (d567b7d)
  • stats: update vhs usage in the stats page (#867) (4dda42a)

Code Refactoring

  • Move caption parser to webworker, saving 5732b offloading work (#863) (491d194)
  • remove aes-decrypter objects from Hls saving 1415gz bytes (#860) (a4f8302)

Documentation

Reverts

  • "fix: Use middleware and a wrapped function for seeking instead of relying on unreliable 'seeking' events (#161)"(#856) (1165f8e)

BREAKING CHANGES

  • The Hls object which was exposed on videojs no longer has Decrypter, AsyncStream, and decrypt from aes-decrypter.

1.10.2 (2019-05-13)

Bug Fixes

Performance Improvements

  • don't enable captionParser for audio or subtitle loaders (#487) (358877f)

1.10.1 (2019-04-16)

Bug Fixes

  • dash-playlist-loader: clear out timers on dispose (#472) (2f1c222)

Reverts

  • "fix: clear the blacklist for other playlists if final rendition errors (#396)" (#471) (dd55028)

1.10.0 (2019-04-12)

Features

  • add option to cache encrpytion keys in the player (#446) (599b94d), closes #140
  • add support for dash manifests describing sidx boxes (#455) (80dde16)

Bug Fixes

  • clear the blacklist for other playlists if final rendition errors (#396) (6e6c8c2)
  • on dispose, don't call abort on SourceBuffer until after remove() has finished (3806750)

Documentation

  • README: update broken link to full docs (#440) (fbd615c)

1.9.3 (2019-03-21)

Bug Fixes

Documentation

1.9.2 (2019-03-14)

Bug Fixes

  • expose custom segment property in the segment metadata track (#429) (17510da)

1.9.1 (2019-03-05)

Bug Fixes

  • fix for streams that would occasionally never fire an ended event (fc09926)
  • Fix video playback freezes caused by not using absolute current time (#401) (957ecfd)
  • only fire seekablechange when values of seekable ranges actually change (#415) (a4c056e)
  • Prevent infinite buffering at the start of looped video on edge (#392) (b6d1b97)

Code Refactoring

  • align DashPlaylistLoader closer to PlaylistLoader states (#386) (5d80fe7)

1.9.0 (2019-02-07)

Features

  • Use exposed transmuxer time modifications for more accurate conversion between program and player times (#371) (41df5c0)

Bug Fixes

  • m3u8 playlist is not updating when only endList changes (#373) (c7d1306)
  • Prevent exceptions from being thrown by the MediaSource (#389) (8c06366)

Chores

  • Update mux.js to the latest version 🚀 (#397) (38ec2a5)

Tests

  • added test for playlist not updating when only endList changes (#394) (39d0be2)

1.8.0 (2019-01-10)

Features

Bug Fixes

  • id3: cuechange event not being triggered on audio-only HLS streams (#334) (bab70fd), closes #130

1.7.0 (2019-01-04)

Features

1.6.0 (2018-12-21)

Features

  • Add allowSeeksWithinUnsafeLiveWindow property (#320) (74b28e8)

Chores

  • add clock.ticks to now async operations in tests (#315) (895c86a)

Documentation

  • Add README entry on DRM and videojs-contrib-eme (#307) (93b6167)

1.5.1 (2018-12-06)

Bug Fixes

  • added missing manifest information on to segments (EXT-X-PROGRAM-DATE-TIME) (#236) (a35dd09)
  • remove player props on dispose to stop middleware (#229) (cd13f9f)

Documentation

  • add dash to package.json description (#267) (3296c68)
  • add documentation for reloadSourceOnError (#266) (7448b37)

1.5.0 (2018-11-13)

Features

  • Add useBandwidthFromLocalStorage option (#275) (60c88ae)

Bug Fixes

  • don't wait for requests to finish when encountering an error in media-segment-request (#286) (970e3ce)
  • throttle final playlist reloads when using DASH (#277) (1c2887a)

1.4.2 (2018-11-01)

Chores

1.4.1 (2018-10-25)

Bug Fixes

  • subtitles: set default property if default and autoselect are both enabled (#239) (ee594e5)

1.4.0 (2018-10-24)

Features

Bug Fixes

1.3.1 (2018-10-15)

Bug Fixes

1.3.0 (2018-10-05)

Features

  • add an option to ignore player size in selection logic (#238) (7ae42b1)

Documentation

1.2.6 (2018-09-21)

Bug Fixes

  • stutter after fast quality change in IE/Edge (#213) (2c0d9b2)

Documentation

  • update issue template to link to the troubleshooting guide (#215) (413f0e8)
  • update README notes for video.js 7 (#200) (d68ce0c)
  • update troubleshooting guide for Edge/mobile Chrome (#216) (21e5335)

1.2.5 (2018-08-24)

Bug Fixes

1.2.4 (2018-08-13)

Bug Fixes

  • Remove buffered data on fast quality switches (#113) (bc94fbb)

1.2.3 (2018-08-09)

Chores

1.2.2 (2018-08-07)

Bug Fixes

  • typeof minification (#182) (7c68335)
  • Use middleware and a wrapped function for seeking instead of relying on unreliable 'seeking' events (#161) (6c68761)

Chores

Documentation

Tests

  • add support for real segments in tests (#178) (2b07fca)

1.2.1 (2018-07-17)

Bug Fixes

1.2.0 (2018-07-16)

Features

  • captions: write in-band captions from DASH fmp4 segments to the textTrack API (#108) (7c11911)

Chores

  • add welcome bot config from video.js (#150) (922cfee)

1.1.0 (2018-06-06)

Features

  • Utilize option to override native on tech (#76) (5c7ab4c)

Chores

  • update tests and pages for video.js 7 (#102) (d6f5005)

1.0.2 (2018-05-17)

Bug Fixes

  • make project Video.js 7 ready (#92) (decad87)
  • make sure that es build is babelified (#97) (5f0428d)

Documentation

  • update documentation with a glossary and intro page, added DASH background (#94) (4b0fde9)

1.0.1 (2018-04-12)

Bug Fixes

1.0.0 (2018-04-10)

Chores

Documentation

  • update docs for overrideNative (#77) (98ca6d3)
  • update known issues for fmp4 captions (#79) (c418301)

0.9.0 (2018-03-30)

Features

0.8.0 (2018-03-30)

Code Refactoring

0.7.0

  • feat: Live support for DASH

0.6.1

  • use webwackify for webworkers to support webpack bundle (#50)

0.5.3

  • fix: program date time handling (#45)
    • update m3u8-parser to v4.2.0
    • use segment program date time info
  • feat: Adding support for segments in Period and Representation (#47)
  • wait for both main and audio loaders for endOfStream if main starting media unknown (#44)

0.5.2

  • add debug logging statement for seekable updates (#40)

0.5.1

  • Fix audio only streams with EXT-X-MEDIA tags (#34)
  • Merge videojs-contrib-hls master into http-streaming master (#35)
    • Update sinon to 1.10.3=
    • Update videojs-contrib-quality-levels to ^2.0.4
    • Fix test for event handler cleanup on dispose by calling event handling methods
  • fix: Don't reset eme options (#32)

0.5.0

  • update mpd-parser to support more segment list types (#27)

0.4.0

  • Removed Flash support (#15)
  • Blacklist playlists not supported by browser media source before initial selection (#17)

0.3.1

  • Skip flash-based source handler with DASH sources (#14)

0.3.0

  • Added additional properties to the stats object (#10)

0.2.1

  • Updated the mpd-parser to fix IE11 DASH support (#12)

0.2.0

  • Initial DASH Support (#8)

0.1.0