Skip to content

Commit

Permalink
Merge branch 'release/v3.20.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Apr 22, 2020
2 parents 4ad6109 + c554f4b commit 2569aa1
Show file tree
Hide file tree
Showing 92 changed files with 15,628 additions and 10,902 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## v3.20.0 (2020/04/22)

### Features

- api: add `disableVideoTrack` method
- api: add the `preferredVideoTrack` constructor option and `setPreferredVideoTracks` / `getPreferredVideoTracks` methods to set a video track preference (or to start with the video track disabled).
- api: add optional `codec` property to preferred audio tracks APIs, allowing applications to communicate a codec preference.
- api: make the `language` and `audioDescription` properties in `preferredAudioTracks`' objects optional.
- api: add `signInterpreted` to `getVideoTrack` and `getAvailableVideoTracks` return objects to know when a track contains sign language interpretation

### Deprecated

- api: deprecate the `getManifest()` method
- api: deprecate the `getCurrentAdaptations()` method
- api: deprecate the `getCurrentRepresentations()` method

### Bug fixes

- compat/eme: Set proper EME Safari implementation, to play contents with DRM on it without issues
- compat/directfile/iOS: On Safari iOS, fix auto-play warnings when a directfile content is played with the `playsinline` attribute set.
- directfile: In Directfile mode, always disable the current text track when a `null` is encountered in the preferredTextTracks array

### Other improvements

- abr: ignore requests that may have directly hit the cache in our adaptive logic
- dash/perf: improve parsing efficiency for very large MPDs, at the expense of a very small risk of de-synchronization. Mechanisms still allow for regular re-synchronization.


## v3.19.0 (2020/03/11)

### Features
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.19.0
3.20.0
6 changes: 3 additions & 3 deletions demo/full/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<link rel="preload" href="./fonts/FontAwesome.otf" as="font" crossorigin="anonymous">
<link rel="stylesheet" href="styles/style.css" media="screen">
<link rel="icon" type="image/x-icon" href="plus.ico" />
<script type="text/javascript" src="./bundle.js" charset="utf-8"></script>
<script type="text/javascript" src="./lib.js" charset="utf-8"></script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<title>RxPlayer - CANAL+</title>
</head>
<body>
<div id="player-container"></div>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<script type="text/javascript" src="./lib.js" charset="utf-8"></script>
<script type="text/javascript" src="./bundle.js" charset="utf-8"></script>
</body>
</html>
7 changes: 1 addition & 6 deletions demo/full/scripts/controllers/PlayerKnobsSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function PlayerKnobsSettings({
shouldDisplay,
close,
player,
availableVideoTracks,
lowLatencyMode,
isContentLoaded,
}) {
Expand Down Expand Up @@ -43,10 +42,7 @@ function PlayerKnobsSettings({
<VideoBitrateKnob className="black-knob" player={player} />
<LanguageKnob className="black-knob" player={player} />
<SubtitlesKnob className="black-knob" player={player} />
{
availableVideoTracks.length > 1 ?
<VideoTrack player={player} /> : null
}
<VideoTrack className="black-knob" player={player} />
</div>
</div>
);
Expand All @@ -57,6 +53,5 @@ export default React.memo(withModulesState({
lowLatencyMode: "lowLatencyMode",
isStopped: "isStopped",
isContentLoaded: "isContentLoaded",
availableVideoTracks: "availableVideoTracks",
},
})(PlayerKnobsSettings));
4 changes: 2 additions & 2 deletions demo/full/scripts/controllers/knobs/Subtitles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ const SubtitlesKnobBase = ({

return (
<Knob
name="Subtitles"
name="Subtitles Track"
ariaLabel="Update the current subtitles"
className={className}
disabled={!availableSubtitles.length}
disabled={options.length <= 1}
onChange={onLanguageChange}
options={options}
selected={currentLanguageIndex}
Expand Down
17 changes: 11 additions & 6 deletions demo/full/scripts/controllers/knobs/VideoTrack.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,31 @@ const VideoTrackKnobBase = ({
options = ["Not available"];
selectedIndex = 0;
} else {
options = availableVideoTracks
.map((track, i) => `track ${i}: ${track.id}`);
options = ["no video track"].concat(
availableVideoTracks.map((track, i) => `track ${i}: ${track.id}`),
);

selectedIndex = currentVideoTrack ?
Math.max(findVideoTrackIndex(currentVideoTrack, availableVideoTracks), 0)
Math.max(findVideoTrackIndex(currentVideoTrack, availableVideoTracks), 1)
: 0;
}

const onTrackChange = (evt) => {
const index = +evt.target.value;
const track = availableVideoTracks[index];
player.dispatch("SET_VIDEO_TRACK", track);
if (index === 0) {
player.dispatch("DISABLE_VIDEO_TRACK");
} else {
const track = availableVideoTracks[index - 1];
player.dispatch("SET_VIDEO_TRACK", track);
}
};

return (
<Knob
name="Video Track"
ariaLabel="Update the video track"
className={className}
disabled={availableVideoTracks.length < 2}
disabled={options.length <= 1}
onChange={onTrackChange}
options={options}
selected={selectedIndex}
Expand Down
4 changes: 3 additions & 1 deletion demo/full/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ import React from "react";
import ReactDOM from "react-dom";
import Main from "./controllers/Main.jsx";

ReactDOM.render(<Main />, document.getElementById("player-container"));
window.onload = function() {
ReactDOM.render(<Main />, document.getElementById("player-container"));
}
10 changes: 6 additions & 4 deletions demo/full/scripts/modules/player/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ import { Subject } from "rxjs";
import { takeUntil } from "rxjs/operators";
import $handleCatchUpMode from "./catchUp";

const RxPlayer = window.RxPlayer;

const PLAYER = ({ $destroy, state }, { videoElement, textTrackElement }) => {
const player = new RxPlayer({
const player = new window.RxPlayer({
limitVideoWidth: false,
stopAtEnd: false,
throttleVideoBitrateWhenHidden: true,
Expand Down Expand Up @@ -152,6 +150,10 @@ const PLAYER = ({ $destroy, state }, { videoElement, textTrackElement }) => {
player.setVideoTrack(track.id);
},

DISABLE_VIDEO_TRACK: () => {
player.disableVideoTrack();
},

SET_SUBTITLES_TRACK: (track) => {
player.setTextTrack(track.id);
},
Expand All @@ -171,7 +173,7 @@ const PLAYER = ({ $destroy, state }, { videoElement, textTrackElement }) => {

DISABLE_LIVE_CATCH_UP() {
$switchCatchUpMode.next(false);
}
},
};
};

Expand Down
Loading

0 comments on commit 2569aa1

Please sign in to comment.