-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathentry-points.html
More file actions
105 lines (90 loc) · 3.82 KB
/
entry-points.html
File metadata and controls
105 lines (90 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Cloudinary Video Player - Entry Points Test</title>
<link
href="https://res.cloudinary.com/cloudinary-marketing/image/upload/f_auto,q_auto/c_scale,w_32,e_hue:290/creative_staging/cloudinary_internal/Website/Brand%20Updates/Favicon/cloudinary_web_favicon_192x192.png"
rel="icon"
type="image/png"
/>
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<div class="container p-4 col-12 col-md-9 col-xl-6">
<nav class="nav mb-2">
<a href="/index.html"><< Back to examples index</a>
</nav>
<h1>Cloudinary Video Player</h1>
<h3 class="mb-4">Bundler Test: Entry Points</h3>
<p>Verifies every <code>exports</code> path in <code>package.json</code> resolves correctly.</p>
<h4 class="mt-3">Results:</h4>
<pre id="results" class="bg-light p-3 border rounded" style="white-space: pre-wrap;"></pre>
<video
id="player"
class="cld-video-player cld-fluid"
crossorigin="anonymous"
controls
muted
playsinline
></video>
</div>
<script type="module">
const log = (msg) => {
const el = document.getElementById('results');
el.textContent += msg + '\n';
};
const check = (name, value) => {
const type = typeof value;
const ok = type === 'function' || type === 'object';
log(`${ok ? '✅' : '❌'} ${name}: ${type}`);
return ok;
};
(async () => {
try {
// 1. Default entry - named exports
const { videoPlayer, videoPlayers, player, players } = await import('cloudinary-video-player');
check('videoPlayer (named)', videoPlayer);
check('videoPlayers (named)', videoPlayers);
check('player (named)', player);
check('players (named)', players);
// 2. /videoPlayer sub-path
const vpModule = await import('cloudinary-video-player/videoPlayer');
check('videoPlayer (default from /videoPlayer)', vpModule.default);
// 3. /player sub-path
const pModule = await import('cloudinary-video-player/player');
check('player (default from /player)', pModule.default);
// 4. /all - with plugins
const allModule = await import('cloudinary-video-player/all');
check('cloudinary (default from /all)', allModule.default);
check('videoPlayer (named from /all)', allModule.videoPlayer);
// 5. /lazy
const lazyModule = await import('cloudinary-video-player/lazy');
check('player (named from /lazy)', lazyModule.player);
check('players (named from /lazy)', lazyModule.players);
// 6. CSS import
await import('cloudinary-video-player/cld-video-player.min.css');
log('✅ CSS import resolved');
// 7. Wildcard paths
const dashModule = await import('cloudinary-video-player/dash');
check('dash (wildcard export)', dashModule);
const debugModule = await import('cloudinary-video-player/debug');
check('debug (wildcard export)', debugModule);
log('\n--- Creating player to verify runtime works ---');
videoPlayer('player', { cloudName: 'demo', publicId: 'sea_turtle' });
log('✅ Player created successfully');
} catch (err) {
log(`❌ Error: ${err.message}`);
console.error(err);
}
})();
</script>
<link
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>
</body>
</html>