Storage & video with Angular
Audience: Angular developers who let their users upload files, browse them and watch video that is stored and delivered by plycdn. The package gives you a resumable upload area, a file browser, an accessible video player and a client for your backend's plycdn routes. It supports Angular 13 to 22.
The browser never holds your API key and never chooses an organization. Every call goes to your
backend, which signs the user in, asks your IPlycdnStorageAuthorizer whether they may do this (the
default refuses everything), and adds the key. File bytes go from the browser straight to the bucket's
region, authorised only by a short-lived ticket in each part's URL: no cookies, no headers. Your backend
setup is in Storage & video with ASP.NET Core; do that first, so the routes
the components call exist.
1Install
Install from the plycdn feed. Tell npm once where the @plycdn packages live: put this line in the .npmrc beside your package.json (commit it, so your colleagues and CI need no setup):
@plycdn:registry=https://npm.plycdn.com/
Then install:
npm install @plycdn/angular
For use with a plycdn account under the plycdn Terms of Use: https://plycdn.com/terms. The feed has every version from Storage & video 1.22.0 onward; earlier versions stay available as downloads in your dashboard under Developers → SDKs. Step by step: Install the SDKs.
Or download the package from your dashboard: Developers → SDKs, where each language is its own download: pick Angular. Copy plycdn-angular-1.39.0.tgz into your application's vendor directory and install it:
npm install ./vendor/plycdn-angular-1.39.0.tgz
That is the whole install. The package installs what it needs automatically from your npm registry or mirror, so make sure yours can serve it. The player loads its streaming code only in browsers that need it; browsers that play the stream natively never download it. Commit the package file and your lockfile, or host the package in your private npm registry so your CI can install it.
2Choose what you import
Import by purpose, from the entry point you need:
| Entry point | What it holds |
|---|---|
@plycdn/angular/storage |
PlycdnStorageModule, <plycdn-upload>, <plycdn-file-browser>, <plycdn-file-viewer>, PlycdnStorageClient, PlycdnUploader |
@plycdn/angular/video |
PlycdnVideoModule, <plycdn-player>, PlycdnPlaybackService, PlycdnPlayerCore, and for live streaming <plycdn-live-broadcaster>, <plycdn-live-player>, PlycdnBroadcastService, PlycdnLiveService |
@plycdn/angular |
What both share: types, failures and messages, the theme, and the framework-free engines (PlycdnUploader, PlycdnPlayerCore) that the two entry points re-export |
import { NgModule } from '@angular/core';
import { PlycdnStorageModule } from '@plycdn/angular/storage';
import { PlycdnVideoModule } from '@plycdn/angular/video';
@NgModule({
imports: [
PlycdnStorageModule.forRoot({ apiBaseUrl: '/api/plycdn/v1' }), // uploads and the file browser
PlycdnVideoModule.forRoot({ apiBaseUrl: '/api/plycdn/v1' }), // the player: import it only if you play video
],
})
export class AppModule {}
apiBaseUrl defaults to /api/plycdn/v1, where the .NET package serves its routes. Set
withCredentials: true when your backend is on another origin and uses cookie sign-in. If your site sends a
Content-Security-Policy, allow the upload hosts: connect-src https://*.upload.plycdn.com.
3Upload
<plycdn-upload [bucketId]="bucketId" prefix="week-1/" (stored)="browser.refresh()" (failed)="log($event)"></plycdn-upload>
- Drag files onto the area or choose them. Each file becomes the key
prefix + file.name, or whatever[keyFor]="fn"returns. - Progress, time left, Pause / Resume, Cancel and Retry. Files beyond
[parallelFiles](default 2) wait their turn;[concurrency](default 3) is the number of parts of one file in flight. - Resumable. A dropped connection is retried, and sending waits while the browser is offline. After a reload or a closed tab, the component lists the unfinished uploads for the bucket; choosing the same file again continues from the last part that arrived. Sessions stay open for 7 days; after that they are no longer offered, and the browser forgets them.
- Never uploaded twice. Completing an upload can safely be asked again: a lost or timed-out completion is retried, and a file whose upload already completed returns its stored object instead of being sent (and billed) a second time.
- Privacy. The browser remembers only each unfinished upload's session id, its expiry and, to list it by
name, its key.
[rememberFileNames]="false"keeps names out of storage (for shared computers): uploads still resume, and the list shows sizes only. On sign-out, callPlycdnUploader.forgetAll(). - Keyboard. Pause and Resume are one button; after Retry, Cancel or Remove, focus moves to the row's next action (or the next row, or Choose files).
- Retry appears only where it can help; a refusal such as
object_existsorfile_type_not_allowedoffers Remove instead (which also ends the session). - Errors are sentences, not codes:
[messages]="{ file_type_not_allowed: 'Only videos and PDFs.' }"rewords (or translates) any of them.PLYCDN_MESSAGESlists the defaults by code, and(failed)carries{ code, status, retryable, message }. - Every word is in
[labels](defaults:PLYCDN_UPLOAD_LABELS). Other inputs:[accept](the file picker's filter; empty by default, so every file can be chosen, and the bucket's own allowed types are enforced either way),[multiple],[disabled]and[warnOnLeave](asks before the page closes mid-upload).
To upload into a video library, give the library's id as bucketId and upload under sources/ (see the
Video guide); completing the upload creates the video.
4File browser
<plycdn-file-browser #browser [bucketId]="bucketId" [(prefix)]="folder" (open)="show($event)"></plycdn-file-browser>
Folders come from / in keys, with breadcrumbs and Show more paging ([pageSize], default 100).
(open) emits the stored object. A public bucket's object has a url; for a private one, ask your backend
for a signed link:
import { Component } from '@angular/core';
import { PlycdnObject } from '@plycdn/angular';
import { PlycdnStorageClient } from '@plycdn/angular/storage';
@Component({ selector: 'app-files', templateUrl: './files.component.html' })
export class FilesComponent {
bucketId = '...'; // your bucket's id
folder = '';
constructor(private storage: PlycdnStorageClient) {}
show(object: PlycdnObject) {
this.storage.sign({ bucketId: object.bucketId, objectId: object.id }).subscribe(link => window.open(link.url));
}
}
To sign on one of the bucket's custom domains, add hostname: sign({ bucketId, objectId, hostname: 'cdn.example.com' }). Your authorizer is asked about the Sign operation before any link is issued.
5Play video
<plycdn-player [libraryId]="libraryId" [videoId]="videoId" (statusChange)="onStatus($event)"></plycdn-player>
- Links come from your backend. The player asks your backend (
POST {apiBaseUrl}/signwithbucketId= the library andvideoId) for a playback link; your authorizer decides who may watch (PlycdnOperation.WatchVideo, andGetVideofor the title and status). The video itself streams from*.plycdn.net. Links are renewed at 80 % of their lifetime, and at once if the delivery network refuses one; playback carries on without a reload.[ttlSeconds]sets how long each link lives (your backend's default otherwise). - Resumes where this browser last stopped (
[resume]="false"turns it off; the position is kept inlocalStorageunderplycdn-position:<videoId>, and nothing breaks where storage is blocked). - While a video is still being prepared (
playable: the lowest quality is ready) the player checks every 15 seconds and, once every quality is ready, reloads at the same position. - Keyboard, while the player has focus: Space or K play/pause, Left/Right 5 seconds, J/L 10 seconds,
Up/Down volume, M mute, C next captions track, F full screen, Home/End, 0 to 9 jump to 0 to 90 %,
<and>slower and faster. Shortcuts are ignored with Ctrl, Cmd or Alt, and while a text field has focus. Every control is a labelled button reachable with Tab; the seek bar is a slider read in words; changes are announced to screen readers; motion is reduced when the system asks. - Quality (Auto first), speed and captions menus; captions are offered when the video has them. Download appears when the library offers downloads. Scrubbing previews show on hover and focus.
(statusChange)emits{ status: 'loading' | 'ready' | 'error', error, message }. Error codes:video_not_found,video_not_ready,playback_unsupported(a browser that cannot stream),playback_link_failed(three renewals failed; the player offers Try again), and your backend's own refusals such asforbidden.[messages]rewords them like the other components.(progress)emits{ currentTime, duration, playing, ended, played }about once a second and at once on pause, seek and the end, for every library;playedis the seconds this session has been playing, which the player also saves to plycdn when your server names the viewer (Watch time per viewer). Positions come from the browser and are for convenience (a progress bar of your own, say); for anything you enforce, use thewatchedSecondsplycdn keeps for the viewer (Serial playback).- Serial playback. In a library with serial playback (no skipping ahead) the player handles it by itself: it needs no input and no code. Your server names the viewer.
- Viewer watermark and logo. When the library shows them, the player draws the viewer's details and your logo over the
video, moves the watermark and puts it back if it is removed or hidden; three times in a minute pauses playback. In a
library that requires the watermark it renews its 10-minute links with the watermark's proof by itself. It needs no input:
your server names the viewer (Viewer watermark and your logo). While the watermark is
drawn, picture-in-picture and casting are off, and on an iPhone full screen is not available. New
(statusChange)codes:watermark_required(an older package somewhere: update the server and browser packages),watermark_proof_invalid,watermark_tamperedandplayback_session_expired; after the first three the player stops and Try again starts over.<plycdn-live-player>and<plycdn-watch>draw the logo and a watermark of your fixed text and the date and time, not required.
If your site sends a Content-Security-Policy, allow the delivery hosts:
connect-src https://*.plycdn.net; media-src https://*.plycdn.net blob:; img-src https://*.plycdn.net https://watch.plycdn.com; worker-src blob:.
https://watch.plycdn.com is where your player logo comes from.
Your own player
PlycdnPlaybackService.link(libraryId, videoId, ttlSeconds?, { refused }?) returns the PlaybackLink: url (the stream),
nativeUrl (the same stream for native playback, or null), posterUrl, thumbnailsUrl and downloadUrl. Pass
{ refused: true } when you ask again because the last link was refused (<plycdn-player> does): your backend's sign route
then refreshes that library's signing settings, and the flag is never sent on to plycdn. The flag is sent only once your sign
route has answered with Plycdn-Sign-Refused: accepted, as the server packages' routes do; a sign route of your own that passes
the request on to plycdn never receives it.
PlycdnPlayerCore is the framework-free engine the component uses (link renewal, the token on every
request, resume and the keyboard map); give it a <video> element and a getLink function. The
Video guide shows a complete example.
For the viewer watermark, pass 'drawn' as the fifth argument, link(libraryId, videoId, ttlSeconds, renewal, 'drawn'), with
the { continues, watermarkProof } the core gives on a renewal; give the core an onMark that draws with PlayerMark (from
@plycdn/angular: new PlayerMark({ container, onTamper: () => core.noteTamper() }), then update(watermark, logo) and
destroy()). The core then checks in with the proof and renews before renewBy. Without 'drawn', a library that requires the
watermark answers 409 watermark_required.
Start at a moment
<plycdn-player> takes [startSeconds], so a search result can open a library video at the moment that matched. Content Search
results carry source for files from your own buckets and libraries, and the preview plays a library video as a stream
(Your own plycdn storage). A moment set while the video is still loading is applied once it is ready;
to go to the same moment again (the same result clicked twice), change [startKey] too, a click counter for example.
6File viewer
Show a stored file in place: step by step.
<plycdn-file-browser [bucketId]="bucketId" (open)="opened = $event"></plycdn-file-browser>
<plycdn-file-viewer *ngIf="opened" [object]="opened" (stateChange)="state = $event" (failed)="offer($event)"></plycdn-file-viewer>
<plycdn-file-viewer> is in @plycdn/angular/storage (PlycdnStorageModule.forRoot()). Inputs: the file as [object] (the file
browser's (open)), [objectId], or [bucketId] with [objectKey] (and optionally [contentType] and [size]); a library
video as [libraryId] with [videoId]; or your own file as [source] (a name, what you know about it, delivery and a getLink
function: { name: 'handbook.pdf', delivery: 'customer', getLink: () => link() }, with 'plycdn' for a plycdn link).
Also [ttlSeconds], [hostname] (one of the bucket's custom domains), [startSeconds], [limits], [labels] and [messages].
Outputs: (stateChange) with { mode, renderer, card? } when what is on screen changes, and (failed) with the error when the
view ends on a card for a reason other than "this type isn't shown". Its links come from your backend's sign route.
A library video plays in <plycdn-player>, with its serial playback, watermark and logo. Import PlycdnVideoModule.forRoot()
for it: without it that video shows a playback_link_failed card.
For a file found by search, <plycdn-content-file-viewer> is in @plycdn/content-search:
<plycdn-content-file-viewer [result]="picked" [terms]="page.terms" (unavailable)="offerDownload($event)"></plycdn-content-file-viewer>
Inputs: [assetId], [result] or [source]; [location], [terms] and [snippet] to open at and mark the match;
[highlightPdf] (false keeps the browser's own PDF viewer), [startSeconds], [limits] and [labels]. Outputs:
(stateChange) and (unavailable) with the code. <plycdn-content-document> and <plycdn-content-playback> run on the same
viewer, with their inputs and outputs unchanged. <plycdn-content-document> gains an optional [knownPdf] (true for a PDF the
service indexed, so the browser's own viewer is the fallback even on storage that doesn't allow cross-origin reads);
<plycdn-content-playback> sets it from the result.
Limits. Defaults per file, loaded into the page: 10 MB of text (200,000 lines), 20 MB of CSV (200,000 rows, 200 columns) and
1,000,000 cells in one view; when the file's host cannot answer partial reads, whole-file limits apply (text 10 MB, CSV
20 MB, Excel 25 MB, Word 50 MB). Past a limit the view ends with The rest of this file isn't shown here. and Download
(label restNotShown), or, for a whole file over its limit, the card Too large to preview here. limits takes a partial
object to change them (textBytes, textLines, csvBytes, csvRows, csvColumns, xlsxBytes, xlsxCells, docxBytes,
chunkBytes, inFlight, cacheBytes and the archive caps). Content search never goes below the largest document the service
indexes.
CSS properties. The viewer reads the same --plycdn-* properties as the other components (--plycdn-accent, --plycdn-text,
--plycdn-muted, --plycdn-surface, --plycdn-border, --plycdn-radius, --plycdn-font-family, --plycdn-focus,
--plycdn-control-height) and adds --plycdn-viewer-height (default 42rem), --plycdn-viewer-background (behind pages and
pictures), --plycdn-card-icon, --plycdn-mark (matched words), --plycdn-highlight (the matched passage) and
--plycdn-mono-font. data-theme="dark" on an ancestor switches to the dark defaults.
Labels. Every word is in labels; the ones worth translating first are the card sentences tooLarge, unreachable,
unreadable, unsupportedHere and noLink, download and tryAgain, and the three that explain a partial view:
restNotShown ("The rest of this file isn't shown here."), loadedPart ("Showing the first {loaded} of {size}") and
pictureNotShown ("Picture not shown here"). The type words (typePdf, typeWord, typeSpreadsheet and the rest) name a file
on its card. ContentLabels carries the same words as optional entries, so a label set written before the viewer still compiles.
What it shows. Video and audio play, images show, PDFs, Word, Excel, CSV and text open in place reading only the part on the
screen, and anything else (PowerPoint, ZIP and other archives) gets a download card. HTML, XML, code and Markdown are shown as
text, never rendered. What each type shows, the
page policy it needs (img-src with blob: for Word pictures, frame-src for the PDF fallback) and
the errors are in the step-by-step guide.
7Go live and watch live
Two components cover live streaming, both in @plycdn/angular/video (the same PlycdnVideoModule.forRoot(...) as the player). Live inputs themselves are made on your
server (Storage & video with ASP.NET Core); how live streaming works, and the choice between its two delivery modes, is in the
Video guide.
Broadcast from the page
<plycdn-live-broadcaster [liveInputId]="stage.liveInputId" quality="hd" [sources]="['camera', 'microphone']"
(stateChange)="onBroadcast($event)"></plycdn-live-broadcaster>
- No key in the browser. At every start and every reconnect the component asks your backend for a publish token
(
POST {apiBaseUrl}/live-inputs/{id}/publish-token; yourIPlycdnLiveAuthorizerdecides who may go live, and refuses everyone until you register one). Use[getPublishToken]to ask your own route: a function from the live input's id to a promise or an observable of{ token, whipUrl, expiresAt }.PlycdnBroadcastService.publishToken(liveInputId)is the default call. - What it shows: a preview, camera and microphone choices, a microphone level you can read as a meter, Share screen where the browser has it, Go live and End broadcast, and the state in words, announced politely to screen readers. Every control is a labelled native control.
- Inputs:
[liveInputId],[sources](any ofcamera,microphone,screen; all by default),[quality](sd,hddefault,fhd: the picture size and bitrate sent),[reconnectWindowSeconds](how long to keep reconnecting after a drop; use your input's setting, default 60),[whipUrl](when your token route does not return an address),[autoPrepare](ask for the camera and microphone as soon as it shows),[labels]and[messages](reword or translate every control and sentence). (stateChange)emits{ status, error, message }:statusisidle,preparing,connecting,live,reconnecting,endedorerror. Codes includecamera_denied,microphone_denied,screen_denied,no_camera,no_microphone,device_in_use,broadcast_unsupported(a browser that cannot go live),publish_token_invalid,connection_failed,connection_lost(the reconnect window was used up), and the live codes of your backend such aslive_input_disabled,live_input_busy,live_cap_reachedandfeature_not_in_plan; a code with no sentence of yours reads as the defaults inBROADCASTER_MESSAGES.- A page that broadcasts must be served over
https://(orlocalhostwhile you build); the visitor is asked for permission, and a refusal is shown as a sentence with Try again.
Watch live
<plycdn-live-player [libraryId]="stage.libraryId" [liveInputId]="stage.liveInputId"
latencyTarget="lowest" [showLatency]="true" (stateChange)="onLive($event)"></plycdn-live-player>
- Links come from your backend (
POST {apiBaseUrl}/signwith the library asbucketId, theliveInputIdand themode); your authorizer decides who may watch (PlycdnOperation.WatchVideo, andGetVideoforGET {apiBaseUrl}/live-inputs/{id}). Links are renewed before they expire (80 % of[ttlSeconds], 15 minutes by default). [mode]isbroadcastorrealtime; leave it out to follow the input's own delivery mode. A real-time viewer beyond the input's audience cap is given broadcast automatically and the player says "Low-latency playback".[latencyTarget]islowest(default) orbalanced; a viewer can also choose Lowest delay or Smoother playback.- While the stream is not running the player says Waiting for the stream to start and checks every 5 seconds (
live_not_startedis not an error). It shows Reconnecting when the encoder drops, a LIVE button that returns to the live edge, a quality menu and, with[showLatency]="true", the delay behind live. A stream that has just gone on air in its original quality shows More qualities coming until its other qualities are added (the player takes them up by itself). When the stream ends it plays the recording in the same place ([playRecording]="false"turns that off). (stateChange)emits{ status: 'loading' | 'ready' | 'error', liveState, error, message }, withliveStatewhat the stream is doing (waiting,live,reconnecting,ended).[messages]and[labels]reword it.- For a player of your own:
PlycdnLiveService.sign(libraryId, liveInputId, mode, ttlSeconds?)returns the links (url,fallbackUrlorwhepUrl,mode,latency,streamId,expiresAt) and rejects withlive_not_started(retryable) while nothing is streaming;getLiveInput(liveInputId)returns the input as a browser may see it (id,state,delivery,stream). - Captions, rewind and ad breaks. A stream with captions gets a captions menu (the languages come from
PlycdnLiveService.getStreamCaptions(streamId), throughGET {apiBaseUrl}/live-streams/{id}/captions). A stream with a rewind window (dvrWindowSecondsabove 0) gets a seek bar, and the keys of the video player: Space or K, ← and → (5 s), J and L (10 s), Home, End (back to live), ↑ and ↓, M and C. During an ad break the player shows how long is left and holds seeking;(adEvent)emitsadBreakStartandadBreakEnd(breakId,durationSeconds), and with[adQuartiles]="true"alsoadBreakFirstQuartile,adBreakMidpointandadBreakThirdQuartile. - Protected streams play in browsers that support one of the stream's key systems; others show
playback_unsupported. The recording of a protected stream does not play in<plycdn-player>in this release: set[playRecording]="false"for it (Integration guide). - New refusals worded in
PLYCDN_MESSAGES:live_setting_conflict,live_setting_not_in_planandprotection_not_configured.
If your site sends a Content-Security-Policy, add the live hosts to the delivery ones: connect-src https://*.plycdn.net https://*.live.plycdn.com.
Watch a shared stream
A share link can be watched on your own page with <plycdn-watch>. It needs no account, no PlycdnVideoModule.forRoot route and nothing from your backend: it calls plycdn's
public watch routes directly. Import PlycdnVideoModule (the same module as the players) and use it:
<plycdn-watch code="https://watch.plycdn.com/AbCdEfGhIjKlMnOpQrStUv" (stateChange)="onWatch($event)"></plycdn-watch>
[code]is the link's address or only the code at its end.[apiBase]is the plycdn API address (https://api.plycdn.comwhen left out).- A password is asked for in a labelled box when the link has one. A wrong one shows Wrong password, try again; after too many wrong tries it shows Too many tries, try again in N minutes.
- While the stream has not started it shows Starting soon and looks again every 10 seconds. A live stream plays with a Live button and a captions menu when the stream has captions. When the stream ends it shows This stream has ended, then plays the recording if the link shows it. A link that is turned off, expired or deleted shows This link is not available.
- Links are renewed before they expire (after 12 minutes of their 15) without interrupting playback.
- The link's brand is drawn as the link answers it: the logo (at most 32, 48 or 72 pixels high, by the brand's
logoSize:small,mediumorlarge), colours and theme, one of three layouts (cinema,standard,side_panel), the title and description, the three sentences, the button to your site and up to three footer links. Text is shown as typed, never as markup, and onlyhttps://links are used. A link that is not available shows the plain built-in page. What you set in[options]always wins over the brand, key by key: setcolors.accentand the brand's accent is ignored, but its other colours stay. The page's logo is served by plycdn, so allow images fromhttps://watch.plycdn.com(and your own watch domain, if the page is served on one) in your Content-Security-Policy. [options]holds every sentence and colour in one object, and a page changes only what it names:{ text: { starting: 'Gleich geht es los' }, colors: { accent: '#7c3aed', background: '#101418' } }. The sentences areloading,starting,ended,notFound,passwordPrompt,passwordLabel,passwordButton,wrongPassword,tooManyTries(with{minutes}),tooManyTriesOne,error,unsupported,retry,live,goToLive,captions,captionsOffandrecording; the colours arebackground,text,muted,surface,accent,accentInk,onAccent,errorandborder.WATCH_OPTIONSholds the defaults. The look can also be set with the custom properties--plycdn-watch-background,--plycdn-watch-accentand so on.(stateChange)emits{ screen, error }, withscreenloading,password,starting,live,recording,ended,notFoundorerror.- For a page of your own:
PlycdnWatchCore(from@plycdn/angular/video) does everything above for a<video>element you give it.
If your site sends a Content-Security-Policy, add the API with the delivery and live hosts: connect-src https://api.plycdn.com https://*.plycdn.net.
8The client and the uploader
PlycdnStorageClient returns Observables: listObjects, getObject, startUpload, getUpload,
renewUpload, completeUpload, abortUpload, sign (with a videoId: a PlaybackLink) and getVideo. An
organization can hold at most 1,000 open uploads at once; startUpload beyond that fails with
plan_limit_reached until one completes, is aborted or expires, so abort uploads you no longer need.
PlycdnUploader is the framework-free uploader the component uses:
import { PlycdnUploader } from '@plycdn/angular/storage';
const uploader = new PlycdnUploader(storage.asSessionApi());
const upload = uploader.upload(file, {
bucketId, key: 'week-1/intro.mp4',
onProgress: (sent, total) => {},
onStateChange: state => {}, // starting, uploading, paused, retrying, offline, completing, stored, failed, aborted
});
upload.pause(); upload.resume();
const object = await upload.done; // or: await upload.abort();
done rejects with { code, status, retryable } (the server's code, or network_unreachable), or with an
AbortError after abort(). retrying and offline are temporary: sending carries on by itself.
Unfinished uploads from earlier visits:
uploader.pendingUploads(bucketId); // [{ bucketId, key, size, lastModified, uploadId, expiresAt, entry }]
await uploader.forget(pending); // end that session and stop offering it
uploader.forgetAll(bucketId?); // forget them all (for example on sign-out); the sessions expire on their own
new PlycdnUploader(api, transport?, store?, { persistNames: false }) keeps object keys out of storage (key
is then empty in pendingUploads). The store defaults to localStorage; any object with get, set and
delete (and keys for listing) works.
Tags on links: a sign request can carry an optional tags (names and values as in the ASP.NET Core guide). Your backend decides whether they are used: by default tags a browser sends are ignored, so set them on your server.
9Theme
Everything is a CSS custom property on the component or any ancestor: --plycdn-accent,
--plycdn-on-accent, --plycdn-text, --plycdn-muted, --plycdn-surface, --plycdn-border,
--plycdn-error, --plycdn-success, --plycdn-focus, --plycdn-link, --plycdn-radius,
--plycdn-font-family, --plycdn-font-size, --plycdn-spacing, --plycdn-control-height,
--plycdn-button-padding, --plycdn-progress-height, --plycdn-progress-track,
--plycdn-drop-background, --plycdn-drop-active-background and --plycdn-background; type adds --plycdn-line-height, and the video player takes --plycdn-player-background, --plycdn-player-bar, --plycdn-player-text and --plycdn-player-max-height (default 80vh). Fonts are
inherited. The file viewer adds --plycdn-viewer-height, --plycdn-viewer-background, --plycdn-card-icon, --plycdn-mark and --plycdn-highlight (File viewer). data-theme="dark" on the component or an ancestor switches to the dark defaults.
plycdn-upload, plycdn-file-browser, plycdn-player {
--plycdn-accent: #0b6b57;
--plycdn-radius: 6px;
}
Sizes are shown in binary units: 1 GB is 2^30 bytes, the same GB your bill uses.
10Troubleshooting
- Every call fails with
forbidden. Your backend has noIPlycdnStorageAuthorizer, or it refused that operation. The default refuses everything. - Calls go to the wrong place.
apiBaseUrlmust reach your backend's plycdn routes. A page that is not JSON (an HTML fallback) is reported asinvalid_response, never shown as an empty folder. - The player says it cannot play this video. The browser can neither play the stream natively nor load the player's streaming code: check that your Content-Security-Policy allows the delivery hosts and your own scripts.