Giter VIP home page Giter VIP logo

rx-player's Introduction

RxPlayer's logo RxPlayer's logo

📖 API documentation - Demo - 🎓 Getting Started - 🔧 Contributing



The RxPlayer is a library implementing a DASH and Microsoft Smooth Streaming media player on a browser, by relying on the HTML5 Media Source Extensions and Encrypted Media extensions browser APIs.


Originally designed to power Canal+ many applications, the RxPlayer is today used in production by several companies in multiple countries and runs on most devices where a browser can run: Computers, phones, set-top-boxes, smart TVs, game consoles and other peculiar environments are all supported and able to profit from its many features.

Its main goals are:

  • Stability: The RxPlayer can play live and On Demand DASH and Smooth contents for extended amounts of time, with or without DRM - without any performance, memory or logic issue.

    If you encounter a new issue while using it, we'll be very happy to help fixing it. Any encountered bug is put at high priority.

  • Quality of experience: It aims to play the best possible quality without any rebuffering.

    Unsupported codecs and undecipherable qualities (e.g. higher qualities with more drastic DRM conditions on untrusted devices) are automatically filtered out, even if this happens during playback.

    The player is also very resilient: any temporary network issue, fall in bandwidth, poorly-packaged content or platform quirk should be properly handled with the main goal of avoiding playback interruption.

  • Portability: The RxPlayer has been ported to a lot of devices, some on the lower-end of performance and memory capabilities and others on the higher end.

    As such, it can adapt to important memory and performance constraints while still being able to retain its many features.

  • Configurability: The RxPlayer has a plethora of options to let you tweak its behavior. You should be able to play any content the way you want, on any device.

    You should also be able to integrate complex supplementary logic like Peer-to-Peer solutions.

  • Easy to use: We try hard to make this player easy to integrate and to use in various codebases.

    Even for the more advanced options, we aim to make our documentation as legible and as complete as possible.

The RxPlayer has probably already all the features you want :)!

Even if that's not the case, we will be very pleased to exchange with you on it and look forward for external contributions.

How to use it?

The fastest way to use the player directly in your code is to add this repository as a dependency.

You can do it via npm or yarn:

# when using npm:
npm install --save rx-player

# or, when using yarn instead:
yarn add rx-player

You can then directly import and use the RxPlayer in your code:

// import it ES6 style:
import RxPlayer from "rx-player";

// same in CommonJS style:
// const RxPlayer = require("rx-player");

// instantiate it
const player = new RxPlayer({
  videoElement: document.querySelector("video"),
});

// play a video
player.loadVideo({
  url: "http://vm2.dashif.org/livesim-dev/segtimeline_1/testpic_6s/Manifest.mpd",
  transport: "dash",
  autoPlay: true,
});

We've also written short tutorials to help you familiarize with the RxPlayer API:

To be able to play with the player without needing to perform any setup we also created multiple live-editable demos:

Minimal Builds

To reduce the size of the final code, you might also want to import a minimal version of the player and only import the features you need. This is documented here :

For example, to play encrypted DASH contents, you could just write:

import RxPlayer from "rx-player/minimal";
import { DASH, EME } from "rx-player/features";

// Allow to play encrypted DASH contents
RxPlayer.addFeatures([DASH, EME]);

API

We documented the API in every little details in the API documentation.

You can also refer to the documentation of our previous versions here

These documentation pages are automatically generated from the content of the doc/api directory in this repository.

Demo

You can view our online Demo, built from our last version, here.

This demo is a small application written in React demonstrating a simple usage of the player.

Demo pages for our previous versions are also available here.

Contribute

Details on how to contribute is written in the CONTRIBUTING.md file at the root of this repository.

Dependencies

After cloning our repo, you should first install our dependencies via either npm:

npm install

Why a new player?

A need for an advanced media player

Canal+ Group is a media company with many advanced needs when it comes to media playback: it provides both live and VoD stream with multiple encryption requirements, supports a very large panel of devices and has many other specificities (like adult content restrictions, ad-insertion, Peer-To-Peer integration, low-latency live streaming...).

When the time came to switch from a plugin-based web player approach to an HTML5 one back in 2015, no media player had the key features we wanted, and including those needs into an already existing media player would not be straightforward either.

The R&D department of Canal+ Group thus started to work on a new featureful media-player: the RxPlayer. To both help and profit from the community, it also decided to share it to everyone under a permissive open-source licence.

Now, more than 8 years later, the RxPlayer continues to evolve at the same fast pace to include a lot of features and improvements you may not find in other media players. You can look at our API documentation, tutorials and our demo page (an RxPlayer instance is available in the console through the global player variable there) to see if it matches your need.

A featureful player

With the help of a carefully-crafted and well-documented architecture, we were able to quickly support avanced features when we - or the community - needed them. Amongst those:

  • support for live and VoD DASH / Smooth / HLS* / Downloaded contents / MP4* / WebM* contents and more

  • support of advanced encryption configuration, such as multiple keys in a single or separate licences for a given content (with automatic fallbacks when we found an un-decipherable content), persistent licenses, and other device-specific restrictions.

  • support for low-latency DASH streams

  • support of TTML, WebVTT, SAMI and SRT subtitles

  • an available WebAssembly-based MPD parser for DASH contents, allowing to drastically reduce the loading time and memory usage of larger contents.

  • advanced APIs for advanced use-cases (audio-only mode, video track selection, manual garbage collection of segments, Peer-To-Peer integration, quality filtering...)

  • advanced adaptive streaming algorithms making use of both a network-based approach (for quick start-up) and a buffer-based one (to provide the best quality possible).

  • advanced optimizations for devices with low memory constraints

  • a complex segment scheduling logic, prioritizing closer media segments while making sure that the bandwidth usage is always optimal and the rebuffering risks always low.

* In "directfile" mode, on compatible browsers

rx-player's People

Contributors

achrafl0 avatar alexduros avatar axmannessiez avatar beaufortfrancois avatar dependabot[bot] avatar florent-bouisset avatar grenault73 avatar jilles-sg avatar jinroh avatar johnhollen avatar king-prawns avatar klatoszewski-oke avatar kylekatarnls avatar lfaureyt avatar lukaszzdanikowski avatar mattiaspalmgren avatar paulrosset avatar peaberberian avatar stephanterning avatar steve-taylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rx-player's Issues

Let the user choose its Promise polyfill

Why imposing the Promise implementation? Wouldn't it be better to let the user use whatever he wants to polyfill it and just use the standard Promise API inside rx-player? This would allow people to use other libs like bluebird, Q or RSVP.

DASH: Take MPD@minimumUpdatePeriod into account

Take MPD@minimumUpdatePeriod into account to limit the frequency of manifest-refreshing.

For now, we always assume it is equal to 0 (we refresh the manifest as we need it).

This may be needed on future canalplus targets.

Release 3.9.0 MediaCapabilitiesProber

Hello :)

Thank's for the new release especially concerning the MediaCapabilitiesProber, it's precisely what we expected!

However, we are encountering a major bug concerning the fairplay drm on Safari 12.0.1.
Even if we are using the hls.js player which is completed separated from the rx-player, just the fact to import:
import { mediaCapabilitiesProber } from 'rx-player/experimental/tools';
Break the support of drm on the hls player, an exception is throw:
error
This problem is encountered only since the latest release (3.9.0) and only concern Safari, it works well on IE11 and others browsers...

Seems a very strange issue but an important one.

Thank's :)

Need help to use a dash manifest with server license acquisition

Hi,

I would like to use the player with a dash manifest, and need to acquire a license with a server given. The DRM is playready.
I have the custom data, the server url and the manifest, however I couldn't read the video, by following the wiki.
I have tried to provide a promise to make the request to the server for the license, but I haven't been able to play the video. I notice however that the player does retrieve the video length.

Could you give some advice on how I could do this ? Unfortunately, I didn't find anything else that Silverlight players to acquire the license, meaning I can't see how it is implementend.

Thanks

Unable to read Smooth Streaming stream if traf boxes are not in the expected order

Hello all,

In our stream, the traf box was built by putting tfxd and tfrf boxes before the trun box:

traf
 tfhd
 tfxd
 tfrf
 trun
 [...]

As a result, it was not possible to play Smooth Streaming streams.

We solve it by changing the order of the boxes (tfxd and tfrf after trun)

The problem may be located in src/transports/smooth/mp4_utils.ts:

// reads [moof[mfhd|traf[tfhd|trun|..]]]
const tfdtlen = newtfdt.length;
const mfhdlen = be4toi(oldmoof, 8);
const traflen = be4toi(oldmoof, mfhdlen + 8);
const tfhdlen = be4toi(oldmoof, mfhdlen + 8 + 8);
const trunlen = be4toi(oldmoof, mfhdlen + 8 + 8 + tfhdlen);

Also note that CMAF specification (ISO/IEC 23000-19) recommends to put tfdt after tfhd (7.3.1 CMAF Boxes)

Even if this box may not be used for Smooth, it may be present.

Hope this helps,

--
sym39

Documentation & Architecture

Hi,

I am considering using your library but it really hard to follow the code without documentation.
It would be great to have some documentation to understand what each file is doing.

An Architecture section in the wiki would be great aswell.

Unable to run application in local

Hi Today I tried to start the application in local but getting below error.

'RXP_ENV' is not recognized as an internal or external command,
operable program or batch file.

Can you please let me know how can I resolve this issue?

DASH: Manage thumbnail tracks

The DASH-IF IOPs 4.1 now gives recommendations for thumbnail tracks in a MPD (clause 6.2.6).

We should implement it as a POC to test thumbnail tracks on live contents.

This might be needed in-house and would be great for the community anyway.

Allow playback of mixed crypted/unencrypted contents on Chrome

Chrome can be locked indefinitely when playing a mix of encrypted/unencrypted contents.
This happens mostly when the first content played is unencrypted.

It is due to the fact that we create a MediaKeys instance - which allows to decrypt content - only on the first encrypted content encountered and Chrome does not seem to work well when "attaching" a MediaKeys to the media element while content has already begun.

A first attempt has been made by creating and attaching the MediaKeys at the same time the Manifest is loaded - even if the content loaded is not encrypted, but IE11 sadly throw in those cases.

From there, we're going towards two possible solution:

  • work-around IE11 specific implementation
  • always wait for the first initialization segment to be pushed before attaching a MediaKeys instance and blocking playback until it is done

Speed manager pauses the video when player state is LOADED

Hi!

We've noticed that the player will sometimes pause to build a buffer. This seems to happen when the speed_manager.js receives a stall event.

This is a console output from a Firefox-session where autoPlay is set to false:

Stream: canplay event initial_seek_and_play.js:62
Stream: Stream is loaded. stream_loader.js:104
API: playerStateChange event LOADED index.js:1645
API: new clock tick 
Object { bufferGap: 5.983333333333333, buffered: TimeRanges, currentRange: {…}, currentTime: 0.05666666666666667, duration: 3516.84, ended: false, paused: true, playbackRate: 1, readyState: 1, seeking: true, … }
clock.js:218
Buffer: update downloading queue audio representation_buffer.js:171
SpeedManager: Pause playback to build buffer speed_manager.js:55
API: playerStateChange event SEEKING index.js:1645
Buffer: update downloading queue video representation_buffer.js:171
API: new clock tick 
Object { bufferGap: 5.983333, buffered: TimeRanges, currentRange: {…}, currentTime: 0.056667, duration: 3516.84, ended: false, paused: true, playbackRate: 0, readyState: 3, seeking: false, … }
clock.js:218
Buffer: update downloading queue audio representation_buffer.js:171
SpeedManager: Resume playback speed 1 speed_manager.js:62
API: playerStateChange event PAUSED

In this example, the video is first considered LOADED. For some reason, it will then perform a seek which will cause a stalled event. When the buffer is ready, the player will go to a PAUSED state.

I would expect the player state to stay LOADED until the user press play?

Here is some additional output from the debug window in the reference player:

2018-11-21T13:15:25.114Z - A new content is Loading.
2018-11-21T13:15:25.183Z - Audio Bitrate changed to 48000
2018-11-21T13:15:25.187Z - Video Bitrate changed to 300000
2018-11-21T13:15:25.431Z - The new content has been loaded.
2018-11-21T13:15:25.459Z - The current content is seeking
2018-11-21T13:15:25.484Z - The current content is not seeking anymore

Thanks!

DASH: manage XLINKS

The rx-player should be able to manage XLINKS in a DASH MPD.

This might be useful with future ad-insertion use cases.

Cannot play dash manifest provided in demo app

Hi,

I'm trying to play one of the dash manifests provided in the React demo app in a raw javascript application of my own.

I've included the rx-player source from dist/rx-player.min.js.

index.html

<!doctype HTML>
<html>
  <head>
    <title>Rx-Player Demo</title>
    <meta charset="utf-8" />
   </head>
  <body>
    <video controls id="video-player">
    </video>
    <script src="javascript/vendor/rx-player.min.js"></script>
    <script src="javascript/application.js"></script>
  </body>
</html>

application.js

var player = new RxPlayer({videoElement: document.getElementById('video-player')})
var params = {
    url: "http://dash-vod-aka-test.canal-bis.com/test/pub-cube-s/index.mpd",
    transport: "dash",
    keySystems: null,
    autoPlay: true
};
player.loadVideo(params);

The player doesn't play the content (no video output).

The video duration (1:04) is correctly displayed on the video controls.

The players seems to correctly load the data chunks on page loading and when I move the time slider:

  • GET "http://dash-vod-aka-test.canal-bis.com/test/pub-cube-s/index.mpd".
  • GET "http://dash-vod-aka-test.canal-bis.com/test/pub-cube-s/le-cube-s-output_video_300kbps.mp4".
  • GET "http://dash-vod-aka-test.canal-bis.com/test/pub-cube-s/le-cube-s-output_audioFR_96kbps.mp4".

But the player seems stuck in the LOADING state.

Player.getDebug() information can be found here.

Browser info:

  • Chromium 43.0.2357.65 (Developer Build) Built on 8.0, running on Debian 8.1 (64-bit)
  • Revision bbd9270c4234d436bb05bd4502b230fc17887d08
  • OS Linux
  • Blink 537.36 (@195283)
  • JavaScript V8 4.3.61.21

The provided LIVE dash manifest (http://live.unified-streaming.com/loop/loop.isml/loop.mpd?format=mp4&session_id=25020) works fine.

Am I missing something?
Thanks.

Some contents never end

Hi, I have some trouble using playerStates of rx-player library.

I work on an app which used to work with the one-player-core library derivated from the V2 rx-player.

I have followed the upgrading documentation, and made some tweaks to make the new player work :

  • subscribing to positionUpdate instead of currentTimeChange
  • replacing timeFragment by startAt
  • and so on ...

However, I get a strange issue; some contents streamed (through Smooth Streaming) on the player never end :

The player doesn't reach the ENDED state but loop on the BUFFERING state instead.

Weirdly, the videoElement itself never reaches the ended state, while the content used to work on the previous version of the player.

Do you have any idea of which can explain this new behavior ?

Logo

Hi, I'm a logo designer, I saw your project and I can make a free logo for your project. So, what do you think?

getVideoBitrate: instant playing bitrate

getVideoBitrate api returns the currently downloaded bitrate instead of the currently played bitrate.

We should make it clear in the documentation or provide two distinct APIs.

Seeking isn't work on IExplorer 11.0

Hey. I'm trying full demo on my local machine but i can't seek the video with IExplorer 11.0.9600.17728 on Windows 8.1 x64. Everything is working perfectly pause, play, mute, volume controls etc but i can't seek the video. IExplorer 11 is supported am i wrong ? Thanks!


Edit : Seeking only works with DirectFile mod.


Edit 2 : I have no idea why but standalone demo isn't start playing on iexplorer. But it works with chrome. I really need help about iexplorer problems. Because i wanna use it with c# webbrowser control.

Behavior at the end of play

Hi :),
I have some trouble playing the last seconds of my video using rx-player library.
After some research I found that there is a END_OF_PLAY constant :

  /**
   * Time before the end of a video (in seconds) at which the player should
   * automatically stop.
   * It happens often that the video gets stuck 100 to 300 ms before the end,
   * especially on IE11 and Edge
   * @type {Number}
   */
  END_OF_PLAY: 0.5,

that limit the playing time of the streams

  /**
   * End-Of-Play emit when the current timing is really close to the end.
   * @see END_OF_PLAY
   * @type {Observable}
   */
  const endOfPlay = timings$
    .filter(({ currentTime, duration }) => (
      duration > 0 && duration - currentTime < END_OF_PLAY
    ));

and later

  return createAndPlugMediaSource(
    url,
    videoElement,
    withMediaSource,
    sourceBufferMemory
  )
    .mergeMap(startStream)
    .takeUntil(endOfPlay);

I have a particular use-case that requires to read the very last frame of a video.
Could you change END_OF_PLAY into a configurable variable ?
I also noticed that a ENDED status automatically lead to a stop action. Is it possible to disable this behavior ?

update version on npmjs.org

Currently latest available version on npmjs.org is v1.4.2 And in this repo latest release it 2.3.2

Is there any particular reason why npmjs.org "latest" version is 1.4.2 and not 2.3.2?

Demo

Why not post real online demo ?

DASH: support multiple Periods

For now, only the first Period is considered in DASH manifests.

Please however note that:

  • This is not an urgent usecase for now
  • it has a high chance of provoking breaking change(s)
  • it is not a small dev

Add possibilty to update language preferences at any time

For the moment, the only way to set the language in advance is through two loadVideo options:

  • defaultAudioTrack: set the first chosen audio track
  • defaultTextTrack: set the first chosen text track

This is very limited. For example, the following cases are not handled:

  • we do not know which languages will be available on the content, and we have several preferred languages (e.g. italian or french):

    For example, let's consider multiple multilingual contents. If a content has an italian track, we want to chose it. If it has not, but it has a french track, we want to chose it instead.

    For now, we have to chose a single language in advance (e.g. "italian") and if the corresponding manifest does not have this language, there's no way of setting a fallback language. We will automatically fallback to the first track declared in the Manifest.

  • we're playing a multi-period content and we want to update in advance the language chosen for the next period:
    Let's imagine that we're playing a live content with the current program being in english and the next one being in armenian. While we're playing the first program, we want to update our language preferences so that the next program will be in armenian if available. For the moment, we cannot - we're stuck with the single preference given at the beginning.

The current feature we're implementing to resolve those issues introduce the following constructor options:

  • preferredAudioTracks: for an ordered (from the most preferred to the least) list of audio tracks languages
  • preferredTextTracks: for an ordered (from the most preferred to the least) list of text tracks languages

We're also bringing four new methods:

  • getPreferredAudioTracks
  • getPreferredTextTracks
  • setPreferredAudioTracks
  • setPreferredTextTracks

To allow those choices to be updated at any time.

To stay with a simple API, this new feature will deprecate the current intialAudioTrack and initialTextTrack loadVideo options.

You can follow the current development here: #477

This is scheduled for a future v3.11.0 at the moment.

dash livestream plays only until next .mpd request

Hi there,

since rc6 I have the following "bug":

If I set no setMaxBufferAhead value, the player is stuck at LOADING state, and under the network tab in the dev tools I can see, that the download of the .m4v and .m4a files is canceled.

If I set setMaxBufferAhead to sth around 10 - 20 for testing, it works until it downloads the next .mpd file. The state of the player is then still PLAYING, but there is no video anymore.

Everything worked fine in rc4.

This is my nginx config:

live on;
dash on;
dash_playlist_length 30s;
dash_fragment 5s;

This is maybe not a bug in rx-player but rather my nginx config.

Best
CLEMARC

AutoPlay for HTML5 <video>: detect "Unhandled Promise Rejection: "

Current state of affairs

With desktop Safari, Chrome and others starting to block playback for HTML5 <audio> and <video> "without user action" similar to iOS Safari and mobile Chrome, with some special rules and exceptions for major sites like YouTube et al.
The Webkit announcement. Important note: users can disable auto-play entirely, even for silent videos.
https://webkit.org/blog/7734/auto-play-policy-changes-for-macos/

The Chromium project is following the same policy from version M66 Stable.
https://sites.google.com/a/chromium.org/dev/audio-video/autoplay

Possible solution

On iOS Safari 11 the media element's method .play() returns following:
Unhandled Promise Rejection: NotAllowedError (DOM Exception 35): The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
Anyway, I get to catch this while using rx-player ?

The recommended way by Apple is:

var promise = document.querySelector('video').play();

if (promise !== undefined) {
    promise.catch(error => {
        // Auto-play was prevented
        // Show a UI element to let the user manually start playback
    }).then(() => {
        // Auto-play started
    });
}

Typescript

Hello!

Are you exposing your types?

I'm using rx-player and Typescript but I had to silent Type missing error by declaring the rx-player in my modules.d.ts.

Provide better code documentation

Now that our last major period of refactoring is finished, we should provide documentation about the code's architecture to help contributions.

Video Duration Is Incorrect In Demo Smooth Player

Hey. Thanks for this player it's working really good. I load a custom smooth link to your demo page but it's taking the wrong duraion. My video lenght is : 01:47:34 but it's looking like 01:01:33. Is this problem related with my content ? I tried another video which has a 04:34:58 lenght but your demo player saying it's 04:04:57. Could you check it please ? Thanks!


And i should ask you something. I don't any experience with website and html players. Can i make this player work locally on my pc ? And can i send command it with c# without touching any controller ? For example go to 00:10:15 i think it can be done with javascript ? I have private wowza streaming server so i need player too. Thanks again!

Support "trickmodes" tracks in DASH as a possible source for thumbnails

The DASH-IF IOPs specify a specific "trickmodes" AdaptationSet which allows to define I-Frame only tracks. This is originally meant to be displayed when using features like fast-forward or rewind (to imitates VHS behavior).

With the RxPlayer, we do not really have this need now. What we propose instead is to use those same tracks to generate helpful thumbnails to be displayed while seeking.

Please note that this is still an idea in a really early phase, not a fixed goal for a future release.

Impossibility to play a SegmentTimeline-based DASH with a $Number$ placeholder

In the current code, if a DASH adaptation/representation with a SegmentTimeline index is encountered, it immediately infer that we are based on $Time$ placeholders on the media.

It thus does not calculate the number of the segment, leading to replace any $Number$ reference in the media by undefined.

Example of a content for which this behavior causes problems:
https://storage.googleapis.com/shaka-live-assets/player-source.mpd

Exporting variables that have not been declared in modular build

I got an error from jest, that indicate that a variable in the modular build is exported but have not been declared.
Here is the error:

<projects>/node_modules/rx-player/dist/_esm5.processed/compat/constants.js: Exporting local "ICompatVTTCue", which is not declared.

export { HTMLElement_, ICompatVTTCue, MediaKeys_, MediaSource_, READY_STATES, VTTCue_, isFirefox, isIE, };

When I go to the concerned file, indeed ICompatVTTCue is not declared.

Thank's :)

First cue is not removed on disableTextTrack

We are having some problems with disableTextTrack when using HTMLTextSourceBuffer.

Reproduce by:

  1. Play https://svt-vod-4n.akamaized.net/world/20181212/746b03f8-40a5-4e1b-8c46-787ef074dab4/manifest.mpd with DASH/Custom Link
  2. Turn on swedish subtitle track
  3. Turn off swedish subtitle track
  4. Seek to start (the first cue is still visible)

The issue is that the TextBufferManager keeps the first cue when remove is called.

We think that getCuesBefore is incorrect, because it will return the first cue on getCuesBefore(cues, 0).

Here's an attempt at a solution https://github.com/SVT/rx-player/blob/fix/get-cues-before/src/core/source_buffers/text/html/buffer_manager.ts#L82.

Also, see this commit which changed the logic 8 months ago: 91995c3

What are your thoughts?

[Need help] Dash + widevine Axinom

Hello,
I trying to play a widevine protected DASH stream.

I didn't understand what I should return in the getLicense method.

Any help would be be highly appreciated.

player.loadVideo({
  url: "//media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd",
  transport: "dash",
  autoPlay: false,
  keySystems: [
    {
      type: "widevine",
      getLicense(message, messageType) {
        console.log("Message");
        var msg = message;
        console.log("Message type: " + messageType);
        return new Promise((resolve, reject) => {
          return fetch("https://drm-widevine-licensing.axtest.net/AcquireLicense", {
          body: msg,
          headers: {
            "X-AxDRM-Message": 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.4lWwW46k-oWcah8oN18LPj5OLS5ZU-_AQv7fe0JhNjA',
          },
          method: "POST"
        })
        .then((response)  => {
            if (response.ok) {
              response.arrayBuffer().then(function(buffer) {
                resolve(buffer);
              });
            } else {
              reject(new Error('error'))
            }
          }, error => {
            reject(new Error(error.message))
          })
          });
      },
    }
  ]
});

Not fit for purpose

actual pop up error alerts
hard to slide position (no knob)
hard to adjust volume ( no visual indication of max to min)
fullscreen button fails to go to a fullscreen view
lacks indication of elapsed/remaining time and length
Uncaught IndexSizeError: Failed to set the 'volume' property on 'HTMLMediaElement': The volume provided (1.00176) is outside the range [0, 1].
not sure if reactive extensions is helping out there much

Use Media Capabilities Decoding Info API

The Media Capabilities API is an API for querying the user agent about decoding and encoding capabilities of the device, providing better information about the display properties, and real-time feedback about playback so that adaptive streaming can better alter the quality of content based on user perceived quality. The intent of this API is to give more control for content delivery while providing a better user experience.

I think this would be great to integrate it into rx-player as it is going to be enabled by default in Chrome 66 and is already used by YouTube.

Resources:

Support a "directfile" mode

The Rx-Player should support a "directfile" mode, where it would be possible to manage mp4/webm or even audio files directly on the browser (by just setting their URL on the given videoElement)

This is a feature often asked by people outside canalplus, but we might also need it in-house
in the future.

API MediaCapabilitiesProber

We are starting to implement the new API for media capabilities, but we found a problem in the implementation of it.

Tested environment

Firefox Developer Edition, Version 63.0b4 (64 bits)

Expected behavior

With the given config pass in second parameter to isDRMSupported:

isDRMSupported("com.widevine.alpha", config)

{
  "initDataTypes": [
    "cenc"
  ],
  "videoCapabilities": [
    {
      "contentType": "video/mp4;codecs=\"avc1.4d401e\"",
      "robustness": "HW_SECURE_ALL"
    },
    {
      "contentType": "video/mp4;codecs=\"avc1.4d401e\"",
      "robustness": "HW_SECURE_DECODE"
    },
    {
      "contentType": "video/mp4;codecs=\"avc1.4d401e\"",
      "robustness": "HW_SECURE_CRYPTO"
    },
    {
      "contentType": "video/mp4;codecs=\"avc1.4d401e\"",
      "robustness": "SW_SECURE_DECODE"
    },
    {
      "contentType": "video/mp4;codecs=\"avc1.4d401e\"",
      "robustness": "SW_SECURE_CRYPTO"
    }
  ],
  "audioCapabilities": [
    {
      "contentType": "audio/mp4;codecs=\"mp4a.40.2\"",
      "robustness": "HW_SECURE_ALL"
    },
    {
      "contentType": "audio/mp4;codecs=\"mp4a.40.2\"",
      "robustness": "HW_SECURE_DECODE"
    },
    {
      "contentType": "audio/mp4;codecs=\"mp4a.40.2\"",
      "robustness": "HW_SECURE_CRYPTO"
    },
    {
      "contentType": "audio/mp4;codecs=\"mp4a.40.2\"",
      "robustness": "SW_SECURE_DECODE"
    },
    {
      "contentType": "audio/mp4;codecs=\"mp4a.40.2\"",
      "robustness": "SW_SECURE_CRYPTO"
    }
  ],
  "persistentState": "optional"
}

We are expecting that isDRMSupported to return true.

Current behavior

isDRMSupported return false with the above config.

However, when we don't pass the config, isDRMSupported is returning true as expected.

Additional

I also noticed, that you accept an object type as config in second parameter of isDRMSupported that can lead to misunderstood since the native function navigator.requestMediaKeySystemAccess(keySystem, configuration) accept an array as config.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.