Skip to content

feat!: new ABR engine #867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a2682f3
feat: new ABR engine
tsi May 14, 2025
2e0e64d
feat: quality level switching and logging
tsi May 14, 2025
74b9807
Merge branch 'master' into ME-19537-abr-engine
tsi May 14, 2025
d93d3e7
chore: hls.js
tsi May 15, 2025
f7aaea7
chore: lazy loading ABR engine
tsi May 15, 2025
05a20dc
chore: abr in all.js
tsi May 15, 2025
96f82b2
chore: abr example page
tsi May 15, 2025
adc83d9
feat: adaptive-streaming Profiles
tsi May 18, 2025
c247bd1
chore: debug info, send analytics
tsi May 19, 2025
2e64ab1
chore: update videojs-contrib-quality-levels
tsi May 19, 2025
f62482a
chore: abr config
tsi May 20, 2025
43ce30c
fix: undefined level
tsi May 20, 2025
16fe690
fix: quality-level switch
tsi May 25, 2025
c68badc
feat: hdr support
tsi May 25, 2025
d0defb1
chore: abr param validation
tsi May 26, 2025
04196ff
chore: remove light version
tsi May 26, 2025
6dbced0
chore: cleanup
tsi May 26, 2025
ab0c3e8
fix: failing tests
tsi May 26, 2025
87e6f14
chore: ABR example page
tsi May 26, 2025
feb6146
chore: ABR example page
tsi May 26, 2025
d63458e
chore: e2e
tsi May 27, 2025
ec6819d
chore: e2e
tsi May 27, 2025
1ba93cc
chore: e2e
tsi May 27, 2025
6a235bb
fix: clean up existing quality levels on source change
tsi May 27, 2025
12eb8dd
fix: abr => adaptiveStreaming
tsi May 28, 2025
031b368
Merge branch 'master' into ME-19537-abr-engine
tsi Jun 4, 2025
d2df37a
feat: enable player-source config inheritance (#868)
tsi Jun 4, 2025
f501022
refactor: v3 lazy loaded plugins (#869)
tsi Jun 4, 2025
2fc1262
refactor: lazy loaded all bundle
tsi Jun 4, 2025
6359ff7
refactor: lazy loaded all bundle
tsi Jun 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,33 @@ This README includes basic information for installation and getting started. Vie
```shell
npm install cloudinary-video-player
```
1. Import the package:
2. Import the package:

```js
import cloudinary from 'cloudinary-video-player';
// Also possible:
// import { videoPlayer } from 'cloudinary-video-player';
import 'cloudinary-video-player/cld-video-player.min.css';
// import required plugins like that:
// import 'cloudinary-video-player/chapters';
// import 'cloudinary-video-player/playlist';
```

* Note - import `/all` to get all available plugins in a single import:

```js
import cloudinary from 'cloudinary-video-player/all';
import 'cloudinary-video-player/cld-video-player.min.css';
```

### CDN

Cloudinary Video Player can also be included directly from the [jsDelivr CDN](https://www.jsdelivr.com/):
Cloudinary Video Player can also be included directly from the [jsDelivr CDN](https://www.jsdelivr.com/), optional plugins will be lazy-loaded on demand:

```html
<link href="https://cdn.jsdelivr.net/npm/cloudinary-video-player/dist/cld-video-player.min.css" rel="stylesheet">

<script src="https://cdn.jsdelivr.net/npm/cloudinary-video-player/dist/cld-video-player.min.js" type="text/javascript"></script>
```

### Packages

The Cloudinary video player offers standard and light package variations, available in either minified or non-minified formats.
* Standard package: Includes all functionality described in this video player [documentation](https://cloudinary.com/documentation/cloudinary_video_player).
* Light package: Excludes the following optional functionality: Adaptive bitrate streaming (HLS and MPEG-DASH), Video ads, Shoppable videos (alpha)

- `cld-video-player.js` - Non minified version which includes all optional modules.
- `cld-video-player.min.js` - Minified version which includes all optional modules.
- `cld-video-player.light.js` - Non minified version which does not include any optional modules.
- `cld-video-player.light.min.js` - Minified version which does not include any optional modules. (for smaller bundle size)


## Getting started

Expand All @@ -59,7 +56,8 @@ Create a video tag containing `cld-video-player` class and a supported skin clas
Instantiate a new cloudinary Video Player:
```javascript
cloudinary.videoPlayer('player', {
cloudName: 'demo'
cloudName: 'demo',
publicId: 'cld-sample-video'
});
```

Expand Down
127 changes: 39 additions & 88 deletions docs/adaptive-streaming.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,32 @@

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cloudinary-video-player/dist/cld-video-player.min.css">
<script src="https://cdn.jsdelivr.net/npm/cloudinary-video-player/dist/cld-video-player.min.js"></script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dashjs/2.9.3/dash.all.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-dash/2.11.0/videojs-dash.js"></script>

-->

<script type="text/javascript" src="./scripts.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/src/ua-parser.min.js"></script>

<script>
window.addEventListener('load', function () {
var cldConfig = { cloud_name: 'demo', secure: true};
var cldConfig = {
cloud_name: 'demo',
secure: true,
debug: true
};

var uap = new UAParser(navigator.userAgent);
playerHls = cloudinary.videoPlayer('example-player-hls', cldConfig);
playerHlsH265 = cloudinary.videoPlayer('example-player-hls-h265', cldConfig);
playerDash = cloudinary.videoPlayer('example-player-dash', cldConfig);
playerDashVp9 = cloudinary.videoPlayer('example-player-dash-vp9', cldConfig);
playerHlsNoCodec = cloudinary.videoPlayer('example-player-hls-no-codec', cldConfig);
playerDashNoCodec = cloudinary.videoPlayer('example-player-dash-no-codec', cldConfig);
playerHlsIos = cloudinary.videoPlayer('example-player-hls-ios', Object.assign(cldConfig, {
html5: {
vhs: {
overrideNative: true
}
}
}));
playerFastStart = cloudinary.videoPlayer('example-player-fast-start', cldConfig);
playerHighQuality = cloudinary.videoPlayer('example-player-high-quality', cldConfig);

playerHls.source(
'sea_turtle',
{
sourceTypes: ['hls'],
transformation: {streaming_profile: 'hd'},
info: {title: 'HLS'}
info: {title: 'HLS /w sp_auto'}
}
);
playerHlsH265.source(
Expand All @@ -81,55 +73,37 @@
info: {title: 'MPEG-DASH vp9'}
}
);
playerHlsNoCodec.source(

playerFastStart.source(
'sea_turtle',
{
sourceTypes: ['hls'],
info: {title: 'HLS'}
info: {title: 'HLS /w fastStart'},
adaptiveStreaming: {
strategy: 'fastStart'
}
}
);
playerDashNoCodec.source(

playerHighQuality.source(
'sea_turtle',
{
sourceTypes: ['dash'],
info: {title: 'MPEG-DASH'}
sourceTypes: ['hls'],
info: {title: 'HLS /w fastStart'},
adaptiveStreaming: {
strategy: 'highQuality'
}
}
);
playerHlsIos.source(
'sea_turtle',
{
sourceTypes: ['hls'],
transformation: {streaming_profile: 'hd'},
info: {title: 'HLS'}
}
);

playerHls.on('qualitychanged', function(data) {
console.log('HLS player', data);
});
playerHls.videojs.on('playing', function() {
document.getElementById('info-hls').innerHTML = uap.getBrowser().name + ' is playing ' + playerHls.videojs.currentSrc();
});
playerHls.on('error', function() {
console.log(playerHls.videojs.error());
})
playerHlsH265.videojs.on('playing', function() {
document.getElementById('info-hls-h265').innerHTML = uap.getBrowser().name + ' is playing ' + playerHlsH265.videojs.currentSrc();
});
playerDash.on('qualitychanged', function(data) {
console.log('Dash player', data);
});
playerDash.videojs.on('playing', function() {
document.getElementById('info-dash').innerHTML = uap.getBrowser().name + ' is playing ' + playerDash.videojs.currentSrc();
});
playerDashVp9.videojs.on('playing', function() {
document.getElementById('info-dash-vp9').innerHTML = uap.getBrowser().name + ' is playing ' + playerDashVp9.videojs.currentSrc();
});
playerHlsNoCodec.videojs.on('playing', function() {
document.getElementById('info-hls-no-codec').innerHTML = uap.getBrowser().name + ' is playing ' + playerHlsNoCodec.videojs.currentSrc();
});
playerDashNoCodec.videojs.on('playing', function() {
document.getElementById('info-dash-no-codec').innerHTML = uap.getBrowser().name + ' is playing ' + playerDashNoCodec.videojs.currentSrc();
[playerHls, playerHlsH265, playerDash, playerDashVp9, playerFastStart, playerHighQuality].forEach(player => {
player.on('qualitychanged', function(data) {
console.log(player.options.videojsOptions.id + ' qualitychanged', data);
});
player.on('playing', function(data) {
const info = player.videoElement.parentElement.parentElement.querySelector('.info');
info.innerHTML = uap.getBrowser().name + ' is playing ' + player.videojs.currentSrc();
});
});
}, false);
</script>
Expand All @@ -155,7 +129,7 @@ <h4>HLS 264</h4>
width="500"
class="cld-video-player"
></video>
<span id="info-hls"></span>
<p id="info-hls" class="info"></p>
</div>

<div class="video-container mb-4">
Expand All @@ -167,7 +141,7 @@ <h4>HLS 265</h4>
width="500"
class="cld-video-player">
</video>
<span id="info-hls-h265"></span>
<p id="info-hls-h265" class="info"></p>
</div>

<div class="video-container mb-4">
Expand All @@ -180,7 +154,7 @@ <h4>MPEG-DASH h264</h4>
width="500"
class="cld-video-player">
</video>
<span id="info-dash"></span>
<p id="info-dash" class="info"></p>
</div>

<div class="video-container mb-4">
Expand All @@ -193,46 +167,33 @@ <h4>MPEG-DASH vp9</h4>
width="500"
class="cld-video-player">
</video>
<span id="info-dash-vp9"></span>
<p id="info-dash-vp9" class="info"></p>
</div>

<div class="video-container mb-4">
<h4>HLS no codec</h4>
<h4>HLS with fastStart</h4>
<video
id="example-player-hls-no-codec"
id="example-player-fast-start"
playsinline
controls
muted
width="500"
class="cld-video-player">
</video>
<span id="info-hls-no-codec"></span>
<p id="info-fast-start" class="info"></p>
</div>

<div class="video-container mb-4">
<h4>DASH no codec</h4>
<h4>HLS with highQuality</h4>
<video
id="example-player-dash-no-codec"
id="example-player-high-quality"
playsinline
controls
muted
width="500"
class="cld-video-player">
</video>
<span id="info-dash-no-codec"></span>
</div>

<div class="video-container mb-4">
<h4>HLS 264 safari ios native override</h4>
<video
id="example-player-hls-ios"
playsinline
controls
muted
width="500"
class="cld-video-player">
</video>
<span id="info-hls-ios"></span>
<p id="info-high-quality" class="info"></p>
</div>

<p class="mt-4">
Expand Down Expand Up @@ -270,7 +231,6 @@ <h3>Example Code:</h3>
'sea_turtle',
{
sourceTypes: ['hls'],
transformation: {streaming_profile: 'hd'},
info: {title: 'HLS'}
}
);
Expand All @@ -279,18 +239,9 @@ <h3>Example Code:</h3>
'sea_turtle',
{
sourceTypes: ['dash'],
transformation: {streaming_profile: 'hd'},
info: {title: 'MPEG-DASH'}
}
);

playerHls.on('qualitychanged', (data) => {
console.log('HLS player', data);
});

playerDash.on('qualitychanged', (data) => {
console.log('Dash player', data);
});
</code>
</pre>
</div>
Expand Down
57 changes: 0 additions & 57 deletions docs/es-imports.html

This file was deleted.

Loading