Skip to content

Commit 2a54261

Browse files
committed
feat: use rollup for esm
1 parent 90fdf38 commit 2a54261

65 files changed

Lines changed: 650 additions & 693 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/es-modules/adaptive-streaming.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ <h4>HLS with highQuality</h4>
107107

108108
<script type="module">
109109
import { videoPlayer } from 'cloudinary-video-player';
110-
import 'cloudinary-video-player/dash';
111-
import 'cloudinary-video-player/adaptive-streaming';
112110
import 'cloudinary-video-player/cld-video-player.min.css';
113111

114112
const cldConfig = {
@@ -118,12 +116,12 @@ <h4>HLS with highQuality</h4>
118116
};
119117

120118
const uap = new UAParser(navigator.userAgent);
121-
const playerHls = cloudinary.videoPlayer('example-player-hls', cldConfig);
122-
const playerHlsH265 = cloudinary.videoPlayer('example-player-hls-h265', cldConfig);
123-
const playerDash = cloudinary.videoPlayer('example-player-dash', cldConfig);
124-
const playerDashVp9 = cloudinary.videoPlayer('example-player-dash-vp9', cldConfig);
125-
const playerFastStart = cloudinary.videoPlayer('example-player-fast-start', cldConfig);
126-
const playerHighQuality = cloudinary.videoPlayer('example-player-high-quality', cldConfig);
119+
const playerHls = videoPlayer('example-player-hls', cldConfig);
120+
const playerHlsH265 = videoPlayer('example-player-hls-h265', cldConfig);
121+
const playerDash = videoPlayer('example-player-dash', cldConfig);
122+
const playerDashVp9 = videoPlayer('example-player-dash-vp9', cldConfig);
123+
const playerFastStart = videoPlayer('example-player-fast-start', cldConfig);
124+
const playerHighQuality = videoPlayer('example-player-high-quality', cldConfig);
127125

128126
playerHls.source(
129127
'sea_turtle',

docs/es-modules/api.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h3 class="mb-4">API and Events</h3>
6969

7070
<script type="module">
7171
import { videoPlayer } from 'cloudinary-video-player';
72-
import 'cloudinary-video-player/playlist';
72+
7373

7474
import 'cloudinary-video-player/cld-video-player.min.css';
7575

docs/es-modules/chapters.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ <h4 class="mb-4">From an automatically taken VTT file</h4>
6565

6666
<script type="module">
6767
import { videoPlayer } from 'cloudinary-video-player';
68-
import 'cloudinary-video-player/chapters';
69-
7068
import 'cloudinary-video-player/cld-video-player.min.css';
7169

7270
const playerVTT = videoPlayer('player-vtt', {

docs/es-modules/colors.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h3 class="text-primary">Player 3</h3>
6464

6565
<script type="module">
6666
import { videoPlayers } from 'cloudinary-video-player';
67-
import 'cloudinary-video-player/colors';
67+
6868
import 'cloudinary-video-player/cld-video-player.min.css';
6969

7070
const players = videoPlayers('.cld-video-player', {

docs/es-modules/components.html

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,11 @@ <h2>Custom Components</h2>
5757
</div>
5858

5959
<script type="module">
60-
import { videoPlayer } from 'cloudinary-video-player';
61-
import 'cloudinary-video-player/playlist';
62-
60+
import { videoPlayer, videojs } from 'cloudinary-video-player';
6361
import 'cloudinary-video-player/cld-video-player.min.css';
6462

6563
// Get the ClickableComponent base class from Video.js
66-
let vjs = window.videojs.default || window.videojs;
67-
const ClickableComponent = vjs.getComponent('ClickableComponent');
64+
const ClickableComponent = videojs.getComponent('ClickableComponent');
6865

6966
// Create a common class for playlist buttons
7067
class PlaylistButton extends ClickableComponent {
@@ -83,7 +80,7 @@ <h2>Custom Components</h2>
8380

8481
const typeCssClass = 'vjs-playlist-' + type + '-control';
8582

86-
return vjs.createEl('button', {
83+
return videojs.createEl('button', {
8784
// Prefixing classes of elements within a player with "vjs-"
8885
// is a convention used in Video.js.
8986
className: 'vjs-control vjs-playlist-control vjs-button ' + typeCssClass
@@ -119,8 +116,8 @@ <h2>Custom Components</h2>
119116
}
120117

121118
// Register the component with Video.js, so it can be used in players.
122-
vjs.registerComponent('NextButton', NextButton);
123-
vjs.registerComponent('PreviousButton', PreviousButton);
119+
videojs.registerComponent('NextButton', NextButton);
120+
videojs.registerComponent('PreviousButton', PreviousButton);
124121

125122
// Cloudinary Video Player related code
126123
// ====================================

docs/es-modules/debug.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h3 class="mb-4">Debug mode</h3>
3939

4040
<script type="module">
4141
import { videoPlayer } from 'cloudinary-video-player';
42-
import 'cloudinary-video-player/debug';
42+
4343
import 'cloudinary-video-player/cld-video-player.min.css';
4444

4545
const player = cloudinary.videoPlayer('player', {

docs/es-modules/interaction-area.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ <h3>Auto-zoom video cropping</h3>
8686

8787
<script type="module">
8888
import cloudinary from 'cloudinary-video-player/all';
89-
import 'cloudinary-video-player/interaction-areas';
89+
9090

9191
import 'cloudinary-video-player/cld-video-player.min.css';
9292

docs/es-modules/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"private": true,
44
"version": "0.0.1",
55
"scripts": {
6-
"prepare-player": "cd ../../ && npm i && npm run build-all",
7-
"install-player": "npm i ../../ --no-save",
6+
"prepare-player": "cd ../.. && npm i && npm run build-es",
7+
"install-player": "npm i ../.. --no-save",
88
"prepare": "npm run prepare-player && npm run install-player",
99
"update-edge": "npm i",
1010
"start": "vite",

docs/es-modules/playlist-by-tag.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h3 class="mb-4">Playlist by tag (with captions)</h3>
4141

4242
<script type="module">
4343
import { videoPlayer } from 'cloudinary-video-player';
44-
import 'cloudinary-video-player/playlist';
44+
4545

4646
import 'cloudinary-video-player/cld-video-player.min.css';
4747

docs/es-modules/playlist.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h3 class="mb-4">Playlist</h3>
5151

5252
<script type="module">
5353
import { videoPlayer } from 'cloudinary-video-player';
54-
import 'cloudinary-video-player/playlist';
54+
5555
import 'cloudinary-video-player/cld-video-player.min.css';
5656

5757
const source1 = {

0 commit comments

Comments
 (0)