HLS, DASH, and future HTTP streaming protocols library for video.js

Overview

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: 6.0, 7.0

Installation

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 our slack channel (#playback) on the Video.js slack.

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 and include it in your page along with video.js:

<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 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

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, which will be used unless the overrideNative option is used:

  • Chrome Android
  • Firefox Android
  • Edge

Native only

  • Mac Safari
  • iOS Safari

Mac Safari does have MSE support, but native HLS is recommended

Flash Support

This plugin does not support Flash playback. Instead, it is recommended that users use the videojs-flashls-source-handler plugin as a fallback option for browsers that don't have a native HLS/DASH player or support for Media Source Extensions.

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.

handleManifestRedirects
  • Type: boolean
  • Default: false
  • can be used as a source option
  • can be used as an initialization option

When the handleManifestRedirects property is set to true, manifest requests which are redirected will have their URL updated to the new URL for future requests.

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.

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

When the blacklistDuration property is set to a time duration in seconds, if a playlist is blacklisted, it will be blacklisted for a period of that customized duration. This enables the blacklist 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.

smoothQualityChange
  • NOTE: DEPRECATED
  • Type: boolean
  • can be used as a source option
  • can be used as an initialization option

smoothQualityChange is deprecated and will be removed in the next major version of VHS.

Instead of its prior behavior, smoothQualityChange will now call fastQualityChange, which clears the buffer, chooses a new rendition, and starts loading content from the current playhead position.

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.
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.master

Type: object

An object representing the parsed master playlist. If a media playlist is loaded directly, a master 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 master playlist or a URI string as specified in the master 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.master.

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 HLS 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, the xhr provides the ability to specify a beforeRequest function that will be called with an object containing the options that will be used to create the xhr request.

Example:

player.tech().vhs.xhr.beforeRequest = function(options) {
  options.uri = options.uri.replace('example.com', 'foo.com');

  return options;
};

The global videojs.Vhs also exposes an xhr property. Specifying a beforeRequest function on that will allow you to intercept the options 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

videojs.Vhs.xhr.beforeRequest = function(options) {
  /*
   * Modifications to requests that will affect every player.
   */

  return options;
};

var player = videojs('video-player-id');
player.ready(function() {
  this.src({
    src: 'https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8',
    type: 'application/x-mpegURL',
  });
});

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
master object The master 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

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 master 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 master 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 master 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-blacklisted a rendition was blacklisted
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>
Comments
  • Typescript: Property 'hls' does not exist on type 'Tech'

    Typescript: Property 'hls' does not exist on type 'Tech'

    Description

    I have a code that looks like that:

    const player: VideoJsPlayer = this.getPlayer();
    const playerTech: videojs.Tech = player.tech({IWillNotUseThisInPlugins: true});
    
    const playlist = playerTech.hls.playlists.media();
    

    Typescript compiler says: Property 'hls' does not exist on type 'Tech'

    What can I do?

    videojs-http-streaming version

    [email protected]

    videojs version

    [email protected]

    @types/video.js version

    @types/[email protected]

    Platforms

    React-native-web

    outdated 
    opened by Barteque 30
  • VOD Dash stream not working

    VOD Dash stream not working

    Description

    Hi, for some reason videos I encode using ffmpeg and MP4Box are not being able to stream on your demo. They do however stream, on shaka player's demo, and on videojs-contrib-dash.

    Sources

    I've made a specific video I've uploaded to S3 public, so you can check my issue: the URL: https://s3.eu-central-1.amazonaws.com/bucketvod/b0PCWLt690M9/mpd.mpd I've removed CORS.

    Steps to reproduce

    Explain in detail the exact steps necessary to reproduce the issue.

    1. Go to your demo and insert the URL I gave and select the matching type (dash+xml), You should see that loading the video does nothing.
    2. Go to shaka player demo and you should see that the player loads the video properly.
    3. Go to videojs-contrib-dash demo, enter the URL and again, the video loads properly.

    Results

    Video is loading on all demos but http-streaming demo. I've also tried loading on my own app using videojs and ur lib, but again no luck.

    Expected

    Video should load properly as it does on other players.

    Error output

    No errors are shown as u can see.

    Additional Information

    I'm currently using videojs-contrib-dash, but in my understanding http-streaming is now the official http streaming plugin for both hls and dash, so I want to migrate. At first I thought it was some king with my encoding process, but then I saw that other players have no problems with it.

    videojs-http-streaming version

    what version of videojs-http-streaming does this occur with? the current version accessible by the demo/npm.

    Browsers

    what browsers are affected? please include browser and version for each

    • Tetsted only on my chrome

    Platforms

    what platforms are affected? please include operating system and version or device and version for each

    • Win10

    Other Plugins

    are any other videojs plugins being used on the page? If so, please list them with version below.

    • No plugins.

    Other JavaScript

    are you using any other javascript libraries or frameworks on the page? if so please list them below.

    • Your demo.
    bug planned 
    opened by papigers 30
  • Video corruption playing certain HLS streams in http-streaming 1.2.5+

    Video corruption playing certain HLS streams in http-streaming 1.2.5+

    Description

    Regression - VHS 1.2.5 (which was pulled into Video.js 7.2.3) introduced an issue where certain videos can result in corrupted playback in the first segment of video, but only on Chrome (i.e. not Firefox).

    See reproduction steps below, but this has been tracked down to the change within this PR: https://github.com/videojs/http-streaming/pull/204. Again, more detials found below, but the quick summary appears to be that the call to sync the VHS time to the player time when pressing play right at the beginning of an asset causes some form of corruption in the source buffer in Chrome.

    Sources

    This source should reproduce the issue at all times: https://s3.amazonaws.com/mux-justin-test/vjs-issue/manifest.m3u8.

    Steps to reproduce

    Explain in detail the exact steps necessary to reproduce the issue.

    1. Load the above source into a videojs player that is version 7.2.3 or newer, in Chrome
    2. Press play
    3. Observe the video stalling during the first segment, while the audio continues to play

    You can observe this here: https://50qr24o08l.codesandbox.io/

    You can also see that here (on version 7.2.2) this does not occur by default: https://zxjv7pro3l.codesandbox.io/

    That said, you can make this happen on 7.2.2 by pressing the "Play Special" button below the player in the example above, which makes the following javascript call:

    player.play().then(() => player.vhs.setCurrentTime(player.currentTime()));
    

    This code is what was added in https://github.com/videojs/http-streaming/pull/204.

    Results

    Expected

    Playback of the video and audio in Chrome

    Error output

    No errors are showin in the console, but you can clearly see the video hang.

    This does not occur in Firefox.

    Additional Information

    From our investigation so far, this appears to have something to do with finding whether there is a buffered range for the current time, and if there is not, then it "resets" everything from the segment loader. In this particular case, the video has a DTS offset from the first frame of video to the first frame of audio, which, when fed to the source buffer on Chrome, results in the start timestamp of the first bufferedRange to be outside of the "fudge factor" used here: https://github.com/videojs/http-streaming/blob/master/src/ranges.js#L11.

    In particular, in Chrome for this video, you see the following:

    player.buffered().start(0)
    -> 0.066729
    

    What this means is that when the call to player.vjs.setCurrentTime(player.currentTime()) is made, player.currentTime() returns 0, and then the call to find the buffered range for that timestamp ends up saying there is no buffered range for this time. This then goes on to reset the segment loaders, which appears to cause the corruption within the source buffer for the player element.

    It's important to note that this works just fine on Firefox (and other browsers), and the video also plays perfectly fine on Chrome prior to version 7.2.2.

    I initially started looking into how to fix this, with something along the lines of messing with the fudge factor, but that will not necessarily fix this all the time. In addition, I'm not sure that reverting this will not re-introduce the issue that this PR was intended to fix initially. Happy to provide more help or suggested PRs if that would be useful, but at this point I thought it worth while to raise the issue.

    videojs-http-streaming version

    videojs-http-streaming version 1.2.5 or newer

    videojs version

    videojs version 7.2.3 or newer

    Browsers

    Chrome (all versions seem to be affected, but specifically 71.0.3578.98 was tested most recently) No other browsers seem to be affected

    Platforms

    Mac OSX was used for testing.

    Other Plugins

    N/A

    Other JavaScript

    No libraries or frameworks other than video.js

    opened by jsanford8 25
  • Live stream issues on Tizen 2.4 since 2.5.0

    Live stream issues on Tizen 2.4 since 2.5.0

    Description

    Since 2.5.0 I have issues with some HLS live streams. Hangs on repeated vhs-live-resync. Not sure how to gather more information...

    Sources

    Steps to reproduce

    Results

    Expected

    On 2.4.2 playback starts

    Error output

    More than once per seconds I get Usage:vhs-live-resync State:0

    Additional Information

    videojs-http-streaming version

    videojs-http-streaming 2.5.0

    videojs version

    Any video.js version.

    Browsers

    Platforms

    Tizen 2.4

    Other Plugins

    Other JavaScript

    opened by JeppeTh 22
  • HLS video with wide pixel doesn't scale in Chrome 71

    HLS video with wide pixel doesn't scale in Chrome 71

    Description

    HLS video stream with custom pixel size (not square) doesn't play correct on latest Chrome browser It works fine on previous versions or in different browsers

    Steps to reproduce

    1. Open HLS stream with non-square pixels size

    screenshot_116

    1. See that video should be stretched to full window size, like in example below (because of pixel size, original video stream size 720x576 with wide pixel). Screenshot made in Edge

    screenshot_117

    Additional Information

    Works fine with videojs player if open local video file. Reproduces only on hls streams.

    videojs-http-streaming version

    videojs-http-streaming 1.5.1

    videojs version

    video.js 7.3.0

    Browsers

    Version 71.0.3578.80 (Official Build) (64-bit)

    <head>
      <link href="https://vjs.zencdn.net/7.3.0/video-js.css" rel="stylesheet">
      <script src="https://vjs.zencdn.net/ie8/ie8-version/videojs-ie8.min.js"></script>
      <script src="videojs-http-streaming.min.js"></script>
    </head>
    <body>
      <video id="my-video" class="video-js" controls preload="auto" data-setup="{}">
        <source src="..." type="application/x-mpegURL">
        <p class="vjs-no-js">
          To view this video please enable JavaScript, and consider upgrading to a web browser that
          <a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
        </p>
      </video>
      <script src="https://vjs.zencdn.net/7.3.0/video.js"></script>
    </body>
    
    bug 
    opened by gtx5200ultra 21
  • Dash live streaming stops playing after a few seconds

    Dash live streaming stops playing after a few seconds

    Description

    Dash live streaming stops playing after a few seconds

    Sources

    Livestreams url updated ~~https://srg2-accountdigitalinnovation-euwe.streaming.media.azure.net/3f17705e-954c-449f-b2f9-21786485668b/269fa71b-c34c-467a-ab3e-908cd37c640b.ism/manifest(format=mpd-time-csf)~~

    https://wowzaec2demo.streamlock.net/live/bigbuckbunny/manifest_mpm4sav_mvtime.mpd

    Steps to reproduce

    Explain in detail the exact steps necessary to reproduce the issue.

    1. Open https://amtins.github.io/videojs-dash-live-streaming/
    2. Click play
    3. Wait until it stops

    Results

    Expected

    Should works as videojs-contrib-dash

    Livestreams url updated Url to test : ~~https://srg2-accountdigitalinnovation-euwe.streaming.media.azure.net/3f17705e-954c-449f-b2f9-21786485668b/269fa71b-c34c-467a-ab3e-908cd37c640b.ism/manifest(format=mpd-time-csf)~~

    https://wowzaec2demo.streamlock.net/live/bigbuckbunny/manifest_mpm4sav_mvtime.mpd

    Additional Information

    The given stream is a live stream with DVR. The issue stays the same with or without DVR.

    videojs-http-streaming version

    videojs-http-streaming 1.2.6/1.5.0

    videojs version

    video.js 7.2.4/7.4.0

    Browsers

    All

    Platforms

    All

    bug needs: research 
    opened by amtins 20
  • Some HLS playlists return `MEDIA_ERR_DECODE` on Chrome

    Some HLS playlists return `MEDIA_ERR_DECODE` on Chrome

    AleksanderSadov commented on Jul 11, 2017, 6:21 AM UTC:

    Description

    Some HLS playlists return MEDIA_ERR_DECODE on Chrome brower (Version: 59.0.3071.115). Stream works fine in other browsers like: Firefox(Version: 54), IE 11, Edge. The problem is similar to previous issue: videojs/videojs-contrib-hls#584

    Sources

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset=utf-8 />
    <title>videojs-contrib-hls embed</title>
    
      <link href="https://unpkg.com/[email protected]/dist/video-js.css" rel="stylesheet">
      <script src="https://unpkg.com/[email protected]/dist/video.js"></script>
      <script src="https://unpkg.com/[email protected]/dist/videojs-contrib-hls.js"></script>
    
    </head>
    <body>
      <h1>Video.js Example Embed</h1>
    
      <video id="my_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268" 
      data-setup='{}'>
        <source src="http://138.68.240.201/hls/master-cctvnews.m3u8" type="application/x-mpegURL">
      </video>
    
      <script>
      </script>
    
    </body>
    </html>
    
    

    Error output

    There are 2 errors in the console after stream plays for a few seconds:

    VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) The media playback was aborted due to a corruption problem or because the media used features your browser did not support.

    VIDEOJS: ERROR: (CODE:-3 undefined) Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null.

    Additional Information

    videojs-contrib-hls version

    videojs-contrib-hls 5.8.0

    videojs version

    video.js 6.2.0

    Browsers

    Chrome 59.0.3071.115

    Platforms

    Ubuntu 16.04.2 LTS

    Other Plugins

    videojs-contrib-ads 5.0.1 videojs-contrib-media-sources 4.4.6 videojs-flash 2.0.0 videojs-chromecast 2.0.8

    Other JavaScript

    jQuery v2.1.4

    This issue was moved by forbesjo from videojs/videojs-contrib-hls#1190.

    bug 
    opened by ghost 20
  • An in-range update of babel7 is breaking the build 🚨

    An in-range update of babel7 is breaking the build 🚨

    There have been updates to the babel7 monorepo:

    🚨 View failing branch.

    This version is covered by your current version range and after updating it in your project the build failed.

    This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

    babel7 is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

    Status Details
    • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

    FAQ and help

    There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


    Your Greenkeeper Bot :palm_tree:

    greenkeeper 
    opened by greenkeeper[bot] 19
  • Low-Latency HLS Feature Request

    Low-Latency HLS Feature Request

    Description

    I have a question for VideoJS Http-Streaming. Are you working on adding Apple Low-Latency HLS feature or any plugin into your player? We are using Wowza live streaming video delivery system. It is able to deliver Low Latency HLS live streams via CMAF packetizer right now. We are going to launch this function on our company's platform. Therefore, we are also considering on using a Low-Latency enabled player. Theoplayer can support LL-HLS playback in industry standard; Nexplayer claimed they can also support CMAF Low Latency Chunks to optimize the latency around 3 seconds. Fortunately, we plan to move our end-to-end service forward to VideoJS as our player. So we are eager to know whether we have already provided LL-HLS feature or been working on it with ETA.

    opened by rachelyang123 17
  • Player enters tight infinite loop when live rendition manifests stop updating

    Player enters tight infinite loop when live rendition manifests stop updating

    Description

    The VideoJS player enters a tight infinite loop requesting a single rendition manifest when the rendition manifests for a live stream stops being updated. The request-rate is only limited by the network connection speed. Rates exceeding 50 requests/sec have been observed. This has the potential to overwhelm the player device and video origin.

    This can occur when the input for an HLS live stream is disconnected and the encoder keeps the live stream active during a reconnect window. During the reconnect window, the video origin might continue to serve rendition manifests that don't contain any new segments. Once the input is reconnected, the video origin can resume updating the rendition manifests and playback continues. If the reconnect window expires without the input being reconnected, then the rendition manifests can be marked as ended.

    While the reconnect window is open, the player iterates over the set of rendition manifests looking for a manifest containing new segments. If all of the rendition manifests have been retrieved and no updates were found, then the player becomes stuck trying the same rendition manifest endlessly.

    Sources

    HLS live streams that support input-stream reconnect-windows.

    Steps to reproduce

    Demonstration: https://youtu.be/bGCVSud2ZGk

    1. Start sending input stream to encoder configured with a reconnect window (e.g. 5 minutes)
    2. Start playback in VideoJS
    3. Disconnect input stream
    4. Observe the player iterate over rendition manifests
    5. Once all rendition manifests have been exhausted, the player enters a tight loop requesting the same rendition manifest endlessly
    6. Reconnect the input stream
    7. Observe the player resume playback

    Results

    Expected

    The player should continually cycle through the set of rendition manifests with some delay. This is typically enforced through the blacklistDuration.

    Error output

    VIDEOJS: WARN: Problem encountered with the current HLS playlist. Playlist no longer updating. Switching to another playlist.

    Additional Information

    videojs-http-streaming version

    videojs-http-streaming 2.2.2 possibly more

    videojs version

    VideoJS 7.6.6 VideoJS 7.8.4 possibly more

    Browsers

    • Chrome 86.0.4240.75 (64-bit) on Windows 10
    • Edge 86.0.622.43 (64-bit) on Windows 10

    Platforms

    • Consistently reproducible on Windows 10
    • Occasionally reproducible on Mac OS X 10.15.6

    Other Plugins

    No

    Other JavaScript

    No

    opened by skidder 17
  • DASH fails to start unless scrub bar is clicked

    DASH fails to start unless scrub bar is clicked

    Please do not delete the template, by filling out the required information we can investigate your issue more quickly.

    Before opening an issue see if your problem can be resolved with the troubleshooting guide.

    Description

    DASH video loads forever (or will eventually stop with "Could not download the video"). BUT if you click the scrub bar, the video starts playing.

    Happens in Firefox and OSX. Happened in Chrome when video tag was set to auto play.

    https://gist.github.com/HankBrown/3e234b586ae646fcb2c9dda7f33aa1f5

    https://jsbin.com/vozuboj/edit?html,output

    Sources

    Is a certain source or a certain segment affected? please provide a public (accesible over the internet) link to it below.

    All our dash encodings have this issue. We use ffmpeg and bento. More details if/as requested.

    Steps to reproduce

    Please see gist above.

    1. Open the gist in Firefox.
    2. Click play

    If the gist fails for some reason (my first gist) we have a simple test case at https://bh4.brownhanky.com/vjs-stream.html

    Results

    Expected

    Video should begin playing when the Big Play Button is clicked.

    Error output

    Console messages....

    This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. vjs-stream.html VIDEOJS: WARN: A plugin named "reloadSourceOnError" already exists. You may want to avoid re-registering plugins! video.js:80:49 Specified “type” attribute of “application/dash+xml” is not supported. Load of media resource https://bh4.brownhanky.com/task/90008/dash/stream.mpd failed. vjs-stream.html All candidate resources failed to load. Media load paused. vjs-stream.html Autoplay is only allowed when approved by the user, the site is activated by the user, or media is muted. video.js:23832:27 MouseEvent.mozPressure is deprecated. Use PointerEvent.pressure instead.

    Additional Information

    Please include any additional information necessary here. Including the following:

    When we encode using GPAC, we do not get this issue. However, our goal is DASH+CENC and we cannot get GPAC to produce an encrypted eencoding. But we doubt the fault is bento. When we play in other test players (JW,bitmoving,ifDASH), no issues with this encoding.

    videojs-http-streaming version

    what version of videojs-http-streaming does this occur with? videojs-http-streaming 1.11.2

    videojs version

    what version of videojs does this occur with? video.js 7.7.3

    Browsers

    what browsers are affected? please include browser and version for each

    Firefox 71.0 Chrome (when autplay is true) Version 79.0.3945.88 (Official Build) (64-bit)

    Platforms

    what platforms are affected? please include operating system and version or device and version for each

    MAC 10.13.6

    Other Plugins

    are any other videojs plugins being used on the page? If so, please list them with version below.

    "aes-decrypter": "^3.0.0",
    "argparse": "^1.0.10",
    "axios": "^0.19.0",
    "bluebird": "^3.5.4",
    "bulma": "^0.7.4",
    "chown": "^0.1.2",
    "cookie-parser": "^1.4.4",
    "cross-env": "^5.2.0",
    "dashjs": "^2.9.3",
    "express": "^4.17.1",
    "font-awesome": "^4.7.0",
    "hls-server": "^1.5.0",
    "http-attach": "^1.0.0",
    "lodash": "^4.17.15",
    "m3u8-parser": "^4.3.0",
    "mkdirp": "^0.5.1",
    "path": "^0.12.7",
    "requestretry": "^2.0.2",
    "sass-mq": "^5.0.0",
    "tus-node-server": "^0.3.2",
    "url": "^0.11.0",
    "video.js": "7.7.3",
    "videojs-contrib-dash": "^2.11.0",
    "videojs-contrib-eme": "^3.5.0",
    "videojs-errors": "^4.2.0",
    "vue-color": "^2.7.0",
    "vue-i18n": "^7.8.1",
    "vue-multiselect": "^2.1.6",
    "vue-slider-component": "^2.8.16",
    "vue-toasted": "^1.1.26",
    "vue-touch": "^2.0.0-beta.4",
    "vue2-google-maps": "^0.10.6",
    "vuejs-datepicker": "^1.5.4",
    "webpack-visualizer-plugin": "^0.1.11",
    "when": "^3.7.8"
    

    Other JavaScript

    are you using any other javascript libraries or frameworks on the page? if so please list them below. *

    vue

    outdated 
    opened by HankBrown 16
  • Not able to seek long-duration hls videos

    Not able to seek long-duration hls videos

    Player crashes with the following errors when playing long-duration (approximately 5hr) hls video. On seeking, I get these errors and the player goes on buffering until it finally crashes with error : VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists. MediaError {code: 3, message: 'Playback cannot continue. No available working or supported playlists.'}

    image
    opened by damanV5 2
  • Generating captions without passing text track to videojs player for HLS

    Generating captions without passing text track to videojs player for HLS

    We have some HLS content and don not have additional text track and our steaming URL extension is .mpd and sometimes we are getting caption by clicking on caption dialogue panel but how we can generate always or there any other way.

    opened by Jatin00555 1
  • Question - are not dependency components automatically included when importing the js file?

    Question - are not dependency components automatically included when importing the js file?

    Hi!

    I tried out the v.3.0.0 which states it uses m3u8-parser v6.0.0.

    However when I use new m3u8Parser.Parser it complains that m3u8Parser isn't found?

    Is this expected or not?

    There's no v.6.0.0 release which I can include in my js. v4.7.0 is the latest. I can include this before videojs but then I guess v.6.0.0 won't be used?

    opened by JeppeTh 0
  • Playback problem in WKWebView and iOS 16.1 on iPad with MSE

    Playback problem in WKWebView and iOS 16.1 on iPad with MSE

    Description

    I have an iOS app based on a WKWebView, which uses videojs internally to play HLS streams (using MSE, which is available on iPads, our target device). Since upgrading our test iPads to iOS 16.1, we are encountering playback problems after a couple of minutes, with stuttering, buffering and usually full playback stop. The issue is fully described in this post, with a description of a test environment to reproduce the problem in iOS emulator using a trivial cordov app:

    https://developer.apple.com/forums/thread/719080

    The app running in the iOS 15.4 emulator works fine. But fails when running in iOS 16 emulator.

    Steps to reproduce

    I am able to reproduce the issue in iOS emulator using a test cordova app, as follows.

    1. First setup cordova environment:
    npm install cordova
    export PATH=$PWD/node_modules/.bin:$PATH
    
    1. Create a new cordova app and add iOS platform
    cordova create video com.example.test.video "Test Video"
    cd video
    cordova platform add ios
    
    1. Edit config.xml and add the following as children of the <widget> element
    <access origin="*" />
    <allow-navigation href="*" />
    <preference name="AllowInlineMediaPlayback" value="true" />
    
    1. Edit config.xml and change the <content> tag as follows (this is a public URL hosted on our server that contain a video.js player to play Sintel movie through HLS):
    <content src="https://lincserver-azure.api.lincor.com/html/sintel-hls-videojs.html" />
    
    1. Prepare cordova iOS app
    cordova platform add ios
    cordova prepare ios
    
    1. Open the project platforms/ios/Test Video.xcodeproj in Xcode, build it and then run it in iOS emulator.

    When running on iOS 16.1 iPad emulator, playback starts failing at about the 2min mark. There's no issue on iOS 15.4 emulator.

    Results

    Expected

    Video plays normally.

    Error output

    After a couple of minutes, playback starts stuttering, buffering. On real iPad hardware, it can also completely stops.

    Additional Information

    videojs-http-streaming version

    videojs-http-streaming 2.14.2

    videojs version

    video.js 7.20.2

    Browsers

    Cordova app using WKWebView

    Platforms

    iOS 16.1 (on iPad, using MSE)

    opened by goffioul 2
  • Is there a way to know the segment information of the video currently being played in hls live?

    Is there a way to know the segment information of the video currently being played in hls live?

    Hello this is Steve.

    Is there a way to know the segment information of the video currently being played in hls live?

    Also, I would really appreciate it if you could tell me if I could catch the event of cue-out, cue-in, and discontinuity of the currently playing video.

    opened by dnxodl1001 7
  • Live + AES javascript error - Uncaught TypeError: Cannot read properties of undefined (reading 'slice')

    Live + AES javascript error - Uncaught TypeError: Cannot read properties of undefined (reading 'slice')

    Description

    I'm playing an HLS stream encoded with AES symetric key (Azure Media services live with AES enabled) When the videojs player try to switch to another bandwidth (by user interaction or network bandwidth evolution) there is a javascript error here : https://github.com/videojs/http-streaming/blob/1e2f7a42aecdd26f127374888b4c8664ca6d245f/src/media-segment-request.js#L579 Uncaught TypeError: Cannot read properties of undefined (reading 'slice') after that, the player is frozen and is not usable anymore

    adding a console.log show key.bytes is undefined adding and early return here to prevent error remove the error, but the player stay unuseable

    Sorry, I can't let a test case opened because a live streaming cost money.

    The videojs version is the latest one : 7.21.0 The bug is always reproduced in the described scenario

    On VOD (video on demand, not live scenario) the bug is NOT reproduced

    Sources

    https://github.com/videojs/http-streaming/blob/1e2f7a42aecdd26f127374888b4c8664ca6d245f/src/media-segment-request.js#L579 key.bytes is undefined

    Steps to reproduce

    Create a videojs player playing a multi-stream HLS AES secured stream, and change played bandwidth

    Results

    Expected

    Playing well, without error

    Error output

    VideoPlayer.js?9e5f:345 error TypeError: Cannot read properties of undefined (reading 'slice') at decrypt (video.es.js?f0e2:42462:1) at eval (video.es.js?f0e2:42654:1) at eval (video.es.js?f0e2:42150:1) at callbackWrapper (video.es.js?f0e2:31135:1) at Object.eval [as callback] (video.es.js?f0e2:31160:1) at cbOnce (index.js?3603:104:1) at XMLHttpRequest.loadFunc (index.js?3603:178:1)

    Additional Information

    Please include any additional information necessary here. Including the following:

    videojs-http-streaming version

    what version of videojs-http-streaming does this occur with? videojs-http-streaming 2.15.0 according to video.js sources

    videojs version

    videojs 7.21.0

    Browsers

    what browsers are affected? please include browser and version for each chrome Version 107.0.5304.107 (Build officiel) (64 bits)

    Platforms

    what platforms are affected? please include operating system and version or device and version for each Window 10

    Other Plugins

    are any other videojs plugins being used on the page? If so, please list them with version below. yes

    Other JavaScript

    are you using any other javascript libraries or frameworks on the page? if so please list them below. no

    opened by ChoOo7 2
Releases(v3.0.0)
Owner
Video.js
Web Video Framework
Video.js
Streaming and playing on the Nintendo Switch remotely!

Switch-Stream This is a semi-convoluted application as a proof-of-concept that someone could play their Switch from a distance. A server is connected

Charles Zawacki 8 May 2, 2022
An example repository on how to start building graph applications on streaming data. Just clone and start building 💻 💪

Example Streaming App ?? ?? This repository serves as a point of reference when developing a streaming application with Memgraph and a message broker

Memgraph 40 Dec 20, 2022
A transparent, in-memory, streaming write-on-update JavaScript database for Small Web applications that persists to a JavaScript transaction log.

JavaScript Database (JSDB) A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to

Small Technology Foundation 237 Nov 13, 2022
Like JSON-RPC, but supports streaming.

Earthstar Streaming RPC Similar to JSON-RPC, but also supports streaming (soon). Written to be used in Earthstar (github, docs). Table of Contents Usa

Earthstar Project 5 Feb 10, 2022
Nodeparse - A lightweight, vanilla replacement for Express framework when parsing the HTTP body's data or parsing the URL parameters and queries with NodeJS.

nodeparse A lightweight, vanilla replacement for Express framework when parsing the HTTP body's data or parsing the URL parameters and queries with No

Trần Quang Kha 1 Jan 8, 2022
This is a boilerplate for Nodejs (Nestjs/typescript) that can be used to make http server application.

Hexagonal architecture Table of Contents Overview Code architecture source code Service build information Regular user Advanced user Deployment Helm K

Moeid Heidari 20 Sep 13, 2022
XML/HTML parser and processing library for JavaScript and TypeScript

[VIEW DOCUMENTATION] Robin is an XML parser and processing library that supports a sane version of HTML. It features a set of DOM utilities, including

null 15 Oct 5, 2022
A tiny javascript + Flash library that enables the creation and download of text files without server interaction.

Downloadify: Client Side File Creation Important! The swf has been compiled for online use only. Testing from the file path (i.e. file:// ) will not w

Doug Neiner 853 Nov 21, 2022
A node.js locks library with support of Redis and MongoDB

locco A small and simple library to deal with race conditions in distributed systems by applying locks on resources. Currently, supports locking via R

Bohdan 5 Dec 13, 2022
Fast File is a quick and easy-to-use library to convert data sources to a variety of options.

Fast File Converter The Express.js's Fast File Converter Library Fast File Converter Library is a quick and easy-to-use library to convert data source

Ali Amjad 25 Nov 16, 2022
A javascript library to run SQLite on the web.

SQLite compiled to JavaScript sql.js is a javascript SQL database. It allows you to create a relational database and query it entirely in the browser.

SQL.JS 11k Jan 7, 2023
Couchbase Node.js Client Library (Official)

Couchbase Node.js Client The Node.js SDK library allows you to connect to a Couchbase cluster from Node.js. It is a native Node.js module and uses the

null 460 Nov 13, 2022
Nano: The official Apache CouchDB library for Node.js

Nano Offical Apache CouchDB library for Node.js. Features: Minimalistic - There is only a minimum of abstraction between you and CouchDB. Pipes - Prox

The Apache Software Foundation 578 Dec 24, 2022
The Cassandra/Scylla library you didn't want but got anyways.

Installation Using npm: npm install scyllo or if you prefer to use the yarn package manager: yarn add scyllo Usage import { ScylloClient } from 'scyll

LVK.SH 7 Jul 20, 2022
DolphinDB JavaScript API is a JavaScript library that encapsulates the ability to operate the DolphinDB database, such as: connecting to the database, executing scripts, calling functions, uploading variables, etc.

DolphinDB JavaScript API English | 中文 Overview DolphinDB JavaScript API is a JavaScript library that encapsulates the ability to operate the DolphinDB

DolphinDB 6 Dec 12, 2022
This library helps implement caching using Cloudflare Workers KV

With a few lines of code, you can control the execution of functions that you want to cache for speed, store them in the cache, and skip execution of the function if the cache exists.

AijiUejima 8 Oct 20, 2022
A MySQL Library for Node.js

A MySQL Library for Node.js

Blaze Rowland 3 Mar 14, 2022
A database library stores JSON file for Node.js.

concisedb English | 简体中文 A database library stores JSON file for Node.js. Here is what updated every version if you want to know. API Document Usage B

LKZ烂裤子 3 Sep 4, 2022
A Node.js library for retrieving data from a PostgreSQL database with an interesting query language included.

RefQL A Node.js library for retrieving data from a PostgreSQL database with an interesting query language included. Introduction RefQL is about retrie

Rafael Tureluren 7 Nov 2, 2022